Lighttpd

来自开放百科 - 灰狐
2015年3月7日 (六) 02:50Allen (讨论 | 贡献)的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到: 导航, 搜索
Lighttpd-90x90.gif

Light footprint + httpd = Lighttpd

飞得更高、更快

目录

简介

Lighttpd-64.jpg是一个德国人领导的开源软件,其根本的目的是提供一个专门针对高性能网站,安全、快速、兼容性好并且灵活的web server环境。具有非常低的内存开销,cpu占用率低,效能好,以及丰富的模块等特点。lighttpd是众多OpenSource轻量级的web server中较为优秀的一个。支持FastCGI, CGI, Auth, 输出压缩(output compress), URL重写, Alias等重要功能,而Apache之所以流行,很大程度也是因为功能丰富,在lighttpd上很多功能都有相应的实现了,这点对于apache的用户是非常重要的,因为迁移到lighttpd就必须面对这些问题。

在google搜索了一下,简体中文介绍lighttpd的文章几乎没有,大多数都是台湾同胞的Big5内容。因此在接下来的时间里,想好好写一篇介绍lighttpd,以及简单的benchmark的文章。

实用起来lighttpd确实非常不错,上文提到的apache overload的问题,用lighttpd就完全解决了。apache主要的问题是密集并发下,不断的fork()和切换,以及较高(相对于 lighttpd而言)的内存占用,使系统的资源几尽枯竭。而lighttpd采用了Multiplex技术,代码经过优化,体积非常小,资源占用很低,而且反应速度相当快。

利用apache的rewrite技术,将繁重的cgi/fastcgi任务交给lighttpd来完成,充分利用两者的优点,现在那台服务器的负载下降了一个数量级,而且反应速度也提高了一个甚至是2个数量级!

新闻

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Lighttpd Thanks, Wikipedia.

自http://blog.lighttpd.net/xml/rss20/feed.xml加载RSS失败或RSS源被墙

基本操作

# killall -u www
# /usr/local/sbin/lighttpd -f /usr/local/etc/lighttpd.conf &

将其加入自动启动的服务里

安装指南

http://trac.lighttpd.net/trac/wiki/TutorialInstallation
  • 在 Ubuntu 5.04(FreeBSD 5.5)上安装 Ruby, Rails, Lighttpd, MySQL

点击 Install Ruby Rails Lighttpd MySQL on Ubuntu or FreeBSD

Python and Lighttpd

Appliction on Lighttpd

Modules

lighttpd 404 redirect

$HTTP["host"] == "www.myweb.com" {
 server.document-root = "/usr/local/www/data/myweb.com/"
 server.error-handler-404   = "/404.html"
}

配置样例

Server Status

Lighttpd Server Status

vi lighttpd.conf

server.modules              = (
"mod_status",
status.status-url          = "/server-status"

DDoS

Apache2 中有防止DoS攻击的模块mod_evasive,lighttpd中也可以用mod_evasive来限制并发连接数防止DDOS攻击

"mod_evasive",

evasive.max-conns-per-ip = 3

Update

从1.4.10 --> 1.4.19

http://www.lighttpd.net/download/
$ tar zxvf lighttpd-1.4.19.tar.gz
$ cd lighttpd-1.4.19
$ ./configure
$ make
$ su -
# make install
killall -u www
/usr/local/sbin/lighttpd -f /usr/local/etc/lighttpd.conf // 将使用以前 1.4.10 配置

整个升级过程就这么简单 :)

相关链接

Powered By lighttpd

http://trac.lighttpd.net/trac/wiki/PoweredByLighttpd

性能评测

Comment-32x32.png

<discussion>characters_max=300</discussion>

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱