、安装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目录拷贝过来即可。
# 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目录拷贝过来即可。