1 #
  2 # lighttpd.conf by SDK, 2009
  3 #
  4
  5
  6 ###
  7 ### load server modules
  8 ###
  9
 10 server.modules  = (
 11 #           "mod_access",
 12             "mod_alias",
 13             "mod_accesslog",
 14             "mod_compress",
 15             "mod_dirlisting",
 16 #           "mod_rewrite",
 17 #           "mod_fastcgi",
 18             "mod_auth",
 19             "mod_redirect",
 20             "mod_evhost",
 21             "mod_status",
 22 #           "mod_usertrack",
 23             "mod_rrdtool",
 24 #           "mod_webdav",
 25 #           "mod_expire",
 26 #           "mod_flv_streaming",
 27 #           "mod_evasive",
 28 #           "mod_ssi",
 29 #           "mod_magnet",
 30             "mod_cgi"
 31 )
 32
 33 ###
 34 ### DOCUMENT ROOT
 35 ###
 36 server.document-root = "/docroot/http/default"
 37
 38
 39 ###
 40 ### PHP FASTCGI + CONFIGURATION
 41 ###
 42 # fastcgi.server = ( ".php" =>
 43 #   (
 44 #       (
 45 #           "bin-path" => "/usr/bin/php5-cgi",
 46 #           "socket" => "/tmp/php.socket",
 47 #           "max-procs" => 6,
 48 #           "idle-timeout" => 20,
 49 #           "bin-environment" => (
 50 #               "PHP_FCGI_CHILDREN" => "8",
 51 #               "PHP_FCGI_MAX_REQUESTS" => "10000"
 52 #           ),
 53 #           "bin-copy-environment" => (
 54 #               "PATH", "SHELL", "USER"
 55 #           ),
 56 #           "broken-scriptfilename" => "enable"
 57 #       )
 58 #   )
 59 # )
 60
 61
 62 ###
 63 ### Vhost mrtg.xxzz.de
 64 ###
 65
 66 $HTTP["host"] == "mrtg.xxzz.de" {
 67     alias.url += ( "/cgi-bin/" => "/usr/lib/cgi-bin/" )
 68     cgi.assign = (".cgi" => "/usr/bin/perl")
 69     auth.debug = 0
 70     auth.backend = "htpasswd"
 71     auth.backend.htpasswd.userfile = "/etc/lighttpd/htusers"
 72     auth.require = ( "/" =>
 73              (
 74              "method"  => "basic",
 75              "realm"   => "protected",
 76              "require" => "user=nerd",
 77              )
 78     )
 79 }
 80
 81
 82 ###
 83 ### Vhost www.xxzz.de
 84 ###
 85
 86 $HTTP["host"] == "www.xxzz.de" {
 87     $HTTP["url"]=~"^/files" {
 88     server.dir-listing = "enable"
 89     }
 90 }
 91
 92
 93 ###
 94 ### Vhost img.xxzz.de
 95 ###
 96
 97 $HTTP["host"] == "img.xxzz.de" {
 98     server.dir-listing = "enable"
 99     auth.debug = 0
100     auth.backend = "htpasswd"
101     auth.backend.htpasswd.userfile = "/etc/lighttpd/htusers"
102     auth.require = ( "/" =>
103              (
104              "method"  => "basic",
105              "realm"   => "protected",
106              "require" => "user=nerd",
107              )
108     )
109 }
110
111
112 ###
113 ### Vhost tmp.xxzz.de
114 ###
115
116 $HTTP["host"] == "tmp.xxzz.de" {
117     server.dir-listing = "enable"
118     auth.debug = 0
119     auth.backend = "htpasswd"
120     auth.backend.htpasswd.userfile = "/etc/lighttpd/htusers"
121     auth.require = ( "/" =>
122          (
123          "method"  => "basic",
124          "realm"   => "protected",
125          "require" => "user=nerd",
126          )
127     )
128 }
129
130
131 ###
132 ### Vhost dot.xxzz.de
133 ###
134
135 $HTTP["host"] == "dot.xxzz.de" {
136     server.dir-listing = "enable"
137 }
138
139
140 ###
141 ### Vhost sh.xxzz.de
142 ###
143
144 $HTTP["host"] == "sh.xxzz.de" {
145     server.dir-listing = "enable"
146 }
147
148
149 ###
150 ### Vhost scr.xxzz.de
151 ###
152
153 $HTTP["host"] == "scr.xxzz.de" {
154     server.dir-listing = "enable"
155 }
156
157
158 ###
159 ### Vhost gpg.xxzz.de
160 ###
161
162 $HTTP["host"] == "gpg.xxzz.de" {
163     url.redirect = (".*" => "http://www.xxzz.de/key.txt")
164 }
165
166
167 ###
168 ### Vhost list.xxzz.de Mailman Lists
169 ###
170
171 $HTTP["host"] == "list.xxzz.de" {
172  server.dir-listing = "enable"
173  alias.url += (
174             "/mailman/" => "/usr/lib/cgi-bin/mailman/",
175             "/cgi-bin/" => "/usr/lib/cgi-bin/",
176             "/pipermail/" => "/var/lib/mailman/archives/public/",
177             "/images/mailman/" => "/usr/share/images/mailman/")
178        cgi.assign = (
179             ".pl" => "/usr/bin/perl",
180             "/admin" => "",
181             "/admindb" => "",
182             "/confirm" => "",
183             "/create" => "",
184             "/edithtml" => "",
185             "/listinfo" => "",
186             "/options" => "",
187             "/private" => "",
188             "/rmlist" => "",
189             "/roster" => "",
190             "/subscribe" => "",)
191     url.rewrite = ( "^/$" => "/pipermail",
192                     "^/Mailman/$" => "/Mailman/listinfo" )
193 }
194
195
196 ###
197 ### Logfiles
198 ###
199
200 server.errorlog = "/var/log/lighttpd/error.log"
201 accesslog.filename = "/var/log/lighttpd/access.log"
202
203
204 ###
205 ### Index files
206 ###
207
208 index-file.names = ( "index.html", "index.htm" )
209
210
211 ###
212 ### Use the "Content-Type" extended attribute to obtain mime type if possible
213 ###
214
215 mimetype.use-xattr = "enable"
216
217
218 ###
219 ### deny access the file-extensions
220 ###
221
222 url.access-deny = ( "~", ".inc" )
223
224
225 ###
226 ### which extensions should not be handle via static-file transfer
227 ###
228
229 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".cgi" )
230
231  
232 ###
233 ### Webserver Port
234 ###
235
236 server.port = 80
237
238
239 ###
240 ### error-handler for status 404
241 ###
242
243 #server.error-handler-404  = "/error-handler.html"
244 #server.error-handler-404  = "/error-handler.php"
245 #server.errorfile-prefix    = "/var/www/"
246
247 ###
248 ### Pidfile location
249 ###
250
251 server.pid-file = "/var/run/lighttpd.pid"
252
253
254 ###
255 ### global virtual directory listings
256 ###
257
258 dir-listing.encoding = "utf-8"
259 server.dir-listing = "disable"
260
261
262 ###
263 ### Set chroot
264 ###
265
266 #server.chroot = "/docroot/"
267
268
269 ###
270 ### Server User/Group
271 ###
272
273 server.username = "www-data"
274 server.groupname = "www-data"
275
276
277 ###
278 ### mod_compress
279 ###
280
281 compress.cache-dir = "/var/cache/lighttpd/compress/"
282 compress.filetype  = ("text/plain", "text/html", "application/x-javascript", "text/css")
283
284
285 ###
286 ### mod_status
287 ###
288
289 $HTTP["host"] == "mrtg.xxzz.de" {
290     status.status-url = "/lightstatus"
291     status.config-url = "/lightconfig"
292 }
293
294 ###
295 ### mod_dirlisting
296 ###
297
298 dir-listing.hide-dotfiles = "disable"
299 dir-listing.exclude = "robots.txt"
300 dir-listing.show-readme = "enable"
301 dir-listing.hide-readme-file = "enable"
302 dir-listing.hide-header-file = "enable"
303 dir-listing.show-header = "enable"
304 dir-listing.set-footer = "<br />HTH<br /><small>Your friendly Webserver</small>"
305 dir-listing.external-css = "http://www.xxzz.de/styles/dirlist.css"
306
307 ###
308 ### Configure local storage pattern
309 ###
310 # %% => % sign
311 # %0 => domain name + tld
312 # %1 => tld
313 # %2 => domain name without tld
314 # %3 => subdomain 1 name
315 # %4 => subdomain 2 name
316
317 evhost.path-pattern = "/docroot/http/%3.%2/"
318
319
320 ###
321 ### mod_expire
322 ###
323
324 # expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
325
326
327 ###
328 ### mod_rrd
329 ###
330
331 rrdtool.binary = "/usr/bin/rrdtool"
332 rrdtool.db-name = "/docroot/http/mrtg.xxzz/lighttpd.rrd"
333
334
335 ###
336 ### preformance
337 ###
338
339 server.event-handler = "linux-sysepoll" 
340 server.network-backend = "linux-sendfile" 
341 server.stat-cache-engine = "fam"
342
343
344 ###
345 ### mimetype mapping
346 ###
347
348 include_shell "/usr/share/lighttpd/create-mime.assign.pl"
349
350
351 ###
352 ### load enabled configuration files,
353 ###
354
355 include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
356