Blog信息 |
blog名称: 日志总数:1304 评论数量:2242 留言数量:5 访问次数:7598770 建立时间:2006年5月29日 |

| |
[网站架构]RedHat Linux 下安装lighttpd 软件技术
lhwork 发表于 2007/1/19 9:23:36 |
首先介绍一下lighttpd
官方主页:www.lighttpd.netLighttpd是一个德国人领导的开源软件,其根本的目的是提供一个专门针对高性能网站,安全、快速、兼容性好并且灵活的web server环境。具有非常低的内存开销,cpu占用率低,效能好,以及丰富的模块等特点。
lighttpd是众多OpenSource轻量级的web server中较为优秀的一个。支持FastCGI, CGI, Auth, 输出压缩(output compress), URL重写, Alias等重要功能,而Apache之所以流行,很大程度也是因为功能丰富,在lighttpd上很多功能都有相应的实现了,这点对于apache的用户是非常重要的,因为迁移到lighttpd就必须面对这些问题。
实用起来lighttpd确实非常不错,上文提到的apache overload的问题,用lighttpd就完全解决了。apache主要的问题是密集并发下,不断的fork()和切换,以及较高(相对于lighttpd而言)的内存占用,使系统的资源几尽枯竭。而lighttpd采用了Multiplex技术,代码经过优化,体积非常小,资源占用很低,而且反应速度相当快。
利用apache的rewrite技术,将繁重的cgi/fastcgi任务交给lighttpd来完成,充分利用两者的优点,现在那台服务器的负载下降了一个数量级,而且反应速度也提高了一个甚至是2个数量级!
安装过程
1. 下载最新版本: http://www.lighttpd.net/download/lighttpd-1.4.12.tar.gz
2. 解压、安装、配置
shell> tar zxvf lighttpd-1.4.12.tar.gzshell> cd lighttpd-1.4.12shell> ./configure --prefix=/usr/local/lighttpdshell> ./makeshell> ./make installshell> cp doc/rc.lighttpd.redhat /etc/rc.d/init.d/lighttpdshell> cp doc/sysconfig.lighttpd /etc/sysconfig/lighttpdshell> mkdir /etc/lighttpdshell> cp doc/lighttpd.conf /etc/lighttpd/lighttpd.confshell> 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目录拷贝过来即可。
参考
http://www.hzqbbc.com/blog/arch/2005/05/lighttpdthttpds.html |
|
回复:RedHat Linux 下安装lighttpd 软件技术
菜鳥(游客)发表评论于2007/1/23 2:03:38 |
|
回复:RedHat Linux 下安装lighttpd 软件技术
菜鳥(游客)发表评论于2007/1/23 0:16:50 |
請問這一句
接下来打开/etc/rc.d/init.d/lighttpd修改lighttpd的值如下
lighttpd="/usr/local/lighttpd/sbin/lighttpd"
到底要在哪裡修改?找不到呢!請賜教 |
|
» 1 »
|