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 <% if @ssl_enabled -%>
15 RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
16 RedirectPermanent / https://<%= @name %>/
20 ServerName <%= @name %>
21 <% @aliases.each do |alias_name| -%>
22 ServerAlias <%= alias_name %>
25 ServerAdmin webmaster@openstreetmap.org
28 SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
29 SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
31 CustomLog /var/log/apache2/<%= @name %>-secure-access.log combined
32 ErrorLog /var/log/apache2/<%= @name %>-secure-error.log
35 DocumentRoot <%= @directory %>
37 php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
38 #php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
39 php_value memory_limit 128M
40 php_value max_execution_time 240
41 php_value upload_max_filesize 70M
42 php_value post_max_size 100M
44 RewriteCond %{SERVER_NAME} !=<%= @name %>
45 RewriteRule ^/(.*)$ https://<%= @name %>/$1 [R=permanent]
47 RedirectMatch 301 ^/$ /wiki/Main_Page
49 #Historical Compatibility Links
50 RedirectMatch 301 ^/index\.php$ /w/index.php
51 RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
52 RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
53 RedirectMatch 301 ^/images/(.*)$ /w/images/$1
54 RedirectMatch 301 ^/api\.php$ /w/api.php
55 RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php
57 Alias /wiki <%= @directory %>/w/index.php
59 #Support /pagename -> /wiki/pagename
61 RewriteCond %{REQUEST_URI} !^/w/
62 RewriteCond %{REQUEST_URI} !^/wiki/
63 RewriteCond %{REQUEST_URI} !^/index\.php
64 RewriteCond %{REQUEST_URI} !^/skins/
65 RewriteCond %{REQUEST_URI} !^/images/
66 RewriteCond %{REQUEST_URI} !^/api\.php$
67 RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
68 RewriteCond %{REQUEST_URI} !^/server-status
69 RewriteCond %{REQUEST_URI} !^/.well-known/
70 RewriteCond %{LA-U:REQUEST_FILENAME} !-f
71 RewriteCond %{LA-U:REQUEST_FILENAME} !-d
72 RewriteRule ^/(.*) /wiki/$1 [R,L]
74 <Directory <%= @directory %>>
79 <Directory <%= @directory %>/w/images/>
80 # No php execution in the upload area
81 php_admin_flag engine off
82 Options -ExecCGI -Includes -Indexes
84 AddType text/plain .html .htm .shtml
90 <Directory <%= @directory %>/w/images/thumb/>
93 RewriteCond %{REQUEST_FILENAME} !-f
94 RewriteCond %{REQUEST_FILENAME} !-d
95 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]
97 RewriteCond %{REQUEST_FILENAME} !-f
98 RewriteCond %{REQUEST_FILENAME} !-d
99 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]
101 RewriteCond %{REQUEST_FILENAME} !-f
102 RewriteCond %{REQUEST_FILENAME} !-d
103 RewriteRule ^[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [L,QSA,B]
105 RewriteCond %{REQUEST_FILENAME} !-f
106 RewriteCond %{REQUEST_FILENAME} !-d
107 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]
110 <Directory <%= @directory %>/w/maintenance/>
114 <Files <%= @directory %>/w/LocalSettings.php>
118 <Directory <%= @directory %>/w/cache/>
119 Options -ExecCGI -Includes -Indexes
121 AddType text/plain .html .htm .shtml
122 php_admin_flag engine off
125 <Directory ~ "\.svn">
129 <Directory ~ "\.git">