#lighttpd默认只启动一个进程工作,但也支持apache那样启动多个进程
server.max-worker = 4
# max-connections == max-fds/2 (maybe /3)
server.max-connections = 1024
server.max-fds = 2048
#Maximum number of seconds until an idling keep-alive connection is dropped.
server.max-keep-alive-idle = 5
server.max-keep-alive-requests = 1000
#stat() system call caching.
#lighttpd can utilize FAM/Gamin to cache stat call.
#possible values are: disable, simple or fam.
#disable
#simple (default) cache each stat() call for one second.
#fam if FAM or gamin are installed and lighty is linked against those libraries you can use them to control the freshness of the stat-cache.
server.stat-cache-engine = “simple”
#Module: mod_alias
alias.url = ( “/cgi-bin/” => “/var/www/servers/www.example.org/cgi-bin/” )
#You can add additional aliases by:
alias.url += ( “/content” => “/var/www/servers/www.somecontent.org/” )
#compress
#override default set of allowed encodings
compress.allowed-encodings = (”bzip2″, “gzip”, “deflate”)
#compress.cache-dir
compress.cache-dir = “/var/www/cache/”
#compress.filetype
#mimetypes which might get compressed
#Keep in mind that compressed JavaScript and CSS files are broken in some browsers. Not setting any filetypes will result in no files being compressed.
#Default: not set
compress.filetype = (”text/plain”, “text/html”)
#Display compressed files
$HTTP["url"] =~ “\.diff\.gz” {
setenv.add-response-header = ( “Content-Encoding” => “gzip” )
mimetype.assign = ()
}
#Compressing Dynamic Content
zlib.output_compression = On
zlib.output_handler = 1
PHP
To compress dynamic content with PHP please enable ::
zlib.output_compression = On
zlib.output_handler = 1
in the php.ini as PHP provides compression support by itself.
mod_compress of lighttpd 1.5 r1992 may not set correct Content-Encoding with php-fcgi.
A solution to that problem would be:
1.disable mod_compress when request a php file::
$HTTP["url"] !~ “\.php$” {
compress.filetype = (”text/plain”, “text/html”, “image/gif”, “text/javascript”, “text/css”, “text/xml”)
}
2.enable mod_setenv of your lighttpd::
server.modules += ( “mod_setenv” )
3.manually set Content-Encoding::
最活跃的读者