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 <% if @ssl_enabled -%>
25 RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
28 php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
29 #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
30 php_value memory_limit 128M
31 php_value max_execution_time 240
32 php_value upload_max_filesize 70M
33 php_value post_max_size 100M
35 RewriteCond %{SERVER_NAME} !=<%= @name %>
37 RewriteRule ^/(.*)$ https://<%= @name %>/$1 [R=permanent]
39 RewriteRule ^/(.*)$ http://<%= @name %>/$1 [R=permanent]
42 RedirectMatch 301 ^/$ /wiki/Main_Page
44 #Historical Compatibility Links
45 RedirectMatch 301 ^/index\.php$ /w/index.php
46 RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
47 RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
48 RedirectMatch 301 ^/images/(.*)$ /w/images/$1
49 RedirectMatch 301 ^/api\.php$ /w/api.php
50 RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
52 Alias /wiki <%= @directory %>/w/index.php
54 #Support /pagename -> /wiki/pagename
56 RewriteCond %{REQUEST_URI} !^/w/
57 RewriteCond %{REQUEST_URI} !^/wiki/
58 RewriteCond %{REQUEST_URI} !^/index\.php
59 RewriteCond %{REQUEST_URI} !^/skins/
60 RewriteCond %{REQUEST_URI} !^/images/
61 RewriteCond %{REQUEST_URI} !^/api\.php$
62 RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
63 RewriteCond %{REQUEST_URI} !^/server-status
64 RewriteCond %{REQUEST_URI} !^/.well-known/
65 RewriteCond %{LA-U:REQUEST_FILENAME} !-f
66 RewriteCond %{LA-U:REQUEST_FILENAME} !-d
67 RewriteRule ^/(.*) /wiki/$1 [R,L]
69 <Directory <%= @directory %>>
74 <Directory <%= @directory %>/w/images/>
75 # No php execution in the upload area
76 php_admin_flag engine off
77 Options -ExecCGI -Includes -Indexes
79 AddType text/plain .html .htm .shtml
85 <Directory <%= @directory %>/w/images/thumb/>
88 RewriteCond %{REQUEST_FILENAME} !-f
89 RewriteCond %{REQUEST_FILENAME} !-d
90 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]
92 RewriteCond %{REQUEST_FILENAME} !-f
93 RewriteCond %{REQUEST_FILENAME} !-d
94 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]
96 RewriteCond %{REQUEST_FILENAME} !-f
97 RewriteCond %{REQUEST_FILENAME} !-d
98 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
100 RewriteCond %{REQUEST_FILENAME} !-f
101 RewriteCond %{REQUEST_FILENAME} !-d
102 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]
105 <Directory <%= @directory %>/w/maintenance/>
109 <Files <%= @directory %>/w/LocalSettings.php>
113 <Directory <%= @directory %>/w/cache/>
114 Options -ExecCGI -Includes -Indexes
116 AddType text/plain .html .htm .shtml
117 php_admin_flag engine off
120 <Directory ~ "\.svn">
124 <Directory ~ "\.git">