X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/6ed30a3d11d87fbec3d4ecef4c14b0f8ed707216..4e6e1284f19701f46df4abec8d988d6682909474:/cookbooks/taginfo/templates/default/apache.erb diff --git a/cookbooks/taginfo/templates/default/apache.erb b/cookbooks/taginfo/templates/default/apache.erb index 9ebca518e..4965a9bc1 100644 --- a/cookbooks/taginfo/templates/default/apache.erb +++ b/cookbooks/taginfo/templates/default/apache.erb @@ -1,14 +1,12 @@ # DO NOT EDIT - This file is being maintained by Chef -<% [80, 443].each do |port| -%> - -> + ServerName <%= @name %> ServerAdmin webmaster@openstreetmap.org -<% if port == 443 -%> SSLEngine on -<% end -%> + 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 @@ -17,5 +15,50 @@ RackEnv production PassengerMinInstances 10 PassengerPreStart http://<%= @name %>/ + PassengerAppGroupName taginfo + + CacheEnable disk /api + CacheEnable disk /embed + CacheStaleOnError off + + + Header setifempty Access-Control-Allow-Origin * + + +<% unless @aliases.empty? -%> + + + 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 + ErrorLog /var/log/apache2/<%= @name %>-error.log + + RedirectPermanent / https://<%= @name %>/ <% end -%> + + + 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 + + RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ + RedirectPermanent / https://<%= @name %>/ + + +> + Require all granted +