1 # lighttpd configuration file
4 # all other module should only be loaded if really neccesary
23 # force use of the "write" backend (closes: #2401)
24 server.network-backend = "write"
26 ## a static document-root, for virtual-hosting take look at the
27 ## server.virtual-* options
28 server.document-root = "/www/"
30 ## where to send error-messages to
31 #server.errorlog = "/var/log/lighttpd/error.log"
33 ## files to check for if .../ is requested
34 index-file.names = ( "index.html", "default.html", "index.htm", "default.htm" )
38 ".pdf" => "application/pdf",
39 ".class" => "application/octet-stream",
40 ".pac" => "application/x-ns-proxy-autoconfig",
41 ".swf" => "application/x-shockwave-flash",
42 ".wav" => "audio/x-wav",
43 ".gif" => "image/gif",
44 ".jpg" => "image/jpeg",
45 ".jpeg" => "image/jpeg",
46 ".png" => "image/png",
48 ".html" => "text/html",
49 ".htm" => "text/html",
50 ".js" => "text/javascript",
51 ".txt" => "text/plain",
56 ## Use the "Content-Type" extended attribute to obtain mime type if possible
57 #mimetypes.use-xattr = "enable"
59 ## send a different Server: header
60 ## be nice and keep it at lighttpd
61 #server.tag = "lighttpd"
63 $HTTP["url"] =~ "\.pdf$" {
64 server.range-requests = "disable"
68 # which extensions should not be handle via static-file transfer
70 # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
71 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
73 ######### Options that are good to be but not neccesary to be changed #######
75 ## bind to port (default: 80)
78 ## bind to localhost (default: all interfaces)
79 #server.bind = "localhost"
81 ## error-handler for status 404
82 #server.error-handler-404 = "/error-handler.html"
83 #server.error-handler-404 = "/error-handler.php"
85 ## to help the rc.scripts
86 server.pid-file = "/var/run/lighttpd.pid"
91 ## If you want name-based virtual hosting add the next three settings and load
95 ## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
96 ## virtual-server-root + http-host + virtual-server-docroot
98 #simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
99 #simple-vhost.default-host = "grisu.home.kneschke.de"
100 #simple-vhost.document-root = "/pages/"
104 ## Format: <errorfile-prefix><status>.html
105 ## -> ..../status-404.html for 'File not found'
106 #server.errorfile-prefix = "/www/error-"
108 ## virtual directory listings
109 #server.dir-listing = "enable"
111 ## send unhandled HTTP-header headers to error-log
112 #debug.dump-unknown-headers = "enable"
114 ### only root can use these options
116 # chroot() to directory (default: no chroot() )
119 ## change uid to <uid> (default: don't care)
120 #server.username = "nobody"
122 server.upload-dirs = ( "/tmp" )
124 ## change uid to <uid> (default: don't care)
125 #server.groupname = "nobody"
128 #compress.cache-dir = "/dev/null/"
129 #compress.filetype = ("text/plain", "text/html")
132 ## read proxy.txt for more info
136 # "host" => "192.168.0.101",
143 ## read fastcgi.txt for more info
147 # "socket" => "/tmp/php-fastcgi.socket",
148 # "bin-path" => "/usr/local/bin/php"
154 #cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
157 #ssl.engine = "enable"
158 #ssl.pemfile = "server.pem"
161 #status.status-url = "/server-status"
162 #status.config-url = "/server-config"
165 ## read authentification.txt for more info
166 #auth.backend = "plain"
167 #auth.backend.plain.userfile = "lighttpd.user"
168 #auth.backend.plain.groupfile = "lighttpd.group"
170 # "/server-status" => (
171 # "method" => "digest",
172 # "realm" => "download archiv",
173 # "require" => "group=www|user=jan|host=192.168.2.10"
175 # "/server-info" => (
176 # "method" => "digest",
177 # "realm" => "download archiv",
178 # "require" => "group=www|user=jan|host=192.168.2.10"
182 #### url handling modules (rewrite, redirect, access)
183 #url.rewrite = ( "^/$" => "/server-status" )
184 #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
186 #### both rewrite/redirect support back reference to regex conditional using %n
187 #$HTTP["host"] =~ "^www\.(.*)" {
188 # url.redirect = ( "^/(.*)" => "http://%1/$1" )
192 #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
195 #ssi.extension = ( ".shtml" )
198 #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
199 #setenv.add-response-header = ( "X-Secret-Message" => "42" )
202 ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
204 #var.mystring = "foo"
208 ## string concat, with integer cast as string, result: "www.foo1.com"
209 #server.name = "www." + mystring + var.bar + ".com"
211 #index-file.names = (foo + ".php") + index-file.names
212 #index-file.names += (foo + ".php")
215 #include /etc/lighttpd/lighttpd-inc.conf
216 ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
217 #include "lighttpd-inc.conf"
220 #include_shell "echo var.a=1"
221 ## the above is same as: