1 # lighttpd configuration file
4 # all other module should only be loaded if really neccesary
23 ## a static document-root, for virtual-hosting take look at the
24 ## server.virtual-* options
25 server.document-root = "/www/"
27 ## where to send error-messages to
28 #server.errorlog = "/var/log/lighttpd/error.log"
30 ## files to check for if .../ is requested
31 index-file.names = ( "index.html", "default.html", "index.htm", "default.htm" )
35 ".pdf" => "application/pdf",
36 ".class" => "application/octet-stream",
37 ".pac" => "application/x-ns-proxy-autoconfig",
38 ".swf" => "application/x-shockwave-flash",
39 ".wav" => "audio/x-wav",
40 ".gif" => "image/gif",
41 ".jpg" => "image/jpeg",
42 ".jpeg" => "image/jpeg",
43 ".png" => "image/png",
45 ".html" => "text/html",
46 ".htm" => "text/html",
47 ".js" => "text/javascript",
48 ".txt" => "text/plain",
53 ## Use the "Content-Type" extended attribute to obtain mime type if possible
54 #mimetypes.use-xattr = "enable"
56 ## send a different Server: header
57 ## be nice and keep it at lighttpd
58 #server.tag = "lighttpd"
60 $HTTP["url"] =~ "\.pdf$" {
61 server.range-requests = "disable"
65 # which extensions should not be handle via static-file transfer
67 # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
68 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
70 ######### Options that are good to be but not neccesary to be changed #######
72 ## bind to port (default: 80)
75 ## bind to localhost (default: all interfaces)
76 #server.bind = "localhost"
78 ## error-handler for status 404
79 #server.error-handler-404 = "/error-handler.html"
80 #server.error-handler-404 = "/error-handler.php"
82 ## to help the rc.scripts
83 server.pid-file = "/var/run/lighttpd.pid"
88 ## If you want name-based virtual hosting add the next three settings and load
92 ## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
93 ## virtual-server-root + http-host + virtual-server-docroot
95 #simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
96 #simple-vhost.default-host = "grisu.home.kneschke.de"
97 #simple-vhost.document-root = "/pages/"
101 ## Format: <errorfile-prefix><status>.html
102 ## -> ..../status-404.html for 'File not found'
103 #server.errorfile-prefix = "/www/error-"
105 ## virtual directory listings
106 #server.dir-listing = "enable"
108 ## send unhandled HTTP-header headers to error-log
109 #debug.dump-unknown-headers = "enable"
111 ### only root can use these options
113 # chroot() to directory (default: no chroot() )
116 ## change uid to <uid> (default: don't care)
117 #server.username = "nobody"
119 ## change uid to <uid> (default: don't care)
120 #server.groupname = "nobody"
123 #compress.cache-dir = "/dev/null/"
124 #compress.filetype = ("text/plain", "text/html")
127 ## read proxy.txt for more info
131 # "host" => "192.168.0.101",
138 ## read fastcgi.txt for more info
142 # "socket" => "/tmp/php-fastcgi.socket",
143 # "bin-path" => "/usr/local/bin/php"
149 #cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
152 #ssl.engine = "enable"
153 #ssl.pemfile = "server.pem"
156 #status.status-url = "/server-status"
157 #status.config-url = "/server-config"
160 ## read authentification.txt for more info
161 #auth.backend = "plain"
162 #auth.backend.plain.userfile = "lighttpd.user"
163 #auth.backend.plain.groupfile = "lighttpd.group"
165 # "/server-status" => (
166 # "method" => "digest",
167 # "realm" => "download archiv",
168 # "require" => "group=www|user=jan|host=192.168.2.10"
170 # "/server-info" => (
171 # "method" => "digest",
172 # "realm" => "download archiv",
173 # "require" => "group=www|user=jan|host=192.168.2.10"
177 #### url handling modules (rewrite, redirect, access)
178 #url.rewrite = ( "^/$" => "/server-status" )
179 #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
181 #### both rewrite/redirect support back reference to regex conditional using %n
182 #$HTTP["host"] =~ "^www\.(.*)" {
183 # url.redirect = ( "^/(.*)" => "http://%1/$1" )
187 #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
190 #ssi.extension = ( ".shtml" )
193 #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
194 #setenv.add-response-header = ( "X-Secret-Message" => "42" )
197 ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
199 #var.mystring = "foo"
203 ## string concat, with integer cast as string, result: "www.foo1.com"
204 #server.name = "www." + mystring + var.bar + ".com"
206 #index-file.names = (foo + ".php") + index-file.names
207 #index-file.names += (foo + ".php")
210 #include /etc/lighttpd/lighttpd-inc.conf
211 ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
212 #include "lighttpd-inc.conf"
215 #include_shell "echo var.a=1"
216 ## the above is same as: