1 # DO NOT EDIT - This file is being maintained by Chef
4 ServerName <%= @name %>
5 <% @aliases.each do |alias_name| -%>
6 ServerAlias <%= alias_name %>
9 ServerAdmin webmaster@openstreetmap.org
11 CustomLog /var/log/apache2/<%= @name %>-access.log combined
12 ErrorLog /var/log/apache2/<%= @name %>-error.log
14 DocumentRoot <%= @directory %>
16 php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
17 #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
18 php_value memory_limit 128M
19 php_value max_execution_time 240
20 php_value upload_max_filesize 70M
21 php_value post_max_size 100M
23 RedirectMatch 301 ^/$ /wiki/Main_Page
25 #Historical Compatibility Links
26 RedirectMatch 301 ^/index\.php$ /w/index.php
27 RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
28 RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
29 RedirectMatch 301 ^/images/(.*)$ /w/images/$1
30 RedirectMatch 301 ^/api\.php$ /w/api.php
31 RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
33 Alias /wiki <%= @mediawiki[:directory] %>/index.php
35 #Support /pagename -> /wiki/pagename
37 RewriteCond %{REQUEST_URI} !^/w/
38 RewriteCond %{REQUEST_URI} !^/wiki/
39 RewriteCond %{REQUEST_URI} !^/index\.php
40 RewriteCond %{REQUEST_URI} !^/skins/
41 RewriteCond %{REQUEST_URI} !^/images/
42 RewriteCond %{REQUEST_URI} !^/api\.php$
43 RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
44 RewriteCond %{REQUEST_URI} !^/server-status
45 RewriteCond %{LA-U:REQUEST_FILENAME} !-f
46 RewriteCond %{LA-U:REQUEST_FILENAME} !-d
47 RewriteRule ^/(.*) /wiki/$1 [R,L]
49 <Directory <%= @directory %>>
53 <Directory <%= @mediawiki[:directory] %>/images/>
54 # No php execution in the upload area
55 php_admin_flag engine off
56 Options -ExecCGI -Includes -Indexes
60 <Directory <%= @mediawiki[:directory] %>/images/thumb/>
63 RewriteCond %{REQUEST_FILENAME} !-f
64 RewriteCond %{REQUEST_FILENAME} !-d
65 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/page([0-9]+)-([0-9]+)px-.*$ /w/thumb.php?f=$1&page=$2&width=$3 [L,QSA,B]
67 RewriteCond %{REQUEST_FILENAME} !-f
68 RewriteCond %{REQUEST_FILENAME} !-d
69 RewriteRule ^archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/page([0-9]+)-([0-9]+)px-.*$ /w/thumb.php?f=$1&page=$2&width=$3&archived=1 [L,QSA,B]
71 RewriteCond %{REQUEST_FILENAME} !-f
72 RewriteCond %{REQUEST_FILENAME} !-d
73 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
75 RewriteCond %{REQUEST_FILENAME} !-f
76 RewriteCond %{REQUEST_FILENAME} !-d
77 RewriteRule ^archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
80 <Directory <%= @mediawiki[:directory] %>/maintenance/>
85 <Files <%= @mediawiki[:directory] %>/LocalSettings.php>
90 <Directory <%= @mediawiki[:directory] %>/images/>
91 Options -ExecCGI -Includes -Indexes
93 AddType text/plain .html .htm .shtml
94 php_admin_flag engine off
97 <Directory <%= @mediawiki[:directory] %>/cache/>
98 Options -ExecCGI -Includes -Indexes
100 AddType text/plain .html .htm .shtml
101 php_admin_flag engine off
104 <Directory ~ "\.svn">
109 <Directory ~ "\.git">
119 <% if @mediawiki[:enable_ssl] -%>
121 ServerName <%= @name %>
122 <% @aliases.each do |alias_name| -%>
123 ServerAlias <%= alias_name %>
126 ServerAdmin webmaster@openstreetmap.org
130 CustomLog /var/log/apache2/<%= @name %>-secure-access.log combined
131 ErrorLog /var/log/apache2/<%= @name %>-secure-error.log
133 DocumentRoot <%= @directory %>
135 php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
136 #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
137 php_value memory_limit 128M
138 php_value max_execution_time 240
139 php_value upload_max_filesize 70M
140 php_value post_max_size 100M
142 RedirectMatch 301 ^/$ /wiki/Main_Page
144 #Historical Compatibility Links
145 RedirectMatch 301 ^/index\.php$ /w/index.php
146 RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
147 RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
148 RedirectMatch 301 ^/images/(.*)$ /w/images/$1
149 RedirectMatch 301 ^/api\.php$ /w/api.php
150 RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
152 Alias /wiki <%= @mediawiki[:directory] %>/index.php
154 #Support /pagename -> /wiki/pagename
156 RewriteCond %{REQUEST_URI} !^/w/
157 RewriteCond %{REQUEST_URI} !^/wiki/
158 RewriteCond %{REQUEST_URI} !^/index\.php
159 RewriteCond %{REQUEST_URI} !^/skins/
160 RewriteCond %{REQUEST_URI} !^/images/
161 RewriteCond %{REQUEST_URI} !^/api\.php$
162 RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
163 RewriteCond %{REQUEST_URI} !^/server-status
164 RewriteCond %{LA-U:REQUEST_FILENAME} !-f
165 RewriteCond %{LA-U:REQUEST_FILENAME} !-d
166 RewriteRule ^/(.*) /wiki/$1 [R,L]
168 <Directory <%= @directory %>>
172 <Directory <%= @mediawiki[:directory] %>/images/>
173 # No php execution in the upload area
174 php_admin_flag engine off
175 Options -ExecCGI -Includes -Indexes
179 <Directory <%= @mediawiki[:directory] %>/images/thumb/>
182 RewriteCond %{REQUEST_FILENAME} !-f
183 RewriteCond %{REQUEST_FILENAME} !-d
184 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
186 RewriteCond %{REQUEST_FILENAME} !-f
187 RewriteCond %{REQUEST_FILENAME} !-d
188 RewriteRule ^archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
191 <Directory <%= @mediawiki[:directory] %>/maintenance/>
196 <Files <%= @mediawiki[:directory] %>/LocalSettings.php>
201 <Directory <%= @mediawiki[:directory] %>/images/>
202 Options -ExecCGI -Includes -Indexes
204 AddType text/plain .html .htm .shtml
205 php_admin_flag engine off
208 <Directory <%= @mediawiki[:directory] %>/cache/>
209 Options -ExecCGI -Includes -Indexes
211 AddType text/plain .html .htm .shtml
212 php_admin_flag engine off
215 <Directory ~ "\.svn">
220 <Directory ~ "\.git">