]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/apache.erb
Enable SSL on tile render servers
[chef.git] / cookbooks / tile / templates / default / apache.erb
index f6364cc9858e377ace092dde7d0df5b8f7c52a8b..6588ab0b1f981672bde0bcf8350eb549dbd73a60 100644 (file)
@@ -1,13 +1,22 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 # DO NOT EDIT - This file is being maintained by Chef
 
-<VirtualHost *:80>
+<% [80, 443].each do |port| -%>
+<VirtualHost *:<%= port %>>
   # Basic server configuration
   ServerName <%= node[:fqdn] %>
   # Basic server configuration
   ServerName <%= node[:fqdn] %>
-  ServerAlias tile.openstreetmap.org
   ServerAlias render.openstreetmap.org
   ServerAlias *.render.openstreetmap.org
   ServerAlias render.openstreetmap.org
   ServerAlias *.render.openstreetmap.org
-  ServerAlias parent.tile.openstreetmap.org
   ServerAdmin webmaster@openstreetmap.org
   ServerAdmin webmaster@openstreetmap.org
+<% if port == 443 -%>
+
+  #
+  # Enable SSL
+  #
+  SSLEngine on
+  SSLProxyEngine on
+  SSLCertificateFile /etc/ssl/certs/<%= node[:fqdn] %>.pem
+  SSLCertificateKeyFile /etc/ssl/private/<%= node[:fqdn] %>.key
+<% end -%>
 
   # Configure location of static files and CGI scripts
   DocumentRoot /srv/tile.openstreetmap.org/html
 
   # Configure location of static files and CGI scripts
   DocumentRoot /srv/tile.openstreetmap.org/html
@@ -51,6 +60,7 @@
   RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
 </VirtualHost>
 
   RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
 </VirtualHost>
 
+<% end -%>
 <Directory /srv/tile.openstreetmap.org/html>
   Options None
   AllowOverride None
 <Directory /srv/tile.openstreetmap.org/html>
   Options None
   AllowOverride None