用户名:
密 码: 记住
您当前的位置:首页 > 站长百科 > 服务器技术

CentOS下Lighttpd Web服务器安装与配置方法

时间:2015-01-18  来源:互联网  作者:佚名
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目录下创建一个文件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
来顶一下
返回首页
返回首页
推荐资讯
【图文教程】dede织梦网站后台如何发表文章? 【图文教程】dede织梦网站后台如何对于新手站长可能不了解,dede织梦后台是如何发文章的。下面
2014站长圈十大事件:PR已死 移动算法兴起 2014站长圈十大事件:PR已死 移动算2014年即将过去,虽然站长圈相比过去几年稍显沉寂,但&ldquo
相关文章
    无相关信息
栏目更新
栏目热门