Lighttpd Web服务器安装与配置

本文介绍如何在CentOS 5.5上安装Lighttpd Web服务器,并详细说明了配置PHP支持的过程。包括安装所需软件包、设置服务、测试页面显示及PHP功能验证等步骤。

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

 

转载于:https://www.cnblogs.com/wdpp/archive/2011/03/09/2386268.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值