--- /dev/null
+# Debian lighttpd configuration file
+#
+
+# Chroot into our root-dir
+#server.chroot = "/data/www"
+
+#var.root-dir = ""
+var.root-dir = "/data/www"
+var.conf-dir = "/etc/lighttpd"
+var.fcgi-dir = var.root-dir + "/var/fcgi"
+
+## modules to load
+server.modules = (
+ "mod_access",
+ "mod_alias",
+ "mod_accesslog",
+ "mod_rewrite",
+ "mod_redirect",
+ "mod_evhost",
+ "mod_cgi",
+ "mod_fastcgi",
+ "mod_auth",
+)
+
+# Set a default catch-all document root, which should never be used.
+server.document-root = var.root-dir + "/default/htdocs"
+
+## where to upload files to, purged daily.
+server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
+
+## where to send error-messages to
+server.errorlog = var.root-dir + "/default/logs/error.log"
+
+## files to check for if .../ is requested
+index-file.names = ( "index.php", "index.html" )
+
+#### accesslog module
+accesslog.filename = var.root-dir + "/default/logs/access.log"
+
+## deny access the file-extensions
+#
+# ~ is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+# of the document-root
+url.access-deny = ( "~", ".inc" )
+
+##
+# which extensions should not be handle via static-file transfer
+#
+# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+## Use ipv6 only if available.
+server.use-ipv6 = "disable"
+
+## to help the rc.scripts
+server.pid-file = "/var/run/lighttpd.pid"
+
+## virtual directory listings
+dir-listing.encoding = "utf-8"
+# Disable dir-listing by default
+server.dir-listing = "disable"
+
+# Don't run as root
+server.username = "www-data"
+server.groupname = "www-data"
+
+#### 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"
--- /dev/null
+#!/usr/bin/perl -w
+
+# This script is based on /usr/share/lighttpd/create-mime-assign.pl. This
+# script is changed to include a charset for text types.
+
+use strict;
+open MIMETYPES, "/etc/mime.types" or exit;
+print "mimetype.assign = (\n";
+my %extensions;
+while(<MIMETYPES>) {
+ chomp;
+ s/\#.*//;
+ next if /^\w*$/;
+ if(/^([a-z0-9\/+-.]+)\s+((?:[a-z0-9.+-]+[ ]?)+)$/) {
+ my $mime = $1; my $exts = $2;
+ # Append encoding for text formats
+ if ($mime =~ /^text\//) {
+ $mime .= "; charset=iso-8859-1";
+ }
+ foreach(split / /, $exts) {
+ # mime.types can have same extension for different
+ # mime types
+ next if $extensions{$_};
+ $extensions{$_} = 1;
+
+ print "\".$_\" => \"$mime\",\n";
+ }
+ }
+}
+print ")\n";
--- /dev/null
+#!/usr/bin/perl -wl
+
+# This script is based on /usr/share/lighttpd/include-conf-enabled.pl but
+# changed to read the vhosts directory instead of the conf-enabled directory.
+
+use strict;
+use File::Glob ':glob';
+
+my $confdir = "/etc/lighttpd/";
+my $enabled = "vhosts/*";
+
+chdir($confdir);
+my @files = bsd_glob($enabled);
+
+for my $file (@files)
+{
+ print "include \"$file\"";
+}
--- /dev/null
+$HTTP["host"] =~ "^(evolution-events.nl)$" {
+ url.redirect = (".*" => "http://www.%1/")
+}
+
+$HTTP["host"] =~ ".evolution-events.nl$" {
+ var.site-dir = var.root-dir + "/evolution-events.nl"
+ var.site-fcgi-dir = var.fcgi-dir + "/evolution-events-nl"
+
+ evhost.path-pattern = var.site-dir + "/htdocs/%3/"
+ accesslog.filename = var.site-dir + "/logs/access.log"
+
+ fastcgi.server = (
+ ".php" =>
+ ((
+ "socket" => var.site-fcgi-dir + "/php",
+ "broken-scriptfilename" => "enable",
+ )),
+ "/wipi" =>
+ ((
+ "socket" => var.site-fcgi-dir + "/wipi",
+ "check-local" => "disable",
+ "broken-scriptfilename" => "enable",
+ )),
+ )
+ alias.url = (
+ # Don't name this /wipistatic, since that will be caught by fastcgi above
+ "/staticwipi" => var.site-dir + "/applications/wipi/static/",
+ )
+
+ url.rewrite-once = (
+ "^/wipi/static/(.*)$" => "/staticwipi/$1",
+ "^(/.*)$" => "$1",
+ )
+
+ $HTTP["host"] =~ "^orga.evolution-events.nl$" {
+ auth.backend = "plain"
+ auth.backend.plain.userfile = var.site-dir + "/conf/simple.user"
+
+ auth.require = ( "/private" =>
+ (
+ "method" => "digest",
+ "realm" => "Evolution Events",
+ "require" => "user=admin"
+ )
+ )
+
+
+ url.rewrite-once = (
+ "^/forum/(.+)$" => "/forum/",
+ )
+ }
+
+ $HTTP["host"] =~ "^xerxes.evolution-events.nl$" {
+ fastcgi.server = (
+ "/blaa" =>
+ ((
+ "socket" => var.site-fcgi-dir + "/xerxes",
+ "check-local" => "disable",
+ )),
+ )
+
+ alias.url = (
+ "/media/" => "/home/matthijs/django/contrib/admin/media/",
+ "/static/" => var.site-dir + "/applications/xerxes/static/",
+ )
+
+ url.rewrite-once = (
+ "^(/media.*)$" => "$1",
+ "^(/static.*)$" => "$1",
+ "^/favicon\.ico$" => "/media/favicon.ico",
+ "^(/.*)$" => "/blaa$1",
+ )
+ }
+}
--- /dev/null
+$HTTP["host"] =~ ".foresightsecurity.nl$" {
+ var.site-dir = var.root-dir + "/foresightsecurity.nl"
+ var.site-fcgi-dir = var.fcgi-dir + "/evolution-events-nl"
+
+ evhost.path-pattern = var.site-dir + "/htdocs/%3/"
+ accesslog.filename = var.site-dir + "/logs/access.log"
+
+ fastcgi.server = (
+ ".php" =>
+ ((
+ "socket" => var.site-fcgi-dir + "/php",
+ "broken-scriptfilename" => "enable",
+ ))
+ )
+
+ cgi.assign = ( "cgi" => "" )
+}
--- /dev/null
+$HTTP["host"] =~ ".stderr.nl$" {
+ var.site-dir = var.root-dir + "/stderr.nl"
+ var.site-fcgi-dir = var.fcgi-dir + "/stderr-nl"
+
+ evhost.path-pattern = var.site-dir + "/htdocs/%3/"
+ accesslog.filename = var.site-dir + "/logs/access.log"
+
+ fastcgi.server = (
+ ".php" =>
+ ((
+ "socket" => var.site-fcgi-dir + "/php",
+ "broken-scriptfilename" => "enable",
+ ))
+ )
+
+ cgi.assign = ( "cgi" => "" )
+
+ $HTTP["host"] =~ "git.stderr.nl$" {
+ # Put this alias in a url conditional, so urls like /gitweb.css won't get alias'd
+ $HTTP["url"] =~ "^/gitweb(/.*)?$" {
+ alias.url += ( "/gitweb" => "/usr/lib/cgi-bin/gitweb.cgi" )
+ }
+ }
+
+ $HTTP["host"] =~ "indigetes.stderr.nl$" {
+ auth.backend = "htpasswd"
+ auth.backend.htpasswd.userfile = var.site-dir + "/pandora2008.user"
+
+ auth.require = (
+ "/" => (
+ "method" => "basic",
+ "realm" => "Di Indigetes",
+ "require" => "valid-user"
+ )
+ )
+ }
+}
--- /dev/null
+$HTTP["host"] =~ ".stdin.nl$" {
+ var.site-dir = var.root-dir + "/stdin.nl"
+ var.site-fcgi-dir = var.fcgi-dir + "/stdin-nl"
+
+ evhost.path-pattern = var.site-dir + "/htdocs/%3/"
+ accesslog.filename = var.site-dir + "/logs/access.log"
+
+ fastcgi.server = ( ".php" =>
+ ((
+ "socket" => var.site-fcgi-dir + "/php",
+ "broken-scriptfilename" => "enable",
+ ))
+ )
+}
--- /dev/null
+$HTTP["host"] =~ "stdio.flexvps.nl$" {
+ var.site-dir = var.root-dir + "/stdio.flexvps.nl"
+ var.site-fcgi-dir = var.fcgi-dir + "/stdio-flexvps-nl"
+
+ server.document-root = var.site-dir + "/htdocs"
+ accesslog.filename = var.site-dir + "/logs/access.log"
+
+ fastcgi.server = (
+ ".php" =>
+ ((
+ "socket" => var.site-fcgi-dir + "/php",
+ "broken-scriptfilename" => "enable",
+ ))
+ )
+}
--- /dev/null
+$HTTP["host"] =~ ".stdout.nl$" {
+ var.site-dir = var.root-dir + "/stdout.nl"
+ var.site-fcgi-dir = var.fcgi-dir + "/stdout-nl"
+
+ evhost.path-pattern = var.site-dir + "/htdocs/%3/"
+ accesslog.filename = var.site-dir + "/logs/access.log"
+
+ fastcgi.server = ( ".php" =>
+ ((
+ "socket" => var.site-fcgi-dir + "/php",
+ ))
+ )
+}