栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > 服务器

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

服务器 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/184953.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号