[packages_10.03.1] revert r30005 - it was not meant to end up here
[openwrt/svn-archive/archive.git] / net / lighttpd / files / lighttpd.conf
1 # lighttpd configuration file
2 #
3 ## modules to load
4 # all other module should only be loaded if really neccesary
5 # - saves some time
6 # - saves memory
7 #server.modules = (
8 # "mod_rewrite",
9 # "mod_redirect",
10 # "mod_alias",
11 # "mod_auth",
12 # "mod_status",
13 # "mod_setenv",
14 # "mod_fastcgi",
15 # "mod_proxy",
16 # "mod_simple_vhost",
17 # "mod_cgi",
18 # "mod_ssi",
19 # "mod_usertrack",
20 # "mod_expire",
21 # "mod_webdav"
22 #)
23
24 # force use of the "write" backend (closes: #2401)
25 server.network-backend = "write"
26
27 ## a static document-root, for virtual-hosting take look at the
28 ## server.virtual-* options
29 server.document-root = "/www/"
30
31 ## where to send error-messages to
32 #server.errorlog = "/var/log/lighttpd/error.log"
33
34 ## files to check for if .../ is requested
35 index-file.names = ( "index.html", "default.html", "index.htm", "default.htm" )
36
37 ## mimetype mapping
38 mimetype.assign = (
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",
48 ".svg" => "image/svg+xml",
49 ".css" => "text/css",
50 ".html" => "text/html",
51 ".htm" => "text/html",
52 ".js" => "text/javascript",
53 ".txt" => "text/plain",
54 ".dtd" => "text/xml",
55 ".xml" => "text/xml"
56 )
57
58 ## Use the "Content-Type" extended attribute to obtain mime type if possible
59 #mimetypes.use-xattr = "enable"
60
61 ## send a different Server: header
62 ## be nice and keep it at lighttpd
63 #server.tag = "lighttpd"
64
65 $HTTP["url"] =~ "\.pdf$" {
66 server.range-requests = "disable"
67 }
68
69 ##
70 # which extensions should not be handle via static-file transfer
71 #
72 # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
73 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
74
75 ######### Options that are good to be but not neccesary to be changed #######
76
77 ## bind to port (default: 80)
78 #server.port = 81
79
80 ## bind to localhost (default: all interfaces)
81 #server.bind = "localhost"
82
83 ## error-handler for status 404
84 #server.error-handler-404 = "/error-handler.html"
85 #server.error-handler-404 = "/error-handler.php"
86
87 ## to help the rc.scripts
88 server.pid-file = "/var/run/lighttpd.pid"
89
90
91 ###### virtual hosts
92 ##
93 ## If you want name-based virtual hosting add the next three settings and load
94 ## mod_simple_vhost
95 ##
96 ## document-root =
97 ## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
98 ## virtual-server-root + http-host + virtual-server-docroot
99 ##
100 #simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
101 #simple-vhost.default-host = "grisu.home.kneschke.de"
102 #simple-vhost.document-root = "/pages/"
103
104
105 ##
106 ## Format: <errorfile-prefix><status>.html
107 ## -> ..../status-404.html for 'File not found'
108 #server.errorfile-prefix = "/www/error-"
109
110 ## virtual directory listings
111 #server.dir-listing = "enable"
112
113 ## send unhandled HTTP-header headers to error-log
114 #debug.dump-unknown-headers = "enable"
115
116 ### only root can use these options
117 #
118 # chroot() to directory (default: no chroot() )
119 #server.chroot = "/"
120
121 ## change uid to <uid> (default: don't care)
122 #server.username = "nobody"
123 #
124 server.upload-dirs = ( "/tmp" )
125
126 ## change uid to <uid> (default: don't care)
127 #server.groupname = "nobody"
128
129 #### compress module
130 #compress.cache-dir = "/dev/null/"
131 #compress.filetype = ("text/plain", "text/html")
132
133 #### proxy module
134 ## read proxy.txt for more info
135 #proxy.server = (
136 # ".php" => (
137 # "localhost" => (
138 # "host" => "192.168.0.101",
139 # "port" => 80
140 # )
141 # )
142 #)
143
144 #### fastcgi module
145 ## read fastcgi.txt for more info
146 #fastcgi.server = (
147 # ".php" => (
148 # "localhost" => (
149 # "socket" => "/tmp/php-fastcgi.socket",
150 # "bin-path" => "/usr/local/bin/php"
151 # )
152 # )
153 #)
154
155 #### CGI module
156 #cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
157
158 #### SSL engine
159 #ssl.engine = "enable"
160 #ssl.pemfile = "server.pem"
161
162 #### status module
163 #status.status-url = "/server-status"
164 #status.config-url = "/server-config"
165
166 #### auth module
167 ## read authentification.txt for more info
168 #auth.backend = "plain"
169 #auth.backend.plain.userfile = "lighttpd.user"
170 #auth.backend.plain.groupfile = "lighttpd.group"
171 #auth.require = (
172 # "/server-status" => (
173 # "method" => "digest",
174 # "realm" => "download archiv",
175 # "require" => "group=www|user=jan|host=192.168.2.10"
176 # ),
177 # "/server-info" => (
178 # "method" => "digest",
179 # "realm" => "download archiv",
180 # "require" => "group=www|user=jan|host=192.168.2.10"
181 # )
182 #)
183
184 #### url handling modules (rewrite, redirect, access)
185 #url.rewrite = ( "^/$" => "/server-status" )
186 #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
187
188 #### both rewrite/redirect support back reference to regex conditional using %n
189 #$HTTP["host"] =~ "^www\.(.*)" {
190 # url.redirect = ( "^/(.*)" => "http://%1/$1" )
191 #}
192
193 #### expire module
194 #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
195
196 #### ssi
197 #ssi.extension = ( ".shtml" )
198
199 #### setenv
200 #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
201 #setenv.add-response-header = ( "X-Secret-Message" => "42" )
202
203 #### variable usage:
204 ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
205 #bar = 1
206 #var.mystring = "foo"
207
208 ## integer add
209 #bar += 1
210 ## string concat, with integer cast as string, result: "www.foo1.com"
211 #server.name = "www." + mystring + var.bar + ".com"
212 ## array merge
213 #index-file.names = (foo + ".php") + index-file.names
214 #index-file.names += (foo + ".php")
215
216 #### include
217 #include /etc/lighttpd/lighttpd-inc.conf
218 ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
219 #include "lighttpd-inc.conf"
220
221 #### include_shell
222 #include_shell "echo var.a=1"
223 ## the above is same as:
224 #var.a=1
225
226 #### webdav
227 #$HTTP["url"] =~ "^/webdav($|/)" {
228 # webdav.activate = "enable"
229 # webdav.is-readonly = "enable"
230 # webdav.sqlite-db-name = "/var/run/lighttpd-webdav-lock.db"
231 #}