X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/faf8ae12e85eabb050b0f5eceb2cb67ad1de5261..0515f31b3462cc9720580a6b60d57914b241bfa2:/cookbooks/otrs/templates/default/apache.erb diff --git a/cookbooks/otrs/templates/default/apache.erb b/cookbooks/otrs/templates/default/apache.erb index da5a60d2f..4018c36a1 100644 --- a/cookbooks/otrs/templates/default/apache.erb +++ b/cookbooks/otrs/templates/default/apache.erb @@ -1,72 +1,94 @@ # DO NOT EDIT - This file is being maintained by Chef - ServerName <%= @name %> - ServerAdmin webmaster@openstreetmap.org + 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 + CustomLog /var/log/apache2/<%= @name %>-access.log combined + ErrorLog /var/log/apache2/<%= @name %>-error.log - RedirectPermanent / https://otrs.openstreetmap.org/ + RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ + RedirectPermanent / https://otrs.openstreetmap.org/ +<% unless @aliases.empty? -%> - ServerName <%= @name %> - ServerAdmin webmaster@openstreetmap.org - - CustomLog /var/log/apache2/<%= @name %>-access.log combined - ErrorLog /var/log/apache2/<%= @name %>-error.log - - SSLEngine on - - ScriptAlias /otrs/ /opt/otrs/bin/cgi-bin/ - Alias /otrs-web/ /opt/otrs/var/httpd/htdocs/ - RedirectMatch ^/$ /otrs/index.pl - - PerlRequire /opt/otrs/scripts/apache2-perl-startup.pl - - PerlModule Apache2::Reload - PerlInitHandler Apache2::Reload - PerlModule Apache2::RequestRec - - - ErrorDocument 403 /otrs/index.pl - ErrorDocument 404 /otrs/index.pl - SetHandler perl-script - PerlResponseHandler ModPerl::Registry - Options +ExecCGI - PerlOptions +ParseHeaders - PerlOptions +SetupEnv - Order allow,deny - Allow from all - - - - PerlOptions -ParseHeaders - + 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 -%> - - AllowOverride None - Options +ExecCGI -Includes - Order allow,deny - Allow from all - + + ServerName <%= @name %> + ServerAdmin webmaster@openstreetmap.org - - AllowOverride None - Order allow,deny - Allow from all - + CustomLog /var/log/apache2/<%= @name %>-access.log combined + ErrorLog /var/log/apache2/<%= @name %>-error.log - - - Header set Cache-Control "max-age=2592000 must-revalidate" - - + SSLEngine on + SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem + SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key + + ScriptAlias /otrs/ /opt/otrs/bin/cgi-bin/ + Alias /otrs-web/ /opt/otrs/var/httpd/htdocs/ + RedirectMatch ^/$ /otrs/index.pl + + PerlRequire /opt/otrs/scripts/apache2-perl-startup.pl + + PerlModule Apache2::Reload + PerlInitHandler Apache2::Reload + PerlModule Apache2::RequestRec + + + ErrorDocument 403 /otrs/index.pl + ErrorDocument 404 /otrs/index.pl + SetHandler perl-script + PerlResponseHandler ModPerl::Registry + Options +ExecCGI + PerlOptions +ParseHeaders + PerlOptions +SetupEnv + Require all granted + + + + PerlOptions -ParseHeaders + + + + + AllowOverride None + Options +ExecCGI -Includes + Require all granted + + + + AllowOverride None + Require all granted + + + + + Header set Cache-Control "max-age=2592000 must-revalidate" + + - - - Header set Cache-Control "max-age=2592000 must-revalidate" - + + + Header set Cache-Control "max-age=2592000 must-revalidate" +