summaryrefslogtreecommitdiff
path: root/templates/macros.erb
blob: 28038c0dd9457cb7096230a3428ceeb2ef00479e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<Macro Subversion $repos>
   # begin svn config
   <Location /$repos>
      # See http://sergiy.kyrylkov.name/blog/2005/07/propfind-302-found-error-in-subversion/
      ErrorDocument 404 default

      DAV svn
      SVNPath /var/svn/$repos

      AuthType Basic
      AuthName "Subversion $repos"
      AuthUserFile /var/svn/$repos/conf/htpasswd

      # For any operations other than these, require an authenticated user.
      <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
      </LimitExcept>
   </Location>
   # end svn config
</Macro>

<Macro Drupal $version>
   # begin drupal config
   <Directory <%= scope.lookupvar('apache::www_folder') %>/drupal-$version>
      Options Indexes Includes FollowSymLinks MultiViews
      AllowOverride All
   </Directory>
   # end drupal config
</Macro>

<Macro Wiki $site>
   # begin wiki config
   <Directory <%= scope.lookupvar('apache::sites_folder') %>/$site/wiki>
      Options Indexes Includes FollowSymLinks MultiViews
      AllowOverride All
   </Directory>
   # end wiki config
</Macro>

<Macro Site $name>
   # begin site config
   <Directory <%= scope.lookupvar('apache::sites_folder') %>/$name/site>
      Options Indexes Includes FollowSymLinks MultiViews
      AllowOverride All
      Require all granted
   </Directory>
   # end site config
</Macro>

<Macro Trac $site>
   # begin trac config
   <Location "/trac">
     SetHandler mod_python
     PythonInterpreter main_interpreter
     PythonHandler trac.web.modpython_frontend
     PythonOption TracEnv <%= scope.lookupvar('apache::sites_folder') %>/$site/trac
     PythonOption TracUriRoot /trac

     # This prevents strange behavior when using trac
     # in the same virtual host with software that
     # has rewrite rules in .htaccess, such as drupal
     RewriteEngine off
   </Location>

   <Location "/trac/login">
     AuthType Basic
     AuthName "Trac $site"
     AuthUserFile <%= scope.lookupvar('apache::sites_folder') %>/$site/trac/auth/.htpasswd
     Require valid-user
   </Location>
   # end trac config
</Macro>

<Macro Moin $site>
   # begin moin config
   Alias /moinroot /usr/share/moin/htdocs/
   AliasMatch ^/moin_static[0-9]*/(.*)$ /usr/share/moin/htdocs/$1
   # TODO: fastcgi
   ScriptAlias /moin "<%= scope.lookupvar('apache::sites_folder') %>/$site/moin/cgi-bin/moin.cgi"
   # end moin config
</Macro>

<Macro Ikiwiki $name>
   # begin ikiwiki config
   <Directory <%= scope.lookupvar('apache::sites_folder') %>/$name/ikiwiki>
      Options Indexes Includes FollowSymLinks MultiViews ExecCGI
      AllowOverride All
   </Directory>
   # end ikiwiki config
</Macro>

<Macro Rails $name>
   # begin rails config
   PassengerUploadBufferDir /tmp

   <Directory <%= scope.lookupvar('apache::sites_folder') %>/$name/site>
      Options -MultiViews
      AllowOverride All
      RailsBaseURI /
      PassengerResolveSymlinksInDocumentRoot on
   </Directory>
   # end rails config
</Macro>