华域联盟 Linux CentOS下Lighttpd Web服务器安装与配置方法

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目录下创建一个文件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服务器安装与配置方法

转载请保留出处和原文链接:https://www.cnhackhy.com/44382.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部