]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/taginfo/templates/default/apache.erb
apache: use new combined_extended log format instead of combined
[chef.git] / cookbooks / taginfo / templates / default / apache.erb
index 3ae9fed71228623edd1191b0768484b51766bb27..6d7dd08b48f9a08af8852f89a1118c94c24e48c5 100644 (file)
@@ -8,13 +8,14 @@
         SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
         SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
 
-        CustomLog /var/log/apache2/<%= @name %>-access.log combined
+        CustomLog /var/log/apache2/<%= @name %>-access.log combined_extended
         ErrorLog /var/log/apache2/<%= @name %>-error.log
 
         DocumentRoot <%= @directory %>
         RackEnv production
         PassengerMinInstances 10
         PassengerPreStart http://<%= @name %>/
+        PassengerAppGroupName taginfo
 
         CacheEnable disk /api
         CacheEnable disk /embed
                 Header setifempty Access-Control-Allow-Origin *
         </Location>
 </VirtualHost>
+<% unless @aliases.empty? -%>
+
+<VirtualHost *:443>
+        ServerName <%= @aliases.first %>
+<% @aliases.drop(1).each do |alias_name| -%>
+        ServerAlias <%= alias_name %>
+<% end -%>
+        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_extended
+        ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+        RedirectPermanent / https://<%= @name %>/
+</VirtualHost>
+<% end -%>
 
 <VirtualHost *:80>
         ServerName <%= @name %>
+<% @aliases.each do |alias_name| -%>
+        ServerAlias <%= alias_name %>
+<% end -%>
         ServerAdmin webmaster@openstreetmap.org
 
-        CustomLog /var/log/apache2/<%= @name %>-access.log combined
+        CustomLog /var/log/apache2/<%= @name %>-access.log combined_extended
         ErrorLog /var/log/apache2/<%= @name %>-error.log
 
         RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/