5f20c6970a2f1c2fe78946a69b1864386ddec614
[matthijs/servers/drsnuggles.git] / etc / lighttpd / lighttpd.conf
1 # Debian lighttpd configuration file
2 #
3
4 # Chroot into our root-dir
5 #server.chroot            = "/data/www"
6
7 #var.root-dir             = ""
8 var.root-dir             = "/data/www"
9 var.conf-dir             = "/etc/lighttpd"
10 var.fcgi-dir             = var.root-dir + "/var/fcgi"
11
12 ## modules to load
13 server.modules              = (
14             "mod_auth",
15             "mod_access",
16             "mod_alias",
17             "mod_accesslog",
18             "mod_rewrite",
19             "mod_redirect",
20             "mod_evhost",
21             "mod_cgi",
22             "mod_fastcgi",
23             "mod_setenv",
24 )
25
26 # Set a default catch-all document root, which should never be used.
27 server.document-root       = var.root-dir + "/default/htdocs"
28
29 ## where to upload files to, purged daily.
30 server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
31
32 ## where to send error-messages to
33 server.errorlog            = var.root-dir + "/default/logs/error.log"
34
35 ## files to check for if .../ is requested
36 index-file.names           = ( "index.php", "index.html" )
37
38 #### accesslog module
39 accesslog.filename         = var.root-dir + "/default/logs/access.log"
40
41 ## deny access the file-extensions
42 #
43 # ~    is for backupfiles from vi, emacs, joe, ...
44 # .inc is often used for code includes which should in general not be part
45 #      of the document-root
46 url.access-deny            = ( "~", ".inc" )
47
48 ##
49 # which extensions should not be handle via static-file transfer
50 #
51 # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
52 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
53
54 ## Use ipv6 only if available.
55 server.use-ipv6 = "disable"
56
57 ## to help the rc.scripts
58 server.pid-file            = "/var/run/lighttpd.pid"
59
60 ## virtual directory listings
61 dir-listing.encoding        = "utf-8"
62 # Disable dir-listing by default
63 server.dir-listing          = "disable"
64
65 # Don't run as root
66 server.username            = "www-data"
67 server.groupname           = "www-data"
68
69 # Make mysqll frontend available in all domains
70 alias.url                  += ("/mysql" => "/usr/share/phpmyadmin")
71
72
73 # Make stats frontend available in all domains. We do a trick with
74 # redirecting to awstats.pl and aliasing that, since modalias strips the
75 # trailing / from urls before matching (so we can't alias /stats/
76 # without also redirecting /statsfoo). We don't want to put this in
77 # a conditional either, since that will be mutually exclusive with any
78 # alias.urls in conditionals for specific vhosts.
79 url.redirect += ("^/stats$" => "/stats/awstats.pl")
80 url.redirect += ("^/stats/$" => "/stats/awstats.pl")
81 cgi.assign += ( "/usr/lib/cgi-bin/awstats.pl" => "" )
82 alias.url += ( "/stats/icon" => "/usr/share/awstats/icon" )
83 alias.url += ( "/stats/awstats.pl" => "/usr/lib/cgi-bin/awstats.pl" )
84
85 $SERVER["socket"] == ":443" {
86         ssl.engine = "enable" 
87         # The CA certificates (in particular, this contains the intermediate
88         # certificate used by startcom). It seems that even without this
89         # option, it already works, probably because openssl ships some
90         # certificates. But, let's put it here to be safe anyway.
91         ssl.ca-file = "/etc/lighttpd/ssl/ca/startssl-all-ca.pem"
92         # Use the mail.stdin.nl certificate as the default certificate (for
93         # non-SNI browsers and domains without their own certificate), since
94         # it is currently the only one we have anyway.
95         ssl.pemfile = "/etc/lighttpd/ssl/mail.stdin.nl.pem"
96 }
97
98 #### external configuration files
99 ## mimetype mapping
100 include_shell var.conf-dir + "/scripts/create-mime.assign.pl"
101
102 ## load vhosts
103 include_shell var.conf-dir + "/scripts/include-vhosts.pl"
104
105 # Include autogenerated logging configuration to have a separate access log
106 # file for every subdomain.
107 include var.conf-dir + "/logging.conf"