存档

文章标签 ‘lighttpd’

Lighttpd 的安装配置

2009年12月2日 稀饭 没有评论

lighttpd(http://lighttpd.net/)和apache一样是开源的,与apache相比,虽然功能不及apache完善,稳定性也不如apache,但是,不管是服务静态页面,还是服务动态内容(CGI,PHP),它都比apache快,用于ad banner之类的WEB服务器是最恰当不过了。

本文从应用的角度,说明如何安装、配置lighttpd。

(1) 安装

可从http://lighttpd.net/download/下载最新的源码(.tar.gz)或者rpm包。如果下载的是.tar.gz文件,则和GNU的其他软件一样,先./configure一下,然后 make && make install就搞定了。但是如果你想定制一些功能,就得好好看看解压后README, INSTALL以及./configure –help的输出结果了。这里仅仅说一下如何从源码安装,其他安装方式可参考 http://trac.lighttpd.net/trac/wiki/TutorialInstallation。
阅读全文…

鞋衫各式名品专卖

收藏与分享
分类: lighttpd 标签: ,

用lighttpd加速SQUID

2009年12月2日 稀饭 没有评论

看到这个标题,大家也许会觉得奇怪:SQUID本身就是加速软件,lighttpd还怎么加速SQUID?

方法:用lighttpd+mod_proxy 跑80 端口,指定后端proxy server是127.0.0.1:81,squid改到81端口

lighttpd.conf 相关内容:

server.port = 80
proxy.server = ( “/” =>
(
( “host” => “127.0.0.1″, “port” => 81 )
)
)
server.protocol-http11=”disable”

原理更简单:lighttpd使用的writev和sendfile系统调用比squid用的write系统调用效率高很多。参考C10KScalable networking PDF中关于writev,sendfile的说明。

实际效果呢:五台最高跑50M的squid server,换lighttpd+squid模式后,高峰长期跑满100M。

收藏与分享
分类: cache, cdn, lighttpd, squid 标签: , , ,

使用Nginx/Lighttpd作为反向代理服务器

2009年10月25日 稀饭 没有评论

反向代理服务已经越来越广泛的应用于高负载的Web站点中,常用来作为Reverse Proxy的有Squid、Apache、Lighttpd、Nginx等,后两个轻量级的应用因为其优秀的表现已迅速占领了大量市场,本文只讨论后两者的简单应用(用proxy处理静态文件而把动态文件交给后端的Web服务器来处理)

安装环境
操作系统: Debian 4.0 r3
Kernel: 2.6.18-6-686
阅读全文…

简单生活。简单运动

收藏与分享

lighttpd的日志rotate

2009年10月25日 稀饭 没有评论

之前找到的通过logrotate计划任务来截断lighttpd的日志目前看起来并不好用,为了更好的解决lighttpd的日志rotate,找到了cronolog。从其网站转载一段说明:

cronolog is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time. When the expanded filename changes, the current file is closed and a new one opened. cronolog is intended to be used in conjunction with a Web server, such as Apache, to split the access log into daily or monthly logs.
阅读全文…

收藏与分享

lighttpd+modcache实现对小图片的Cache

2009年10月25日 稀饭 没有评论

安装环境
操作系统: CentOS release 5.2 (Final)
Kernel: 2.6.18-92.el5PAE

软件列表
fam-latest.tar.gz
gamin-0.1.10.tar.gz
pcre-7.9.tar.gz
lighttpd-1.4.23.modcache.v.1.8.0.tar.gz
阅读全文…

收藏与分享