1 # DO NOT EDIT - This file is being maintained by Chef
2 <% @ports.each do |port| -%>
4 <VirtualHost *:<%= port %>>
5 ServerName <%= @name %>
6 <% @aliases.each do |alias_name| -%>
7 ServerAlias <%= alias_name %>
10 ServerAdmin webmaster@openstreetmap.org
15 CustomLog /var/log/apache2/<%= @name %>-secure-access.log combined
16 ErrorLog /var/log/apache2/<%= @name %>-secure-error.log
18 CustomLog /var/log/apache2/<%= @name %>-access.log combined
19 ErrorLog /var/log/apache2/<%= @name %>-error.log
22 DocumentRoot <%= @directory %>
24 php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
25 #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
26 php_value memory_limit 128M
27 php_value max_execution_time 240
28 php_value upload_max_filesize 70M
29 php_value post_max_size 100M
31 RewriteCond %{SERVER_NAME} !=<%= @name %>
33 RewriteRule ^/(.*)$ https://<%= @name %>/$1 [R=permanent]
35 RewriteRule ^/(.*)$ http://<%= @name %>/$1 [R=permanent]
38 RedirectMatch 301 ^/$ /wiki/Main_Page
40 #Historical Compatibility Links
41 RedirectMatch 301 ^/index\.php$ /w/index.php
42 RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
43 RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
44 RedirectMatch 301 ^/images/(.*)$ /w/images/$1
45 RedirectMatch 301 ^/api\.php$ /w/api.php
46 RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
48 Alias /wiki <%= @directory %>/w/index.php
50 #Support /pagename -> /wiki/pagename
52 RewriteCond %{REQUEST_URI} !^/w/
53 RewriteCond %{REQUEST_URI} !^/wiki/
54 RewriteCond %{REQUEST_URI} !^/index\.php
55 RewriteCond %{REQUEST_URI} !^/skins/
56 RewriteCond %{REQUEST_URI} !^/images/
57 RewriteCond %{REQUEST_URI} !^/api\.php$
58 RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
59 RewriteCond %{REQUEST_URI} !^/server-status
60 RewriteCond %{LA-U:REQUEST_FILENAME} !-f
61 RewriteCond %{LA-U:REQUEST_FILENAME} !-d
62 RewriteRule ^/(.*) /wiki/$1 [R,L]
64 <Directory <%= @directory %>>
69 <Directory <%= @directory %>/w/images/>
70 # No php execution in the upload area
71 php_admin_flag engine off
72 Options -ExecCGI -Includes -Indexes
74 AddType text/plain .html .htm .shtml
80 <Directory <%= @directory %>/w/images/thumb/>
83 RewriteCond %{REQUEST_FILENAME} !-f
84 RewriteCond %{REQUEST_FILENAME} !-d
85 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]
87 RewriteCond %{REQUEST_FILENAME} !-f
88 RewriteCond %{REQUEST_FILENAME} !-d
89 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]
91 RewriteCond %{REQUEST_FILENAME} !-f
92 RewriteCond %{REQUEST_FILENAME} !-d
93 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
95 RewriteCond %{REQUEST_FILENAME} !-f
96 RewriteCond %{REQUEST_FILENAME} !-d
97 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]
100 <Directory <%= @directory %>/w/maintenance/>
104 <Files <%= @directory %>/w/LocalSettings.php>
108 <Directory <%= @directory %>/w/cache/>
109 Options -ExecCGI -Includes -Indexes
111 AddType text/plain .html .htm .shtml
112 php_admin_flag engine off
115 <Directory ~ "\.svn">
119 <Directory ~ "\.git">