Revert "Make planet redirect to https"
authorTom Hughes <tom@compton.nu>
Thu, 4 Jan 2018 21:22:15 +0000 (21:22 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 4 Jan 2018 21:22:15 +0000 (21:22 +0000)
This reverts commit 31a516770ed279c68a6fb17ec9a498824becdcf3.

cookbooks/planet/templates/default/apache.erb

index dd2c824..8790c80 100644 (file)
@@ -1,13 +1,18 @@
 # DO NOT EDIT - This file is being maintained by Chef
 # DO NOT EDIT - This file is being maintained by Chef
+<% [80, 443].each do |port| -%>
    
    
-<VirtualHost *:443>
+<VirtualHost *:<%= port %>>
         ServerName planet.openstreetmap.org
         ServerAlias planet.osm.org
         ServerAdmin webmaster@openstreetmap.org
 
         ServerName planet.openstreetmap.org
         ServerAlias planet.osm.org
         ServerAdmin webmaster@openstreetmap.org
 
+<% if port == 443 -%>
         SSLEngine on
         SSLCertificateFile /etc/ssl/certs/planet.openstreetmap.org.pem
         SSLCertificateKeyFile /etc/ssl/private/planet.openstreetmap.org.key
         SSLEngine on
         SSLCertificateFile /etc/ssl/certs/planet.openstreetmap.org.pem
         SSLCertificateKeyFile /etc/ssl/private/planet.openstreetmap.org.key
+<% else -%>
+        RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+<% end -%>
 
         CustomLog /var/log/apache2/planet.openstreetmap.org-access.log combined
         ErrorLog /var/log/apache2/planet.openstreetmap.org-error.log
 
         CustomLog /var/log/apache2/planet.openstreetmap.org-access.log combined
         ErrorLog /var/log/apache2/planet.openstreetmap.org-error.log
 
         RewriteRule     ^(/planet/planet\-latest\.osm\.bz2)$    ${latestplanet:$1}      [R,L]
 </VirtualHost>
 
         RewriteRule     ^(/planet/planet\-latest\.osm\.bz2)$    ${latestplanet:$1}      [R,L]
 </VirtualHost>
-
-<VirtualHost *:80>
-       ServerName planet.openstreetmap.org
-       ServerAlias planet.osm.org
-       ServerAdmin webmaster@openstreetmap.org
-
-       CustomLog /var/log/apache2/planet.openstreetmap.org-access.log combined
-       ErrorLog /var/log/apache2/planet.openstreetmap.org-error.log
-
-       RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
-       RedirectPermanent / https://planet.openstreetmap.org/
-</VirtualHost>
+<% end -%>