1 # lighttpd configuration file
4 # all other module should only be loaded if really neccesary
24 # force use of the "write" backend (closes: #2401)
25 server.network-backend = "write"
27 ## a static document-root, for virtual-hosting take look at the
28 ## server.virtual-* options
29 server.document-root = "/www/"
31 ## where to send error-messages to
32 #server.errorlog = "/var/log/lighttpd/error.log"
34 ## files to check for if .../ is requested
35 index-file.names = ( "index.html", "default.html", "index.htm", "default.htm" )
39 ".pdf" => "application/pdf",
40 ".class" => "application/octet-stream",
41 ".pac" => "application/x-ns-proxy-autoconfig",
42 ".swf" => "application/x-shockwave-flash",
43 ".wav" => "audio/x-wav",
44 ".gif" => "image/gif",
45 ".jpg" => "image/jpeg",
46 ".jpeg" => "image/jpeg",
47 ".png" => "image/png",
49 ".html" => "text/html",
50 ".htm" => "text/html",
51 ".js" => "text/javascript",
52 ".txt" => "text/plain",
57 ## Use the "Content-Type" extended attribute to obtain mime type if possible
58 #mimetypes.use-xattr = "enable"
60 ## send a different Server: header
61 ## be nice and keep it at lighttpd
62 #server.tag = "lighttpd"
64 $HTTP["url"] =~ "\.pdf$" {
65 server.range-requests = "disable"
69 # which extensions should not be handle via static-file transfer
71 # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
72 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
74 ######### Options that are good to be but not neccesary to be changed #######
76 ## bind to port (default: 80)
79 ## bind to localhost (default: all interfaces)
80 #server.bind = "localhost"
82 ## error-handler for status 404
83 #server.error-handler-404 = "/error-handler.html"
84 #server.error-handler-404 = "/error-handler.php"
86 ## to help the rc.scripts
87 server.pid-file = "/var/run/lighttpd.pid"
92 ## If you want name-based virtual hosting add the next three settings and load
96 ## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
97 ## virtual-server-root + http-host + virtual-server-docroot
99 #simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
100 #simple-vhost.default-host = "grisu.home.kneschke.de"
101 #simple-vhost.document-root = "/pages/"
105 ## Format: <errorfile-prefix><status>.html
106 ## -> ..../status-404.html for 'File not found'
107 #server.errorfile-prefix = "/www/error-"
109 ## virtual directory listings
110 #server.dir-listing = "enable"
112 ## send unhandled HTTP-header headers to error-log
113 #debug.dump-unknown-headers = "enable"
115 ### only root can use these options
117 # chroot() to directory (default: no chroot() )
120 ## change uid to <uid> (default: don't care)
121 #server.username = "nobody"
123 server.upload-dirs = ( "/tmp" )
125 ## change uid to <uid> (default: don't care)
126 #server.groupname = "nobody"
129 #compress.cache-dir = "/dev/null/"
130 #compress.filetype = ("text/plain", "text/html")
133 ## read proxy.txt for more info
137 # "host" => "192.168.0.101",
144 ## read fastcgi.txt for more info
148 # "socket" => "/tmp/php-fastcgi.socket",
149 # "bin-path" => "/usr/local/bin/php"
155 #cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
158 #ssl.engine = "enable"
159 #ssl.pemfile = "server.pem"
162 #status.status-url = "/server-status"
163 #status.config-url = "/server-config"
166 ## read authentification.txt for more info
167 #auth.backend = "plain"
168 #auth.backend.plain.userfile = "lighttpd.user"
169 #auth.backend.plain.groupfile = "lighttpd.group"
171 # "/server-status" => (
172 # "method" => "digest",
173 # "realm" => "download archiv",
174 # "require" => "group=www|user=jan|host=192.168.2.10"
176 # "/server-info" => (
177 # "method" => "digest",
178 # "realm" => "download archiv",
179 # "require" => "group=www|user=jan|host=192.168.2.10"
183 #### url handling modules (rewrite, redirect, access)
184 #url.rewrite = ( "^/$" => "/server-status" )
185 #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
187 #### both rewrite/redirect support back reference to regex conditional using %n
188 #$HTTP["host"] =~ "^www\.(.*)" {
189 # url.redirect = ( "^/(.*)" => "http://%1/$1" )
193 #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
196 #ssi.extension = ( ".shtml" )
199 #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
200 #setenv.add-response-header = ( "X-Secret-Message" => "42" )
203 ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
205 #var.mystring = "foo"
209 ## string concat, with integer cast as string, result: "www.foo1.com"
210 #server.name = "www." + mystring + var.bar + ".com"
212 #index-file.names = (foo + ".php") + index-file.names
213 #index-file.names += (foo + ".php")
216 #include /etc/lighttpd/lighttpd-inc.conf
217 ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
218 #include "lighttpd-inc.conf"
221 #include_shell "echo var.a=1"
222 ## the above is same as:
226 #$HTTP["url"] =~ "^/webdav($|/)" {
227 # webdav.activate = "enable"
228 # webdav.is-readonly = "enable"
229 # webdav.sqlite-db-name = "/var/run/lighttpd-webdav-lock.db"