lighttpd 1.4.23 with modcache v1.8.0 安装指南
cd /tmp
wget http://lighttpd-improved.googlec ... .4.23.v1.8.0.tar.gz
tar -zxvf lighttpd-1.4.23.v1.8.0.tar.gz
cd lighttpd-1.4.23
./configure -prefix=/opt/lighttpd --sysconfdir=/opt/lighttpd/conf --disable-ipv6 --with-memcache --with-fam --without-bzip2
make
make install
注
使用--with-fam
注意gamin-devel包的安装
rpm -ivh gamin-devel-0.1.7-8.el5.i386.rpm
mkdir /opt/lighttpd/conf
cp doc/lighttpd.conf /opt/lighttpd/conf
mkdir /opt/lighttpd/logs
# 安装文件下的启动脚本
cp doc/rc.lighttpd.redhat /etc/init.d/lighttpd
chkconfig lighttpd on
修改/etc/init.d/lighttpd,将配置文件变量更改为:
vi /etc/init.d/lighttpd
#LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
LIGHTTPD_CONF_PATH=/opt/lighttpd/conf/lighttpd.conf
#lighttpd="/usr/sbin/lighttpd"
lighttpd="/opt/lighttpd/sbin/lighttpd"
配置
vi /opt/lighttpd/conf/lighttpd.conf
增加mod_mem_cache
修改
server.document-root = "/srv/www/htdocs/"
为
server.document-root = "/opt/"
server.errorlog = "/var/log/lighttpd/error.log"
为
server.errorlog = "/opt/lighttpd/logs/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"
为
accesslog.filename = "/optlighttpd/logs/access.log"
#server.port = 81
为
#server.port = 8081
#server.pid-file = "/var/run/lighttpd.pid"
为
server.pid-file = "/var/run/lighttpd.pid"
#status.status-url = "/server-status"
#status.config-url = "/server-config"
为
status.status-url = "/server-status"
status.config-url = "/server-config"
mkdir /opt/imx_images/lighttpd
chmod 777 /opt/imx_images/lighttpd
启动
/opt/lighttpd/sbin/lighttpd -f /opt/lighttpd/conf/lighttpd.conf
或是
service lighttpd start
性能优化
server.event-handler = "linux-sysepoll"
server.network-backend = "linux-sendfile"
server.stat-cache-engine = "fam" # either fam, simple or disabled
日志轮询
$HTTP["host"] == "www.test.org " {
...
server.errorlog = "/opt/lighttpd/logs/test/error.log"
# accesslog.filename = "/opt/lighttpd/logs/test/access.log"
accesslog.filename = “|/usr/sbin/cronolog /opt/lighttpd/logs/test/access_log.%Y%m%d”
}
wget http://lighttpd-improved.googlec ... .4.23.v1.8.0.tar.gz
tar -zxvf lighttpd-1.4.23.v1.8.0.tar.gz
cd lighttpd-1.4.23
./configure -prefix=/opt/lighttpd --sysconfdir=/opt/lighttpd/conf --disable-ipv6 --with-memcache --with-fam --without-bzip2
make
make install
注
使用--with-fam
注意gamin-devel包的安装
rpm -ivh gamin-devel-0.1.7-8.el5.i386.rpm
mkdir /opt/lighttpd/conf
cp doc/lighttpd.conf /opt/lighttpd/conf
mkdir /opt/lighttpd/logs
# 安装文件下的启动脚本
cp doc/rc.lighttpd.redhat /etc/init.d/lighttpd
chkconfig lighttpd on
修改/etc/init.d/lighttpd,将配置文件变量更改为:
vi /etc/init.d/lighttpd
#LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
LIGHTTPD_CONF_PATH=/opt/lighttpd/conf/lighttpd.conf
#lighttpd="/usr/sbin/lighttpd"
lighttpd="/opt/lighttpd/sbin/lighttpd"
配置
vi /opt/lighttpd/conf/lighttpd.conf
增加mod_mem_cache
修改
server.document-root = "/srv/www/htdocs/"
为
server.document-root = "/opt/"
server.errorlog = "/var/log/lighttpd/error.log"
为
server.errorlog = "/opt/lighttpd/logs/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"
为
accesslog.filename = "/optlighttpd/logs/access.log"
#server.port = 81
为
#server.port = 8081
#server.pid-file = "/var/run/lighttpd.pid"
为
server.pid-file = "/var/run/lighttpd.pid"
#status.status-url = "/server-status"
#status.config-url = "/server-config"
为
status.status-url = "/server-status"
status.config-url = "/server-config"
mkdir /opt/imx_images/lighttpd
chmod 777 /opt/imx_images/lighttpd
启动
/opt/lighttpd/sbin/lighttpd -f /opt/lighttpd/conf/lighttpd.conf
或是
service lighttpd start
性能优化
server.event-handler = "linux-sysepoll"
server.network-backend = "linux-sendfile"
server.stat-cache-engine = "fam" # either fam, simple or disabled
日志轮询
$HTTP["host"] == "www.test.org " {
...
server.errorlog = "/opt/lighttpd/logs/test/error.log"
# accesslog.filename = "/opt/lighttpd/logs/test/access.log"
accesslog.filename = “|/usr/sbin/cronolog /opt/lighttpd/logs/test/access_log.%Y%m%d”
}
此日志的引用通告 URL:
http://www.imx365.net/blog/tb.cgi/19431
其实我一直都不知道您在想些什么,有什么感触。说真的,您的评论对于我来说很重要...
还没有人评论过
发表评论

(访客)