]> git.openstreetmap.org Git - chef.git/commitdiff
Enable SSL for the GPS tile server
authorTom Hughes <tom@compton.nu>
Tue, 22 Oct 2013 07:54:57 +0000 (08:54 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 22 Oct 2013 07:54:57 +0000 (08:54 +0100)
cookbooks/gps-tile/recipes/default.rb
cookbooks/gps-tile/templates/default/apache.erb

index 2a4db9582652f7bd3abf8bca5f1cd5876557d28c..eb019f8f078c5fb26479d6d068eb6d51fca6f2fe 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
 # limitations under the License.
 #
 
-include_recipe "apache"
+include_recipe "apache::ssl"
 
 package "make"
 package "build-essential"
 
 package "make"
 package "build-essential"
index 7572327c3a48b57d6a5fa602266876916f35ab95..12d24d13139e83dd4a40820a56f75b8afced4c89 100644 (file)
@@ -1,11 +1,17 @@
 # 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] %>
   ServerAlias gps-tile.openstreetmap.org
   ServerAlias *.gps-tile.openstreetmap.org
   ServerAdmin webmaster@openstreetmap.org
   # Basic server configuration
   ServerName <%= node[:fqdn] %>
   ServerAlias gps-tile.openstreetmap.org
   ServerAlias *.gps-tile.openstreetmap.org
   ServerAdmin webmaster@openstreetmap.org
+<% if port == 443 -%>
+
+  # Enable SSL
+  SSLEngine on
+<% end -%>
 
   # Configure location of static files
   DocumentRoot /srv/gps-tile.openstreetmap.org/html
 
   # Configure location of static files
   DocumentRoot /srv/gps-tile.openstreetmap.org/html
@@ -26,6 +32,7 @@
   Header set Access-Control-Allow-Origin "*"
 </VirtualHost>
 
   Header set Access-Control-Allow-Origin "*"
 </VirtualHost>
 
+<% end -%>
 <Directory /srv/gps-tile.openstreetmap.org/html>
   Options None
   AllowOverride None
 <Directory /srv/gps-tile.openstreetmap.org/html>
   Options None
   AllowOverride None