lighttpd install

、安装lighttpd

# tar vxzf lighttpd-1.4.18.tar.gz
# cd lighttpd-1.4.18

# ./configure --prefix=/usr/local/lighttpd
# make
# make install

# mkdir /usr/local/lighttpd/htdocs
# mkdir /usr/local/lighttpd/etc
# cp ./doc/lighttpd.conf /usr/local/lighttpd/etc/

3、配置lighttpd

然后修改配置文件 /usr/local/lighttpd/etc/lighttpd.conf

把"mod_fastcgi"前边的#去掉(在24行);

把"mod_cgi"前边的#去掉(在29行)

设置网站根目录 server.document-root = "/usr/local/lighttpd/htdocs/" (40行)

设置错误日志文件路径 server.errorlog = "/usr/local/lighttpd/lighttpd.error.log" (43行)

设置访问日志文件路径 accesslog.filename = "/usr/local/lighttpd/access.log" (116行)

启动服务器

# cd /usr/local/lighttpd/sbin/

# ./lighttpd -f ../etc/lighttpd.conf


如果出现错误请把配置文件中如下内容删除

$HTTP["url"] =~ ".pdf$" {

server.range-requests = "disable"

}

redhat AS4 install

安装过程

1. 下载最新版本: http://www.lighttpd.net/download/lighttpd-1.4.12.tar.gz

2. 解压、安装、配置

shell> tar zxvf lighttpd-1.4.12.tar.gz
shell> cd lighttpd-1.4.12
shell> ./configure --prefix=/usr/local/lighttpd
shell> ./make
shell> ./make install
shell> cp doc/rc.lighttpd.redhat /etc/rc.d/init.d/lighttpd
shell> cp doc/sysconfig.lighttpd /etc/sysconfig/lighttpd
shell> mkdir /etc/lighttpd
shell> cp doc/lighttpd.conf /etc/lighttpd/lighttpd.conf
shell> chkconfig lighttpd on

接下来打开/etc/rc.d/init.d/lighttpd修改lighttpd的值如下

lighttpd="/usr/local/lighttpd/sbin/lighttpd"

打开/etc/lighttpd/lighttpd.conf修改服务的端口,以及文档根目录的路径后启动lighttpd服务

shell> service lighttpd start

更多关于lighttpd的配置请看lighttpd的文档
附注

在lighttpd中可以通过下面的配置来实现每天一个访问日志文件

accesslog.filename = "| /usr/local/lighttpd/bin/rotatelogs /usr/local/lighttpd/logs/access_%Y%m%d.log 86400"

其中rotatelogs直接从apache的bin目录拷贝过来即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值