]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/wordpress/templates/default/apache.erb
Sort certificates in a stable order
[chef.git] / cookbooks / wordpress / templates / default / apache.erb
index 3695fc2b7ead29c975a23ad467dfe9447883f60b..59b63f753b72f0b5562483a506c923e307aaf5d1 100644 (file)
@@ -12,6 +12,7 @@
   ErrorLog /var/log/apache2/<%= @name %>-error.log
 
 <% if @ssl_enabled -%>
+  RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
   RedirectPermanent / https://<%= @name %>/
 </VirtualHost>
 
 
   ServerAdmin webmaster@openstreetmap.org
 
-  #
-  # Enable SSL
-  #
   SSLEngine on
+  SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
+  SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
 
   CustomLog /var/log/apache2/<%= @name %>-access.log combined
   ErrorLog /var/log/apache2/<%= @name %>-error.log
   DocumentRoot <%= @directory %>
 <% @urls.each do |url,directory| -%>
   Alias <%= url %> <%= directory %>
+  <Directory <%= directory %>>
+    AllowOverride None
+    php_admin_flag engine off
+    Require all granted
+  </Directory>
 <% end -%>
 
   php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
     RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
     RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
     RewriteRule ^wp-includes/theme-compat/ - [F,L]
+    RewriteRule ^readme\.html$ [F,L]
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule . /index.php [L]
 
     Options -Indexes
+    AllowOverride AuthConfig
 
     Require all granted
   </Directory>
     Require all denied
   </Directory>
 
+  <Files ~ "\.(txt|md)$">
+    Require all denied
+  </Files>
+
   <Files ~ "~$">
     Require all denied
   </Files>