lighttpd: Update SSL configs
[matthijs/servers/drsnuggles.git] / etc / lighttpd / lighttpd.conf
index 676cb1f2c1a489addd5cdafd198d7688a9587253..185340dd0119d8789fa72e31b97b5fc9168ed540 100644 (file)
@@ -11,6 +11,7 @@ var.fcgi-dir             = var.root-dir + "/var/fcgi"
 
 ## modules to load
 server.modules              = (
+            "mod_auth",
             "mod_access",
             "mod_alias",
             "mod_accesslog",
@@ -19,7 +20,6 @@ server.modules              = (
             "mod_evhost",
             "mod_cgi",
             "mod_fastcgi",
-            "mod_auth",
             "mod_setenv",
 )
 
@@ -69,9 +69,39 @@ server.groupname           = "www-data"
 # Make mysqll frontend available in all domains
 alias.url                  += ("/mysql" => "/usr/share/phpmyadmin")
 
+
+# Make stats frontend available in all domains. We do a trick with
+# redirecting to awstats.pl and aliasing that, since modalias strips the
+# trailing / from urls before matching (so we can't alias /stats/
+# without also redirecting /statsfoo). We don't want to put this in
+# a conditional either, since that will be mutually exclusive with any
+# alias.urls in conditionals for specific vhosts.
+url.redirect += ("^/stats$" => "/stats/awstats.pl")
+url.redirect += ("^/stats/$" => "/stats/awstats.pl")
+cgi.assign += ( "/usr/lib/cgi-bin/awstats.pl" => "" )
+alias.url += ( "/stats/icon" => "/usr/share/awstats/icon" )
+alias.url += ( "/stats/awstats.pl" => "/usr/lib/cgi-bin/awstats.pl" )
+
+$SERVER["socket"] == ":443" {
+       ssl.engine = "enable" 
+       # The CA certificates (in particular, this contains the intermediate
+       # certificate used by startcom). It seems that even without this
+       # option, it already works, probably because openssl ships some
+       # certificates. But, let's put it here to be safe anyway.
+       ssl.ca-file = "/etc/lighttpd/ssl/ca/startssl/all.pem"
+       # Use the mail.stdin.nl certificate as the default certificate (for
+       # non-SNI browsers and domains without their own certificate), since
+       # it is currently the only one we have anyway.
+       ssl.pemfile = "/etc/lighttpd/ssl/mail.stdin.nl.pem"
+}
+
 #### external configuration files
 ## mimetype mapping
 include_shell var.conf-dir + "/scripts/create-mime.assign.pl"
 
 ## load vhosts
 include_shell var.conf-dir + "/scripts/include-vhosts.pl"
+
+# Include autogenerated logging configuration to have a separate access log
+# file for every subdomain.
+include var.conf-dir + "/logging.conf"