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