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
63 <Directory <%= @mediawiki[:directory] %>/images/thumb/>
66 RewriteCond %{REQUEST_FILENAME} !-f
67 RewriteCond %{REQUEST_FILENAME} !-d
68 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]
70 RewriteCond %{REQUEST_FILENAME} !-f
71 RewriteCond %{REQUEST_FILENAME} !-d
72 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]
74 RewriteCond %{REQUEST_FILENAME} !-f
75 RewriteCond %{REQUEST_FILENAME} !-d
76 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
78 RewriteCond %{REQUEST_FILENAME} !-f
79 RewriteCond %{REQUEST_FILENAME} !-d
80 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]
83 <Directory <%= @mediawiki[:directory] %>/maintenance/>
84 <% if node[:lsb][:release].to_f >= 14.04 -%>
92 <Files <%= @mediawiki[:directory] %>/LocalSettings.php>
93 <% if node[:lsb][:release].to_f >= 14.04 -%>
101 <Directory <%= @mediawiki[:directory] %>/images/>
102 Options -ExecCGI -Includes -Indexes
104 AddType text/plain .html .htm .shtml
105 php_admin_flag engine off
108 <Directory <%= @mediawiki[:directory] %>/cache/>
109 Options -ExecCGI -Includes -Indexes
111 AddType text/plain .html .htm .shtml
112 php_admin_flag engine off
115 <Directory ~ "\.svn">
116 <% if node[:lsb][:release].to_f >= 14.04 -%>
124 <Directory ~ "\.git">
125 <% if node[:lsb][:release].to_f >= 14.04 -%>
134 <% if node[:lsb][:release].to_f >= 14.04 -%>
142 <% if @mediawiki[:enable_ssl] -%>
144 ServerName <%= @name %>
145 <% @aliases.each do |alias_name| -%>
146 ServerAlias <%= alias_name %>
149 ServerAdmin webmaster@openstreetmap.org
153 CustomLog /var/log/apache2/<%= @name %>-secure-access.log combined
154 ErrorLog /var/log/apache2/<%= @name %>-secure-error.log
156 DocumentRoot <%= @directory %>
158 php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
159 #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
160 php_value memory_limit 128M
161 php_value max_execution_time 240
162 php_value upload_max_filesize 70M
163 php_value post_max_size 100M
165 RedirectMatch 301 ^/$ /wiki/Main_Page
167 #Historical Compatibility Links
168 RedirectMatch 301 ^/index\.php$ /w/index.php
169 RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
170 RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
171 RedirectMatch 301 ^/images/(.*)$ /w/images/$1
172 RedirectMatch 301 ^/api\.php$ /w/api.php
173 RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
175 Alias /wiki <%= @mediawiki[:directory] %>/index.php
177 #Support /pagename -> /wiki/pagename
179 RewriteCond %{REQUEST_URI} !^/w/
180 RewriteCond %{REQUEST_URI} !^/wiki/
181 RewriteCond %{REQUEST_URI} !^/index\.php
182 RewriteCond %{REQUEST_URI} !^/skins/
183 RewriteCond %{REQUEST_URI} !^/images/
184 RewriteCond %{REQUEST_URI} !^/api\.php$
185 RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
186 RewriteCond %{REQUEST_URI} !^/server-status
187 RewriteCond %{LA-U:REQUEST_FILENAME} !-f
188 RewriteCond %{LA-U:REQUEST_FILENAME} !-d
189 RewriteRule ^/(.*) /wiki/$1 [R,L]
191 <Directory <%= @directory %>>
193 <% if node[:lsb][:release].to_f >= 14.04 -%>
198 <Directory <%= @mediawiki[:directory] %>/images/>
199 # No php execution in the upload area
200 php_admin_flag engine off
201 Options -ExecCGI -Includes -Indexes
205 <Directory <%= @mediawiki[:directory] %>/images/thumb/>
208 RewriteCond %{REQUEST_FILENAME} !-f
209 RewriteCond %{REQUEST_FILENAME} !-d
210 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
212 RewriteCond %{REQUEST_FILENAME} !-f
213 RewriteCond %{REQUEST_FILENAME} !-d
214 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]
217 <Directory <%= @mediawiki[:directory] %>/maintenance/>
218 <% if node[:lsb][:release].to_f >= 14.04 -%>
226 <Files <%= @mediawiki[:directory] %>/LocalSettings.php>
227 <% if node[:lsb][:release].to_f >= 14.04 -%>
235 <Directory <%= @mediawiki[:directory] %>/images/>
236 Options -ExecCGI -Includes -Indexes
238 AddType text/plain .html .htm .shtml
239 php_admin_flag engine off
242 <Directory <%= @mediawiki[:directory] %>/cache/>
243 Options -ExecCGI -Includes -Indexes
245 AddType text/plain .html .htm .shtml
246 php_admin_flag engine off
249 <Directory ~ "\.svn">
250 <% if node[:lsb][:release].to_f >= 14.04 -%>
258 <Directory ~ "\.git">
259 <% if node[:lsb][:release].to_f >= 14.04 -%>
268 <% if node[:lsb][:release].to_f >= 14.04 -%>