1 # lighttpd configuration file
3 # use it as a base for lighttpd 1.0.0 and above
5 # $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
7 ############ Options you really have to take care of ####################
12 # at least mod_access and mod_accesslog should be loaded
13 # all other module should only be loaded if really neccesary
22 # "mod_trigger_b4_dl",
40 ## a static document-root, for virtual-hosting take look at the
41 ## server.virtual-* options
42 server.document-root = doc_dir + "/html"
44 ## where to send error-messages to
45 server.errorlog = doc_dir + "/lighttpd/error.log"
47 # files to check for if .../ is requested
48 index-file.names = ( "index.php", "index.html",
49 "index.htm", "default.htm" )
51 ## set the event-handler (read the performance section in the manual)
52 # server.event-handler = "freebsd-kqueue" # needed on OS X
56 ".pdf" => "application/pdf",
57 ".sig" => "application/pgp-signature",
58 ".spl" => "application/futuresplash",
59 ".class" => "application/octet-stream",
60 ".ps" => "application/postscript",
61 ".torrent" => "application/x-bittorrent",
62 ".dvi" => "application/x-dvi",
63 ".gz" => "application/x-gzip",
64 ".pac" => "application/x-ns-proxy-autoconfig",
65 ".swf" => "application/x-shockwave-flash",
66 ".tar.gz" => "application/x-tgz",
67 ".tgz" => "application/x-tgz",
68 ".tar" => "application/x-tar",
69 ".zip" => "application/zip",
70 ".mp3" => "audio/mpeg",
71 ".m3u" => "audio/x-mpegurl",
72 ".wma" => "audio/x-ms-wma",
73 ".wax" => "audio/x-ms-wax",
74 ".ogg" => "application/ogg",
75 ".wav" => "audio/x-wav",
76 ".gif" => "image/gif",
77 ".jar" => "application/x-java-archive",
78 ".jpg" => "image/jpeg",
79 ".jpeg" => "image/jpeg",
80 ".png" => "image/png",
81 ".xbm" => "image/x-xbitmap",
82 ".xpm" => "image/x-xpixmap",
83 ".xwd" => "image/x-xwindowdump",
85 ".html" => "text/html",
86 ".htm" => "text/html",
87 ".js" => "text/javascript",
88 ".asc" => "text/plain",
90 ".cpp" => "text/plain",
91 ".log" => "text/plain",
92 ".conf" => "text/plain",
93 ".text" => "text/plain",
94 ".txt" => "text/plain",
97 ".mpeg" => "video/mpeg",
98 ".mpg" => "video/mpeg",
99 ".mov" => "video/quicktime",
100 ".qt" => "video/quicktime",
101 ".avi" => "video/x-msvideo",
102 ".asf" => "video/x-ms-asf",
103 ".asx" => "video/x-ms-asf",
104 ".wmv" => "video/x-ms-wmv",
105 ".bz2" => "application/x-bzip",
106 ".tbz" => "application/x-bzip-compressed-tar",
107 ".tar.bz2" => "application/x-bzip-compressed-tar",
109 "" => "application/octet-stream",
112 # Use the "Content-Type" extended attribute to obtain mime type if possible
113 #mimetype.use-xattr = "enable"
116 ## send a different Server: header
117 ## be nice and keep it at lighttpd
118 # server.tag = "lighttpd"
120 #### accesslog module
121 accesslog.filename = doc_dir + "/lighttpd/access.log"
123 ## deny access the file-extensions
125 # ~ is for backupfiles from vi, emacs, joe, ...
126 # .inc is often used for code includes which should in general not be part
127 # of the document-root
128 url.access-deny = ( "~", ".inc" )
130 $HTTP["url"] =~ "\.pdf$" {
131 server.range-requests = "disable"
135 # which extensions should not be handle via static-file transfer
137 # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
138 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
140 ######### Options that are good to be but not neccesary to be changed #######
142 ## bind to port (default: 80)
145 ## bind to localhost (default: all interfaces)
146 #server.bind = "127.0.0.1"
148 ## error-handler for status 404
149 #server.error-handler-404 = "/error-handler.html"
150 #server.error-handler-404 = "/error-handler.php"
152 ## to help the rc.scripts
153 server.pid-file = doc_dir + "/lighttpd/lighttpd.pid"
158 ## If you want name-based virtual hosting add the next three settings and load
162 ## virtual-server-root + virtual-server-default-host + virtual-server-docroot
164 ## virtual-server-root + http-host + virtual-server-docroot
166 #simple-vhost.server-root = "/srv/http/vhosts/"
167 #simple-vhost.default-host = "www.example.org"
168 #simple-vhost.document-root = "/htdocs/"
172 ## Format: <errorfile-prefix><status-code>.html
173 ## -> ..../status-404.html for 'File not found'
174 #server.errorfile-prefix = "/usr/share/lighttpd/errors/status-"
175 #server.errorfile-prefix = "/srv/http/errors/status-"
177 ## virtual directory listings
178 #dir-listing.activate = "enable"
179 ## select encoding for directory listings
180 #dir-listing.encoding = "utf-8"
183 #debug.log-request-header = "enable"
184 #debug.log-response-header = "enable"
185 #debug.log-request-handling = "enable"
186 #debug.log-file-not-found = "enable"
188 ### only root can use these options
190 # chroot() to directory (default: no chroot() )
193 ## change uid to <uid> (default: don't care)
194 #server.username = "http"
196 ## change uid to <uid> (default: don't care)
197 #server.groupname = "http"
200 #compress.cache-dir = "/var/cache/lighttpd/compress/"
201 #compress.filetype = ("text/plain", "text/html")
204 ## read proxy.txt for more info
205 #proxy.server = ( ".php" =>
208 # "host" => "192.168.0.101",
215 ## read fastcgi.txt for more info
216 ## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
217 fastcgi.server = ( ".php" =>
220 "socket" => doc_dir + "/lighttpd/php-fastcgi.socket",
221 "bin-path" => "/usr/bin/php-cgi"
227 #cgi.assign = ( ".pl" => "/usr/bin/perl",
228 # ".cgi" => "/usr/bin/perl" )
232 #ssl.engine = "enable"
233 #ssl.pemfile = "/etc/ssl/private/lighttpd.pem"
236 #status.status-url = "/server-status"
237 #status.config-url = "/server-config"
240 ## read authentication.txt for more info
241 #auth.backend = "plain"
242 #auth.backend.plain.userfile = "lighttpd.user"
243 #auth.backend.plain.groupfile = "lighttpd.group"
245 #auth.backend.ldap.hostname = "localhost"
246 #auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
247 #auth.backend.ldap.filter = "(uid=$)"
249 #auth.require = ( "/server-status" =>
251 # "method" => "digest",
252 # "realm" => "download archiv",
253 # "require" => "user=jan"
255 # "/server-config" =>
257 # "method" => "digest",
258 # "realm" => "download archiv",
259 # "require" => "valid-user"
263 #### url handling modules (rewrite, redirect, access)
264 #url.rewrite = ( "^/$" => "/server-status" )
265 #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
266 #### both rewrite/redirect support back reference to regex conditional using %n
267 #$HTTP["host"] =~ "^www\.(.*)" {
268 # url.redirect = ( "^/(.*)" => "http://%1/$1" )
272 # define a pattern for the host url finding
274 # %0 => domain name + tld
276 # %2 => domain name without tld
277 # %3 => subdomain 1 name
278 # %4 => subdomain 2 name
280 #evhost.path-pattern = "/srv/http/vhosts/%3/htdocs/"
283 #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
286 #ssi.extension = ( ".shtml" )
289 #rrdtool.binary = "/usr/bin/rrdtool"
290 #rrdtool.db-name = "/var/lib/lighttpd/lighttpd.rrd"
293 #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
294 #setenv.add-response-header = ( "X-Secret-Message" => "42" )
296 ## for mod_trigger_b4_dl
297 # trigger-before-download.gdbm-filename = "/var/lib/lighttpd/trigger.db"
298 # trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
299 # trigger-before-download.trigger-url = "^/trigger/"
300 # trigger-before-download.download-url = "^/download/"
301 # trigger-before-download.deny-url = "http://127.0.0.1/index.html"
302 # trigger-before-download.trigger-timeout = 10
305 ## don't forget to add index.cml to server.indexfiles
306 # cml.extension = ".cml"
307 # cml.memcache-hosts = ( "127.0.0.1:11211" )
310 ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
312 #var.mystring = "foo"
316 ## string concat, with integer cast as string, result: "www.foo1.com"
317 #server.name = "www." + mystring + var.bar + ".com"
319 #index-file.names = (foo + ".php") + index-file.names
320 #index-file.names += (foo + ".php")
323 #include /etc/lighttpd/lighttpd-inc.conf
324 ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
325 #include "lighttpd-inc.conf"
328 #include_shell "echo var.a=1"
329 ## the above is same as: