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