fd12de44c5401f904dd9b2315c236b9bfdf1151e
[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                 $HTTP["querystring"] =~ "/brevidius/" {
23                     auth.backend = "htpasswd"
24                     auth.backend.htpasswd.userfile = var.site-dir + "/conf/brevidius.user"
25                     auth.require = (
26                             "/" => (
27                                     "method"  => "basic",
28                                     "realm"   => "Brevidius",
29                                     "require" => "valid-user"
30                             )
31                     )
32                 }
33         }
34
35         $HTTP["host"] =~ "hg.stderr.nl$" {
36                 # Let all of hg.stderr.nl be handled by hgweb, since it also
37                 # takes care of clone / pull requests.
38                 cgi.assign += ( "hgwebdir.cgi" => "" )
39                 alias.url += ( "" => "/usr/local/lib/cgi-bin/hgwebdir.cgi" )
40         }
41
42         $HTTP["host"] =~ "blues.stderr.nl$" {
43                 auth.backend                   = "htpasswd"
44                 auth.backend.htpasswd.userfile = var.site-dir + "/conf/pandora2009.user"
45                 dir-listing.activate = "enable"
46
47                 auth.require = ( 
48                         "/" => (
49                                 "method"  => "basic",
50                                 "realm"   => "Blues Brothers",
51                                 "require" => "valid-user"
52                         )
53                 )
54                 # Only publish the pandora trac repos here
55                 url.redirect += ("^/trac/?$" => "/trac/pandora")
56                 $HTTP["url"] =~ "^/trac/.*" {
57                         fastcgi.server    += ( 
58                                 "/trac" => 
59                                 ((
60                                         "socket" => var.site-fcgi-dir + "/trac",
61                                         "check-local" => "disable",
62                                 ))
63                         )
64                 }
65         }
66
67         $HTTP["host"] =~ "^drsnuggles.stderr.nl$" {
68                 alias.url += ("/ldap" => "/usr/share/phpldapadmin/htdocs")
69         }
70
71         $HTTP["host"] =~ "^www.stderr.nl$" {
72                 url.redirect += ("^/$" => "/Blog/")
73                 # Category got renamed
74                 url.redirect += ("^/Blog/personal(.*)" => "/Blog/Personal$1")
75                 $HTTP["url"] !~ "^/(Old blog|static|stats)" {
76                         cgi.assign += ( "blosxom.cgi" => "/usr/local/bin/aclperl" )
77                         alias.url += ( "" => var.site-dir + "/applications/blosxom/blosxom.cgi" )
78                         setenv.add-environment += (
79                                 "BLOSXOM_CONFIG_FILE" => var.site-dir + "/conf/blosxom.conf",
80                                 "BLOSXOM_DATA_BASE" => var.site-dir + "/data/blosxom",
81                                 "BLOSXOM_CODE_BASE" => var.site-dir + "/applications/blosxom",
82                                 "BLOSXOM_LOGS_BASE" => var.site-dir + "/logs",
83                                 "BLOSXOM_HTDOCS_URL" =>  "/static/",
84                         )
85                 }
86                 # Disabled for now, since the only working trac is the pandora trac
87                 #fastcgi.server    += ( 
88                 #       "/trac" => 
89                 #       ((
90                 #               "socket" => var.site-fcgi-dir + "/trac",
91                 #               "check-local" => "disable",
92                 #       ))
93                 #)
94         }
95
96         # Put the php fastcgi server last, so it won't trigger on any urls that
97         # should be handled by other fastcgi servers (for example, viewing a
98         # .php file in trac results in an url /trac/.../foo.php).
99         fastcgi.server    += ( 
100                 ".php" => 
101                 ((
102                         "socket" => var.site-fcgi-dir + "/php",
103                         "broken-scriptfilename" => "enable",
104                 ))
105         )
106
107         $HTTP["url"] =~ "^/static/tmp/" {
108                 # Enable dirlistings for /tmp
109                 server.dir-listing = "enable"
110         }
111 }