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 <%= @directory %>/w/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 %>>
54 <Directory <%= @directory %>/w/images/>
55 # No php execution in the upload area
56 php_admin_flag engine off
57 Options -ExecCGI -Includes -Indexes
59 AddType text/plain .html .htm .shtml
65 <Directory <%= @directory %>/w/images/thumb/>
68 RewriteCond %{REQUEST_FILENAME} !-f
69 RewriteCond %{REQUEST_FILENAME} !-d
70 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]
72 RewriteCond %{REQUEST_FILENAME} !-f
73 RewriteCond %{REQUEST_FILENAME} !-d
74 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]
76 RewriteCond %{REQUEST_FILENAME} !-f
77 RewriteCond %{REQUEST_FILENAME} !-d
78 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
80 RewriteCond %{REQUEST_FILENAME} !-f
81 RewriteCond %{REQUEST_FILENAME} !-d
82 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]
85 <Directory <%= @directory %>/w/maintenance/>
89 <Files <%= @directory %>/w/LocalSettings.php>
93 <Directory <%= @directory %>/w/cache/>
94 Options -ExecCGI -Includes -Indexes
96 AddType text/plain .html .htm .shtml
97 php_admin_flag engine off
100 <Directory ~ "\.svn">
104 <Directory ~ "\.git">
112 <% if @ssl_enabled -%>
114 ServerName <%= @name %>
115 <% @aliases.each do |alias_name| -%>
116 ServerAlias <%= alias_name %>
119 ServerAdmin webmaster@openstreetmap.org
123 CustomLog /var/log/apache2/<%= @name %>-secure-access.log combined
124 ErrorLog /var/log/apache2/<%= @name %>-secure-error.log
126 DocumentRoot <%= @directory %>
128 php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
129 #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
130 php_value memory_limit 128M
131 php_value max_execution_time 240
132 php_value upload_max_filesize 70M
133 php_value post_max_size 100M
135 RedirectMatch 301 ^/$ /wiki/Main_Page
137 #Historical Compatibility Links
138 RedirectMatch 301 ^/index\.php$ /w/index.php
139 RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
140 RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
141 RedirectMatch 301 ^/images/(.*)$ /w/images/$1
142 RedirectMatch 301 ^/api\.php$ /w/api.php
143 RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
145 Alias /wiki <%= @directory %>/w/index.php
147 #Support /pagename -> /wiki/pagename
149 RewriteCond %{REQUEST_URI} !^/w/
150 RewriteCond %{REQUEST_URI} !^/wiki/
151 RewriteCond %{REQUEST_URI} !^/index\.php
152 RewriteCond %{REQUEST_URI} !^/skins/
153 RewriteCond %{REQUEST_URI} !^/images/
154 RewriteCond %{REQUEST_URI} !^/api\.php$
155 RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
156 RewriteCond %{REQUEST_URI} !^/server-status
157 RewriteCond %{LA-U:REQUEST_FILENAME} !-f
158 RewriteCond %{LA-U:REQUEST_FILENAME} !-d
159 RewriteRule ^/(.*) /wiki/$1 [R,L]
161 <Directory <%= @directory %>>
166 <Directory <%= @directory %>/w/images/>
167 # No php execution in the upload area
168 php_admin_flag engine off
169 Options -ExecCGI -Includes -Indexes
176 <Directory <%= @directory %>/w/images/thumb/>
179 RewriteCond %{REQUEST_FILENAME} !-f
180 RewriteCond %{REQUEST_FILENAME} !-d
181 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
183 RewriteCond %{REQUEST_FILENAME} !-f
184 RewriteCond %{REQUEST_FILENAME} !-d
185 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]
188 <Directory <%= @directory %>/w/maintenance/>
192 <Files <%= @directory %>/w/LocalSettings.php>
196 <Directory <%= @directory %>/w/images/>
197 Options -ExecCGI -Includes -Indexes
199 AddType text/plain .html .htm .shtml
200 php_admin_flag engine off
203 <Directory <%= @directory %>/w/cache/>
204 Options -ExecCGI -Includes -Indexes
206 AddType text/plain .html .htm .shtml
207 php_admin_flag engine off
210 <Directory ~ "\.svn">
214 <Directory ~ "\.git">