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
您可能感兴趣的文章:

声明:本站(华域联盟www.cnhackhy.com)所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。