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 %>>
51 <% if node[:lsb][:release].to_f >= 14.04 -%>
56 <Directory <%= @mediawiki[:directory] %>/images/>
57 # No php execution in the upload area
58 php_admin_flag engine off
59 Options -ExecCGI -Includes -Indexes
61 AddType text/plain .html .htm .shtml
62 <% if @mediawiki[:private] -%>
63 <% if node[:lsb][:release].to_f >= 14.04 -%>
72 <Directory <%= @mediawiki[:directory] %>/images/thumb/>
75 RewriteCond %{REQUEST_FILENAME} !-f
76 RewriteCond %{REQUEST_FILENAME} !-d
77 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]
79 RewriteCond %{REQUEST_FILENAME} !-f
80 RewriteCond %{REQUEST_FILENAME} !-d
81 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]
83 RewriteCond %{REQUEST_FILENAME} !-f
84 RewriteCond %{REQUEST_FILENAME} !-d
85 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
87 RewriteCond %{REQUEST_FILENAME} !-f
88 RewriteCond %{REQUEST_FILENAME} !-d
89 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]
92 <Directory <%= @mediawiki[:directory] %>/maintenance/>
93 <% if node[:lsb][:release].to_f >= 14.04 -%>
101 <Files <%= @mediawiki[:directory] %>/LocalSettings.php>
102 <% if node[:lsb][:release].to_f >= 14.04 -%>
110 <Directory <%= @mediawiki[:directory] %>/cache/>
111 Options -ExecCGI -Includes -Indexes
113 AddType text/plain .html .htm .shtml
114 php_admin_flag engine off
117 <Directory ~ "\.svn">
118 <% if node[:lsb][:release].to_f >= 14.04 -%>
126 <Directory ~ "\.git">
127 <% if node[:lsb][:release].to_f >= 14.04 -%>
136 <% if node[:lsb][:release].to_f >= 14.04 -%>
144 <% if @mediawiki[:enable_ssl] -%>
146 ServerName <%= @name %>
147 <% @aliases.each do |alias_name| -%>
148 ServerAlias <%= alias_name %>
151 ServerAdmin webmaster@openstreetmap.org
155 CustomLog /var/log/apache2/<%= @name %>-secure-access.log combined
156 ErrorLog /var/log/apache2/<%= @name %>-secure-error.log
158 DocumentRoot <%= @directory %>
160 php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
161 #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
162 php_value memory_limit 128M
163 php_value max_execution_time 240
164 php_value upload_max_filesize 70M
165 php_value post_max_size 100M
167 RedirectMatch 301 ^/$ /wiki/Main_Page
169 #Historical Compatibility Links
170 RedirectMatch 301 ^/index\.php$ /w/index.php
171 RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
172 RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
173 RedirectMatch 301 ^/images/(.*)$ /w/images/$1
174 RedirectMatch 301 ^/api\.php$ /w/api.php
175 RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
177 Alias /wiki <%= @mediawiki[:directory] %>/index.php
179 #Support /pagename -> /wiki/pagename
181 RewriteCond %{REQUEST_URI} !^/w/
182 RewriteCond %{REQUEST_URI} !^/wiki/
183 RewriteCond %{REQUEST_URI} !^/index\.php
184 RewriteCond %{REQUEST_URI} !^/skins/
185 RewriteCond %{REQUEST_URI} !^/images/
186 RewriteCond %{REQUEST_URI} !^/api\.php$
187 RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
188 RewriteCond %{REQUEST_URI} !^/server-status
189 RewriteCond %{LA-U:REQUEST_FILENAME} !-f
190 RewriteCond %{LA-U:REQUEST_FILENAME} !-d
191 RewriteRule ^/(.*) /wiki/$1 [R,L]
193 <Directory <%= @directory %>>
195 <% if node[:lsb][:release].to_f >= 14.04 -%>
200 <Directory <%= @mediawiki[:directory] %>/images/>
201 # No php execution in the upload area
202 php_admin_flag engine off
203 Options -ExecCGI -Includes -Indexes
205 <% if @mediawiki[:private] -%>
206 <% if node[:lsb][:release].to_f >= 14.04 -%>
215 <Directory <%= @mediawiki[:directory] %>/images/thumb/>
218 RewriteCond %{REQUEST_FILENAME} !-f
219 RewriteCond %{REQUEST_FILENAME} !-d
220 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
222 RewriteCond %{REQUEST_FILENAME} !-f
223 RewriteCond %{REQUEST_FILENAME} !-d
224 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]
227 <Directory <%= @mediawiki[:directory] %>/maintenance/>
228 <% if node[:lsb][:release].to_f >= 14.04 -%>
236 <Files <%= @mediawiki[:directory] %>/LocalSettings.php>
237 <% if node[:lsb][:release].to_f >= 14.04 -%>
245 <Directory <%= @mediawiki[:directory] %>/images/>
246 Options -ExecCGI -Includes -Indexes
248 AddType text/plain .html .htm .shtml
249 php_admin_flag engine off
252 <Directory <%= @mediawiki[:directory] %>/cache/>
253 Options -ExecCGI -Includes -Indexes
255 AddType text/plain .html .htm .shtml
256 php_admin_flag engine off
259 <Directory ~ "\.svn">
260 <% if node[:lsb][:release].to_f >= 14.04 -%>
268 <Directory ~ "\.git">
269 <% if node[:lsb][:release].to_f >= 14.04 -%>
278 <% if node[:lsb][:release].to_f >= 14.04 -%>