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 RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
15 RedirectPermanent / https://<%= @name %>/
17 <% unless @aliases.empty? -%>
20 ServerName <%= @aliases.first %>
21 <% @aliases.drop(1).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 %>-access.log combined
32 ErrorLog /var/log/apache2/<%= @name %>-error.log
34 RedirectPermanent / https://<%= @name %>/
39 ServerName <%= @name %>
41 ServerAdmin webmaster@openstreetmap.org
44 SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
45 SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
47 CustomLog /var/log/apache2/<%= @name %>-access.log combined
48 ErrorLog /var/log/apache2/<%= @name %>-error.log
50 DocumentRoot <%= @directory %>
51 <% @urls.each do |url,directory| -%>
52 Alias <%= url %> <%= directory %>
53 <Directory <%= directory %>>
56 <FilesMatch ".+\.ph(ar|p|tml)$">
62 <Directory <%= @directory %>>
65 RewriteRule ^wp-admin/includes/ - [F,L]
66 RewriteRule !^wp-includes/ - [S=3]
67 RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
68 RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
69 RewriteRule ^wp-includes/theme-compat/ - [F,L]
70 RewriteRule ^readme\.html$ [F,L]
71 RewriteRule ^index\.php$ - [L]
72 RewriteCond %{REQUEST_FILENAME} !-f
73 RewriteCond %{REQUEST_FILENAME} !-d
74 RewriteRule . /index.php [L]
77 AllowOverride AuthConfig
81 # https://www.wp-pay.org/http-authorization-header-missing/
84 <FilesMatch ".+\.ph(ar|p|tml)$">
85 SetHandler "proxy:unix:/run/php/php-<%= @name %>-fpm.sock|fcgi://127.0.0.1"
89 <Files <%= @directory %>/wp-config.php>
93 <Directory <%= @directory %>/uploads>
95 AddType text/plain .html .htm .shtml
96 <FilesMatch ".+\.ph(ar|p|tml)$">
101 <Directory ~ "\.svn">
105 <Directory ~ "\.git">
109 <Files ~ "(?<!robots|ads|security|humans)\.(txt|md)$">