X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/67c2aceb91955ff583c41807759d203a4478e4b1..db474b56c61d96583f09a5e81662a0b0b5f0f650:/cookbooks/blogs/templates/default/apache.erb?ds=sidebyside
diff --git a/cookbooks/blogs/templates/default/apache.erb b/cookbooks/blogs/templates/default/apache.erb
index 1cb0fe44c..507d48b19 100644
--- a/cookbooks/blogs/templates/default/apache.erb
+++ b/cookbooks/blogs/templates/default/apache.erb
@@ -1,27 +1,52 @@
# DO NOT EDIT - This file is being maintained by Chef
- ServerName <%= @name %>
- ServerAdmin webmaster@openstreetmap.org
+ ServerName <%= @name %>
+<% @aliases.each do |alias_name| -%>
+ ServerAlias <%= alias_name %>
+<% end -%>
+ ServerAdmin webmaster@openstreetmap.org
- CustomLog /var/log/apache2/<%= @name %>-access.log combined
- ErrorLog /var/log/apache2/<%= @name %>-error.log
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
- Redirect permanent / https://<%= @name %>/
+ RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+ Redirect permanent / https://<%= @name %>/
+<% unless @aliases.empty? -%>
- ServerName <%= @name %>
- ServerAdmin webmaster@openstreetmap.org
+ ServerName <%= @aliases.first %>
+<% @aliases.drop(1).each do |alias_name| -%>
+ ServerAlias <%= alias_name %>
+<% end -%>
+ ServerAdmin webmaster@openstreetmap.org
- CustomLog /var/log/apache2/<%= @name %>-access.log combined
- ErrorLog /var/log/apache2/<%= @name %>-error.log
+ SSLEngine on
+ SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
+ SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
- DocumentRoot <%= @directory %>
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
- SSLEngine on
+ RedirectPermanent / https://<%= @name %>/
+
+<% end -%>
+
+
+ ServerName <%= @name %>
+ ServerAdmin webmaster@openstreetmap.org
+
+ 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 %>
>
- Require all granted
+ Require all granted