« [firefox扩展]blog写作工具 | Main | 年关 »

在freebsd 上安装lighttpd

作者:virushuo 发表于 2005-12-23 02:12 最后更新于 2005-12-23 02:12
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明


听说lighttpd这个web server很好,速度很快,内存占用小。于是打算装一个看看。

lighttpd已经port在freebsd里面了。到/usr/ports/www/lighttpd下面make config ,选定需要的东西,然后make install安装就可以了。

装后需要一个配置文件,可以先用默认的。
cp /usr/local/etc/lighttpd.conf.sample /usr/local/etc/lighttpd.conf
然后用
echo lighttpd_enable=\"YES\" >> /etc/rc.conf (是>>不是>,千万别错了)
/usr/local/etc/rc.d/lighttpd.sh start
第一次启动,可能会碰上一些问题。

我碰上的依此有:

1
# /usr/local/etc/rc.d/lighttpd.sh start
Starting lighttpd.
2005-12-22 23:18:30: (server.c.418) Are you nuts ? Don't apply a SUID bit to this binary

这个错误原因是/usr/local/sbin/lighttpd 的owner是root,而lighttpd.conf里面写了:
## change uid to <uid> (default: don't care)
server.username            = "www"

## change uid to <uid> (default: don't care)
server.groupname           = "www"

所以我们需要chown www /usr/local/sbin/lighttpd

2 # 2005-12-22 23:32:36: (mod_accesslog.c.512) opening access-log failed: Permission denied /var/log/lighttpd.access.log
2005-12-22 23:32:36: (server.c.670) Configuration of plugins failed. Going down.

这是因为www没有权限在/var/log建立文件。同样还有lighttpd.error.log也会报出来类似错误。
touch /var/log/lighttpd.access.log
touch /var/log/lighttpd.error.log
同样给www读写权限。
chown www /var/log/lighttpd.access.log
chmod 666 /var/log/lighttpd.access.log
...
这样就可以了。


再来/usr/local/etc/rc.d/lighttpd.sh start 就可以启动了。

以下文章供您参考:

从SOA说开去 - Mar 10, 2008

德国式的幽默 - Mar 06, 2008

说总是比做容易 - Mar 03, 2008

TrackBack

TrackBack URL for this entry:
http://www.devep.net/cgi-bin/mt/devtb.pl/416

Comments

lighttpd这个httpd是很不错,单纯从性能上来说,比Apache要高不少.

如果对网站的性能满意,还可以在前面加一个Squid做Cache代理,配置的好,可以节省很多的资源:)

Post a comment


about me:
me.jpg
CC License. Some rights reserved.
署名·非商业用途·保持一致
本站之所有未作特别说明的内容均使用 创作共用协议.
POWERED_BY_MT_3.2