安装环境
操作系统: 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
软件存放位置
/data/software
安装过程
#cd /data/software/pkg
安装依赖插件pcre, fam, gamin
关于FAM http://oss.sgi.com/projects/fam/faq.html
关于gamin http://www.gnome.org/~veillard/gamin/overview.html
See also: http://trac.lighttpd.net/trac/wiki/server.stat-cache-engineDetails
#tar zxvf ../pcre-7.9.tar.gz
#cd pcre-7.9
#./configure
#make && make install
#cd ..
#tar zxvf ../fam-latest.tar.gz
#cd fam-2.7.0/
#./configure
#make && make install
#cd ..
#tar zxvf ../gamin-0.1.10.tar.gz
#cd gamin-0.1.10
#./configure
#make && make install
安装lighttpd with modcache
#cd /data/software/pkg
#tar zxvf ../lighttpd-1.4.23.modcache.v.1.8.0.tar.gz
#cd lighttpd-1.4.23
#./configure --with-fam --prefix=/usr/local/lighttpd
#make && make install
编辑lighttpd配置文件
#cp doc/lighttpd.conf /etc/
#vi /etc/lighttpd.conf
#启用的modules
server.modules = (
"mod_redirect",
"mod_access",
"mod_status",
"mod_cache",
"mod_proxy",
"mod_compress",
"mod_expire",
"mod_accesslog" )
server.pid-file = "/var/run/lighttpd.pid"
server.max-keep-alive-requests = 16
server.max-keep-alive-idle = 4
server.max-read-idle = 60
server.max-write-idle = 360
#使用epoll作为事件处理
server.event-handler = "linux-sysepoll"
#使用sendfile
server.network-backend = "linux-sendfile"
#修改最大file descriptions,跟squid相同
server.max-fds = 65535
#启用fam作为stat处理方法
server.stat-cache-engine = "fam"
#此项打开以后缓存文件时将忽略?,即a.jpg?xxx和a.jpg?xyz都等同于a.jpg
cache.support-queries = "enable"
#指定本地缓存存放路径
cache.bases = ("/srv/lcache")
#定义刷新
cache.refresh-pattern = (
"\.(?i)(flv)$" => "0 fetchall-for-range-request flv-streaming", # to work with mod_flv_streaming for flv files
"\.(?i)(js|css|xml)$" => "10080", # update js/css/xml every 7 days and on refresh requests
"\.(?i)(htm|html|shtml)$" => "10080", # update html/htm/shtml every 7 days and on refresh requests
"\.(?i)(jpg|bmp|jpeg|gif|png)$" => "60", # update graphics files every 2 hours
"\.(?i)(rar|zip|wmv|avi|mp3|ape|rm|mpeg|mpg|wma|asf|rmvb|flv)$" => "0 fetchall-for-range-request", # cache media file forever
"." => "60 update-on-refresh" # default to update every hour and on refresh requests
)
#允许purge的ip
cache.purge-host = "^(192\.168\.)"
#保存缓存时忽略站点主机名(需要多个站点缓存不同文件的不要启用)
cache.ignore-hostname = "enable"
#后端服务器(源站)
proxy.server = ( "/" =>
( "localhost" =>
(
"host" => "192.168.1.15",
"port" => 80
)
)
)
#这项一定要启用
proxy.worked-with-mod-cache = "enable"
#设置指定IP允许查看服务器状态和缓存命中率
$HTTP["remoteip"] =~ "192\.168\.1\.*" {
status.status-url = "/server-status"
status.stastics-url = "/cache-status"
}
#防盗链
$HTTP["referer"] !~ "^($|http://.*\.(baidu\.com|google\.com|google\.cn))" {
url.redirect = ( ".*" => "http://img1.test.com/a.jpg" )
}
启动lighttpd
#/usr/local/lighttpd/sbin/lighttpd -f /etc/lighttpd.conf
参考文档
http://redmine.lighttpd.net/projects/1/wiki/Docs:Performance
http://blog.fosketts.net/2009/06/29/tuning-lighttpd-linux/
http://trac.lighttpd.net/trac/wiki/server.stat-cache-engineDetails
关于日志rotate和启动脚本
http://www.cyberciti.biz/tips/lighttpd-rotating-logs-with-logrotate.html
http://www.cyberciti.biz/tips/redhat-enterprise-linux-lighttpd-fastcgi-php.html
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://iyubo.blogbus.com/logs/42429307.html
分享到:
相关推荐
简单的一键部署PHP调试环境,适合初学者。集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader
phpLight 2014 是网上首套LightTPD+PHP集成包,集成最新Lighttpd+PHP+MySQL+SQL-Front+Zend Guard Loader+XCache。纯绿色,安装后无需再配置。支持系统服务和非服务两种启动方式,自由切换。一次性安装无需再安装,...
centos7下安装测试成功的所有安装包整合
使用lighttpd的开源代码成功搭建支持cgi的代码包
phpLight 2013 是网上首套LightTPD+PHP集成包, 集成最新Lighttpd+PHP+MySQL+SQL-Front+Zend Guard Loader+XCache。 纯绿色,安装后无需再配置。支持系统服务和非服务两种启动方式,自由切换。 一次性安装无需再安装...
该程序包集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。该程序绿色小巧简易迷你仅有35M,有专门的控制面板。...
Openwrt里架设Lighttpd+PhP5+MYSQL环境标准教程.pdf
参考了网上的一些资源和信息, lighttpd是自己编译出来的,php-cgi是网上下载,合起来可以在android上使用。 里面也包括了配置文件。
"/etc/init.d/lighttpd start" 启动lighttpd 直接访问 127.0.0.1 访问WEB 同时会在使用工具生成两个菜单,一个查看 phpinfo, 一个查看 lighttpd状态, 网站根目录在/var/www/ 下,php.ini 在 /etc/目录下, lighttpd....
Lighttpd__and_modcache.ppt
phpStudy是一个PHP调试环境的程序集成包。该程序包集成最新的Apache+PHP+MySQL+phpMyAdmin+ZendOptimizer,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。该程序不仅包括PHP调试环境,还包括了开发...
vagrant-dokuwiki:带有dokuwiki(arch + lighttpd + php-fpm)的流浪文件已准备好进行生产
首先安装 lighttpd 和 webpy,因为用 kpackagekit 做软件管理,在安装 webpy 的时候会自动安装 flup
varnish+lighttpd配置
如何在ubuntu上实现lighttpd 1、下载mongoose使用mongoose中的example中的websocket_chat,实现websocket 2、websocket_chat源码下载路径 官网:https://cesanta.com 论坛:...
web_share通过Lighttpd分享文件,实现上传下载为什么用Lighttpd?因为它安装包小……为什么这么简陋?因为我菜。欢迎提PR来帮助我改进。这个项目意义何在?帮助不同设备之间传输文件。举个例子:手机和电脑要传文件...
支持FastCGI, CGI, Auth, 输出压缩(output compress), URL重写, Alias等重要功能,而Apache之所以流行,很大程度也是因为功能丰富,在lighttpd上很多功能都有相应的实现了,这点对于apache的用户是非常重要的,因为...
该程序包集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。该程序绿色小巧简易迷你仅有35M,有专门的控制面板。...
我是用lighttpd+nginx+spawn-fcgi+fcgi-2.4.1搭建环境。使用C语言编写后台程序。goahead也可以用。apt install lighttpdapt install nginxapt install spawn-fcgitar -xjvf fcgi-2.4.1-SNAP-0910052249.tar.bz2cd ...