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