]>
Commit | Line | Data |
---|---|---|
40f84542 | 1 | # lighttpd configuration file |
b3b8d2ec | 2 | # use a it as base for lighttpd 1.4 and above |
40f84542 AM |
3 | # |
4 | # $Id$ | |
5 | ||
6 | ############ Options you really have to take care of #################### | |
7 | ||
8 | ## modules to load | |
9 | # at least mod_access and mod_accesslog should be loaded | |
10 | # all other module should only be loaded if really neccesary | |
11 | # - saves some time | |
12 | # - saves memory | |
7d62972e ER |
13 | |
14 | server.modules = ( | |
3b89b198 ER |
15 | # "mod_rewrite", |
16 | # "mod_redirect", | |
dce37dab | 17 | # "mod_alias", |
3b89b198 | 18 | "mod_access", |
dce37dab | 19 | # "mod_auth", |
3b89b198 ER |
20 | # "mod_status", |
21 | # "mod_simple_vhost", | |
22 | # "mod_evhost", | |
23 | # "mod_userdir", | |
24 | # "mod_secdownload", | |
25 | # "mod_fastcgi", | |
26 | # "mod_proxy", | |
dce37dab ER |
27 | # "mod_cgi", |
28 | # "mod_cml", | |
3b89b198 | 29 | # "mod_ssi", |
dce37dab | 30 | # "mod_evasive", |
a3d1f8fc | 31 | # "mod_flv_streaming", |
dce37dab | 32 | # "mod_localizer", |
dce37dab | 33 | # "mod_setenv", |
b3b8d2ec | 34 | # "mod_trigger_b4_dl", |
3b89b198 ER |
35 | # "mod_compress", |
36 | # "mod_deflate", | |
7d62972e | 37 | # "mod_usertrack", |
3b89b198 ER |
38 | # "mod_expire", |
39 | # "mod_rrdtool", | |
40 | "mod_accesslog" | |
7d62972e ER |
41 | ) |
42 | ||
43 | ## a static document-root, for virtual-hosting take look at the | |
40f84542 | 44 | ## server.virtual-* options |
7d62972e | 45 | server.document-root = "/home/services/lighttpd/html/" |
40f84542 AM |
46 | |
47 | ## where to send error-messages to | |
7d62972e | 48 | server.errorlog = "/var/log/lighttpd/lighttpd.log" |
e2b4170d | 49 | server.pid-file = "/var/run/lighttpd.pid" |
40f84542 AM |
50 | |
51 | # files to check for if .../ is requested | |
7d62972e ER |
52 | server.indexfiles = ( |
53 | "index.php", | |
54 | "index.html", | |
55 | "index.htm", | |
56 | "default.htm", | |
57 | ) | |
40f84542 | 58 | |
b3b8d2ec ER |
59 | ## set the event-handler (read the performance section in the manual) |
60 | # Linux 2.4+ rt-signals linux-rtsig | |
61 | # Linux 2.6+ epoll linux-sysepoll | |
62 | #server.event-handler = "linux-sysepoll" | |
63 | ||
40f84542 | 64 | # mimetype mapping |
39902917 ER |
65 | # include, relative to dirname of main config file |
66 | include "mime.types.conf" | |
dda0c1c2 ER |
67 | |
68 | # Use the "Content-Type" extended attribute to obtain mime type if possible | |
7d62972e | 69 | #mimetype.use-xattr = "enable" |
2f595477 | 70 | |
0a50e972 ER |
71 | ## send a different Server: header |
72 | ## be nice and keep it at lighttpd | |
73 | #server.tag = "lighttpd" | |
74 | ||
40f84542 | 75 | #### accesslog module |
7d62972e | 76 | accesslog.filename = "/var/log/lighttpd/access.log" |
40f84542 AM |
77 | |
78 | ## deny access the file-extensions | |
79 | # | |
80 | # ~ is for backupfiles from vi, emacs, joe, ... | |
81 | # .inc is often used for code includes which should in general not be part | |
82 | # of the document-root | |
7d62972e | 83 | url.access-deny = ( "~", ".inc" ) |
40f84542 | 84 | |
b3b8d2ec ER |
85 | $HTTP["url"] =~ "\.pdf$" { |
86 | server.range-requests = "disable" | |
87 | } | |
88 | ||
89 | ## | |
90 | # which extensions should not be handle via static-file transfer | |
91 | # | |
92 | # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi | |
93 | static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) | |
94 | ||
40f84542 AM |
95 | ######### Options that are good to be but not neccesary to be changed ####### |
96 | ||
97 | ## bind to port (default: 80) | |
7d62972e | 98 | #server.port = 81 |
40f84542 AM |
99 | |
100 | ## bind to localhost (default: all interfaces) | |
7d62972e | 101 | #server.bind = "grisu.home.kneschke.de" |
40f84542 | 102 | |
dda0c1c2 | 103 | ## error-handler for status 404 |
7d62972e ER |
104 | #server.error-handler-404 = "/error-handler.html" |
105 | #server.error-handler-404 = "/error-handler.php" | |
dda0c1c2 | 106 | |
40f84542 AM |
107 | ###### virtual hosts |
108 | ## | |
109 | ## If you want name-based virtual hosting add the next three settings and load | |
110 | ## mod_simple_vhost | |
111 | ## | |
112 | ## document-root = | |
b3b8d2ec ER |
113 | ## virtual-server-root + virtual-server-default-host + virtual-server-docroot |
114 | ## or | |
40f84542 AM |
115 | ## virtual-server-root + http-host + virtual-server-docroot |
116 | ## | |
117 | #simple-vhost.server-root = "/home/weigon/wwwroot/servers/" | |
118 | #simple-vhost.default-host = "grisu.home.kneschke.de" | |
119 | #simple-vhost.document-root = "/pages/" | |
120 | ||
121 | ||
7d62972e | 122 | ## |
ef2634ff | 123 | ## Format: <errorfile-prefix><status-code>.html |
40f84542 | 124 | ## -> ..../status-404.html for 'File not found' |
7d62972e | 125 | #server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" |
40f84542 AM |
126 | |
127 | ## virtual directory listings | |
128 | #server.dir-listing = "enable" | |
129 | ||
ae08eb54 ER |
130 | ## enable debugging |
131 | #debug.log-request-header = "enable" | |
132 | #debug.log-response-header = "enable" | |
133 | #debug.log-request-handling = "enable" | |
134 | #debug.log-file-not-found = "enable" | |
135 | ||
40f84542 AM |
136 | ### only root can use these options |
137 | # | |
138 | # chroot() to directory (default: no chroot() ) | |
139 | #server.chroot = "/" | |
140 | ||
141 | ## change uid to <uid> (default: don't care) | |
a2a346d6 | 142 | server.username = "lighttpd" |
40f84542 AM |
143 | |
144 | ## change uid to <uid> (default: don't care) | |
a2a346d6 | 145 | server.groupname = "lighttpd" |
40f84542 | 146 | |
a1367ea7 SP |
147 | # Traffic Shaping |
148 | # | |
149 | #connection.kbytes-per-second = 32 | |
150 | #server.kbytes-per-second = 128 | |
151 | ||
40f84542 AM |
152 | #### compress module |
153 | #compress.cache-dir = "/tmp/lighttpd/cache/compress/" | |
154 | #compress.filetype = ("text/plain", "text/html") | |
155 | ||
0a50e972 ER |
156 | #### proxy module |
157 | ## read proxy.txt for more info | |
158 | #proxy.server = ( | |
159 | # ".php" => ( | |
160 | # "localhost" => ( | |
161 | # "host" => "192.168.0.101", | |
162 | # "port" => 80, | |
163 | # ) | |
164 | # ) | |
165 | #) | |
166 | ||
40f84542 | 167 | #### fastcgi module |
dda0c1c2 | 168 | ## read fastcgi.txt for more info |
c799b856 | 169 | #fastcgi.debug = 1 |
7d62972e ER |
170 | #fastcgi.server = ( |
171 | # ".php" => ( | |
172 | # "localhost" => ( | |
173 | # "socket" => "/var/run/php/php-fastcgi.sock", | |
174 | # "bin-path" => "/usr/bin/php.fcgi", | |
175 | # ) | |
176 | # ) | |
177 | #) | |
178 | ||
e1f00dce SP |
179 | #### standalone of php-fcgi |
180 | # if you want to use standalone version of php.fcgi | |
181 | # install php-fcgi-init , start php-fcgi and then start lighttpd | |
182 | # | |
183 | #fastcgi.server = ( | |
184 | # ".php" => ( | |
185 | # ( "host" => "127.0.0.1", | |
186 | # "port" => 1026, | |
187 | # ) | |
188 | # ) | |
189 | #) | |
190 | ||
191 | ||
40f84542 AM |
192 | |
193 | #### CGI module | |
7d62972e ER |
194 | #cgi.assign = ( |
195 | # ".pl" => "/usr/bin/perl", | |
196 | # ".cgi" => "/usr/bin/perl", | |
197 | #) | |
40f84542 AM |
198 | |
199 | #### SSL engine | |
7d62972e ER |
200 | #ssl.engine = "enable" |
201 | #ssl.pemfile = "server.pem" | |
40f84542 AM |
202 | |
203 | #### status module | |
7d62972e ER |
204 | #status.status-url = "/server-status" |
205 | #status.config-url = "/server-config" | |
a5400e58 | 206 | #status.statistics-url = "/server-stats" |
40f84542 AM |
207 | |
208 | #### auth module | |
b3b8d2ec | 209 | ## read authentication.txt for more info |
37252fd1 ER |
210 | ## debugging |
211 | # 0 for off, 1 for 'auth-ok' messages, 2 for verbose debugging | |
212 | #auth.debug = 1 | |
213 | ## type of backend | |
214 | # plain, htpasswd, ldap or htdigest | |
215 | #auth.backend = "plain" | |
216 | # filename of the password storage | |
217 | ## for plain | |
218 | #auth.backend.plain.userfile = "/etc/lighttpd/lighttpd.user" | |
219 | #auth.backend.plain.groupfile = "/etc/lighttpd/lighttpd.group" | |
220 | ## for htpasswd | |
221 | #auth.backend.htpasswd.userfile = "/etc/lighttpd/lighttpd-htpasswd.user" | |
222 | ## for htdigest | |
223 | #auth.backend.htdigest.userfile = "/etc/lighttpd/lighttpd-htdigest.user" | |
224 | ## for ldap | |
225 | # the $ in auth.backend.ldap.filter is replaced by the | |
226 | # 'username' from the login dialog | |
7d62972e ER |
227 | #auth.backend.ldap.hostname = "localhost" |
228 | #auth.backend.ldap.base-dn = "dc=my-domain,dc=com" | |
229 | #auth.backend.ldap.filter = "(uid=$)" | |
230 | ||
231 | #auth.require = ( | |
232 | # "/server-status" => ( | |
233 | # "method" => "digest", | |
234 | # "realm" => "download archiv", | |
b3b8d2ec | 235 | # "require" => "user=jan" |
7d62972e ER |
236 | # ), |
237 | # "/server-info" => ( | |
238 | # "method" => "digest", | |
239 | # "realm" => "download archiv", | |
b3b8d2ec ER |
240 | # "require" => "valid-user" |
241 | # ) | |
7d62972e | 242 | #) |
40f84542 AM |
243 | |
244 | #### url handling modules (rewrite, redirect, access) | |
c799b856 ER |
245 | #url.rewrite = ( |
246 | # "^/$" => "/server-status", | |
247 | #) | |
248 | #url.redirect = ( | |
249 | # "^/wishlist/(.+)" => "http://www.123.org/$1", | |
250 | #) | |
b3b8d2ec ER |
251 | #### both rewrite/redirect support back reference to regex conditional using %n |
252 | #$HTTP["host"] =~ "^www\.(.*)" { | |
253 | # url.redirect = ( "^/(.*)" => "http://%1/$1" ) | |
254 | #} | |
dda0c1c2 ER |
255 | |
256 | # define a pattern for the host url finding | |
257 | # %% => % sign | |
258 | # %0 => domain name + tld | |
259 | # %1 => tld | |
260 | # %2 => domain name without tld | |
261 | # %3 => subdomain 1 name | |
262 | # %4 => subdomain 2 name | |
263 | # | |
7d62972e | 264 | #evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/" |
40f84542 | 265 | |
9d396dc3 | 266 | #### expire module |
7d62972e ER |
267 | #expire.url = ( |
268 | # "/buggy/" => "access 2 hours", | |
269 | # "/asdhas/" => "access plus 1 seconds 2 minutes", | |
270 | #) | |
dda0c1c2 | 271 | |
a1367ea7 SP |
272 | #### evasive module |
273 | ## | |
274 | ## Limits number of connections per IP | |
275 | ## | |
276 | #evasive.max-conns-per-ip = 5 | |
277 | ||
06239449 SP |
278 | #### deflate module |
279 | ## | |
280 | ## Allows compress all output dynamic or static | |
281 | ## | |
282 | #deflate.enabled = "enable" | |
283 | #deflate.compression-level = 9 | |
284 | #deflate.mem-level = 9 | |
285 | #deflate.window-size = 15 | |
286 | #deflate.bzip2 = "enable" | |
287 | #deflate.min-compress-size = 200 | |
288 | #deflate.sync-flush = "enable" | |
289 | #deflate.output-buffer-size = 8192 | |
290 | #deflate.work-block-size = 512 | |
291 | #deflate.mimetypes = ("text/html", "text/plain") | |
292 | #deflate.debug = "enable" | |
293 | ||
dda0c1c2 | 294 | #### ssi |
7d62972e | 295 | #ssi.extension = ( ".shtml" ) |
dda0c1c2 ER |
296 | |
297 | #### rrdtool | |
7d62972e ER |
298 | #rrdtool.binary = "/usr/bin/rrdtool" |
299 | #rrdtool.db-name = "/var/www/lighttpd.rrd" | |
9d396dc3 | 300 | |
0a50e972 ER |
301 | #### setenv |
302 | #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" ) | |
303 | #setenv.add-response-header = ( "X-Secret-Message" => "42" ) | |
304 | ||
b3b8d2ec ER |
305 | ## for mod_trigger_b4_dl |
306 | # trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db" | |
307 | # trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" ) | |
308 | # trigger-before-download.trigger-url = "^/trigger/" | |
309 | # trigger-before-download.download-url = "^/download/" | |
310 | # trigger-before-download.deny-url = "http://127.0.0.1/index.html" | |
311 | # trigger-before-download.trigger-timeout = 10 | |
312 | ||
313 | ## for mod_cml | |
314 | ## don't forget to add index.cml to server.indexfiles | |
315 | # cml.extension = ".cml" | |
316 | # cml.memcache-hosts = ( "127.0.0.1:11211" ) | |
317 | ||
318 | #### variable usage: | |
319 | ## variable name without "." is auto prefixed by "var." and becomes "var.bar" | |
320 | #bar = 1 | |
321 | #var.mystring = "foo" | |
322 | ||
323 | ## integer add | |
324 | #bar += 1 | |
325 | ## string concat, with integer cast as string, result: "www.foo1.com" | |
326 | #server.name = "www." + mystring + var.bar + ".com" | |
327 | ## array merge | |
328 | #index-file.names = (foo + ".php") + index-file.names | |
329 | #index-file.names += (foo + ".php") | |
330 | ||
331 | #### include | |
332 | #include /etc/lighttpd/lighttpd-inc.conf | |
333 | ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf" | |
334 | #include "lighttpd-inc.conf" | |
335 | ||
336 | #### include_shell | |
337 | #include_shell "echo var.a=1" | |
338 | ## the above is same as: | |
339 | #var.a=1 | |
340 | ||
5c1a52cc | 341 | #### userdir module |
7d62972e ER |
342 | #userdir.path = "public_html" |
343 | #userdir.exclude-user = ( "root", "postmaster" ) | |
5c1a52cc MW |
344 | # |
345 | ## if set, only users from this list may use the feature | |
7d62972e | 346 | #userdir.include-user = "" |
5c1a52cc MW |
347 | |
348 | #### alias module | |
7d62972e | 349 | #alias.url = ( |
7529b2c6 | 350 | # "/cgi-bin/" => "/usr/lib/cgi-bin", |
7d62972e ER |
351 | #) |
352 | ||
a3d1f8fc ER |
353 | #### flv_streaming module |
354 | #flv-streaming.extensions = ( ".flv" ) | |
355 | ||
68cdbb97 | 356 | include_shell "/bin/cat webapps.d/*.conf" |