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