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