The configuration of lighttpd is quite simple. You have one lighttpd.conf in /etc/lighttpd
and some additional module config files:
/etc/lighttpd/conf-enabled$ ls -al
total 8
drwxr-xr-x 2 root root 4096 Apr 19 09:15 .
drwxr-xr-x 4 root root 4096 Apr 10 12:23 ..
lrwxrwxrwx 1 root root 30 Apr 10 12:12 05-auth.conf -> ../conf-available/05-auth.conf
lrwxrwxrwx 1 root root 35 Apr 10 12:12 10-accesslog.conf -> ../conf-available/10-accesslog.conf
lrwxrwxrwx 1 root root 29 Apr 10 12:12 10-cgi.conf -> ../conf-available/10-cgi.conf
lrwxrwxrwx 1 root root 33 Apr 10 12:12 10-fastcgi.conf -> ../conf-available/10-fastcgi.conf
lrwxrwxrwx 1 root root 31 Apr 10 12:12 10-proxy.conf -> ../conf-available/10-proxy.conf
lrwxrwxrwx 1 root root 29 Apr 10 12:12 10-ssl.conf -> ../conf-available/10-ssl.conf
lrwxrwxrwx 1 root root 32 Apr 19 09:15 10-status.conf -> ../conf-available/10-status.conf
lrwxrwxrwx 1 root root 37 Apr 10 12:25 15-fastcgi-php.conf -> ../conf-available/15-fastcgi-php.conf
B.t.w. I do like the linking to /conf-enabled and /conf-disabled.
That is my whole lighttpd.conf: (so leaving https, auth and php config to the files in /conf-enabled)
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite"
)
server.document-root = "/var/www"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
index-file.names = ( "index.php", "index.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
dir-listing.encoding = "utf-8"
server.dir-listing = "disable"
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/x-javascript", "text/css", "text/html", "text/plain" )
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
$HTTP["host"] =~ "^domain\.net$" {
url.redirect = ( "^/(.*)" => "http://www.domain.net/$1" )
}
$HTTP["host"]=~ "domain1|domain2" {
proxy.balance = "fair"
proxy.server = ("" =>
(
( "host" => "127.0.0.1", "port" => 4001 )
))
}
$HTTP["remoteip"] =~ "127.0.0.1" {
alias.url += ("/munin/" => "/var/cache/munin/www/")
}
$HTTP["host"]=~ "domain.org" {
server.document-root = "/var/www-org"
}
So what I really like about lighttpd is the fact that based on some rules you can override quite every single server parameter.
Alias, rewrites, Proxy, document-root, just everthing can be configured based on hosts, ips, etc.