lighttpd/stderr.nl: Enable dirlisting for /static/tmp.
[matthijs/servers/drsnuggles.git] / etc / lighttpd / vhosts / stderr-nl
1 $HTTP["host"] =~ ".stderr.nl$" {
2         var.site-dir         = var.root-dir + "/stderr.nl"
3         var.site-fcgi-dir    = var.fcgi-dir + "/stderr-nl"
4
5         evhost.path-pattern  = var.site-dir + "/htdocs/%3/"
6
7         $HTTP["host"] =~ "git.stderr.nl$" {
8                 cgi.assign += ( "gitweb.cgi" => "" )
9                 # Put this alias in a url conditional, so urls like /gitweb.css won't get alias'd
10                 $HTTP["url"] =~ "^/gitweb(/.*)?$" {
11                         alias.url += ( "/gitweb" => "/usr/lib/cgi-bin/gitweb.cgi" )
12                 }
13                 $HTTP["url"] =~ ".git/" {
14                         alias.url += ( "/" => "/data/vcs/git/" )
15                 }
16                 # Redirect this url, which was published in my Master's
17                 # thesis. Use .* instead of λ, since mod_redirect doesn't like
18                 # the λ for some reason.
19                 url.redirect += ("^/gitweb\?p=matthijs/projects/c.*ash\.git" => "/gitweb?p=matthijs/master-project/cλash.git")
20                 # Redirect / to gitweb
21                 url.redirect += ("^/$" => "/gitweb")
22         }
23
24         $HTTP["host"] =~ "hg.stderr.nl$" {
25                 # Let all of hg.stderr.nl be handled by hgweb, since it also
26                 # takes care of clone / pull requests.
27                 cgi.assign += ( "hgwebdir.cgi" => "" )
28                 alias.url += ( "" => "/usr/local/lib/cgi-bin/hgwebdir.cgi" )
29         }
30
31         $HTTP["host"] =~ "blues.stderr.nl$" {
32                 auth.backend                   = "htpasswd"
33                 auth.backend.htpasswd.userfile = var.site-dir + "/conf/pandora2009.user"
34                 dir-listing.activate = "enable"
35
36                 auth.require = ( 
37                         "/" => (
38                                 "method"  => "basic",
39                                 "realm"   => "Blues Brothers",
40                                 "require" => "valid-user"
41                         )
42                 )
43                 # Only publish the pandora trac repos here
44                 url.redirect += ("^/trac/?$" => "/trac/pandora")
45                 $HTTP["url"] =~ "^/trac/.*" {
46                         fastcgi.server    += ( 
47                                 "/trac" => 
48                                 ((
49                                         "socket" => var.site-fcgi-dir + "/trac",
50                                         "check-local" => "disable",
51                                 ))
52                         )
53                 }
54         }
55
56         $HTTP["host"] =~ "^drsnuggles.stderr.nl$" {
57                 alias.url += ("/ldap" => "/usr/share/phpldapadmin/htdocs")
58         }
59
60         $HTTP["host"] =~ "^www.stderr.nl$" {
61                 url.redirect += ("^/$" => "/Blog/")
62                 # Category got renamed
63                 url.redirect += ("^/Blog/personal(.*)" => "/Blog/Personal$1")
64                 $HTTP["url"] !~ "^/(Old blog|static|stats)" {
65                         cgi.assign += ( "blosxom.cgi" => "/usr/local/bin/aclperl" )
66                         alias.url += ( "" => var.site-dir + "/applications/blosxom/blosxom.cgi" )
67                         setenv.add-environment += (
68                                 "BLOSXOM_CONFIG_FILE" => var.site-dir + "/conf/blosxom.conf",
69                                 "BLOSXOM_DATA_BASE" => var.site-dir + "/data/blosxom",
70                                 "BLOSXOM_CODE_BASE" => var.site-dir + "/applications/blosxom",
71                                 "BLOSXOM_LOGS_BASE" => var.site-dir + "/logs",
72                                 "BLOSXOM_HTDOCS_URL" =>  "/static/",
73                         )
74                 }
75                 # Disabled for now, since the only working trac is the pandora trac
76                 #fastcgi.server    += ( 
77                 #       "/trac" => 
78                 #       ((
79                 #               "socket" => var.site-fcgi-dir + "/trac",
80                 #               "check-local" => "disable",
81                 #       ))
82                 #)
83         }
84
85         # Put the php fastcgi server last, so it won't trigger on any urls that
86         # should be handled by other fastcgi servers (for example, viewing a
87         # .php file in trac results in an url /trac/.../foo.php).
88         fastcgi.server    += ( 
89                 ".php" => 
90                 ((
91                         "socket" => var.site-fcgi-dir + "/php",
92                         "broken-scriptfilename" => "enable",
93                 ))
94         )
95
96         $HTTP["url"] =~ "^/static/tmp/" {
97                 # Enable dirlistings for /tmp
98                 server.dir-listing = "enable"
99         }
100 }