时间:2016-02-26 18:49 来源: 我爱IT技术网 作者:佚名
欢迎您访问我爱IT技术网,今天小编为你分享的电脑教程是服务器系列之:【CentOS下Lighttpd Web服务器安装与配置方法】,下面是详细的分享!
CentOS下Lighttpd Web服务器安装与配置方法
OS: CentOS release 5.5Lighttpd: 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目录下创建一个文件index.html,内容如下:
Hello Lighttpd!
然后访问:http://localhost/index.html
配置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
以上就是关于CentOS下Lighttpd Web服务器安装与配置方法的服务器维护教程分享,更多电脑教程请移步到>>电脑教程频道。
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
