CentOS下Lighttpd Web服务器安装与配置方法
os: centos release 5.5
lighttpd: 1.4.28
安装
sudo yum install lighttpd.i386 lighttpd-fastcgi.i386 lighttpd-mod_mysql_vhost.i386
运行
检查配置文件
lighttpd -t -f lighttpd.conf
启动lighttpd服务
lighttpd -d -f lighttpd.conf
结束lighttpd服务
ctrl+c
或者使用linux的系统服务启动停止lighttpd服务
/etc/init.d/lighttpd start/stop/restart
测试
在/srv/www/lighttpd目录下创建一个文件,内容如下:
hello lighttpd!
然后访问:http://localhost/
配置php支持
编辑/etc/lighttpd/modules.conf文件,将其中以下行前面的注释删除
include "conf.d/fastcgi.conf"
编辑/etc/lighttpd/conf.d/fastcgi.conf文件,添加以下行
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
在/srv/www/lighttpd目录下创建一个文件test.php,内容如下:
<?
phpinfo();
?>
然后访问:http://localhost/test.php
如对本文有疑问,
点击进行留言回复!!
网友评论