]> git.openstreetmap.org Git - chef.git/blob - cookbooks/cgiirc/templates/default/apache.erb
1afb107ba1d2326fb69417c46796741b5c40c58d
[chef.git] / cookbooks / cgiirc / templates / default / apache.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <VirtualHost *:443>
4   ServerName <%= @name %>
5   ServerAdmin webmaster@openstreetmap.org
6
7   SSLEngine on
8   SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
9   SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
10
11   CustomLog /var/log/apache2/<%= @name %>-access.log combined
12   ErrorLog /var/log/apache2/<%= @name %>-error.log
13
14   DocumentRoot /usr/lib/cgi-bin/cgiirc
15   DirectoryIndex irc.cgi
16   Alias /images /usr/share/images/cgiirc
17
18   <Directory "/usr/lib/cgi-bin/cgiirc">
19     AddHandler cgi-script .cgi
20     Require all granted
21   </Directory>
22
23   <Directory "/usr/share/images/cgiirc">
24     Require all granted
25   </Directory>
26
27   <IfModule mod_deflate.c>
28     RemoveOutputFilter DEFLATE
29     SetEnv no-gzip
30   </IfModule>
31 </VirtualHost>
32 <% unless @aliases.empty? -%>
33
34 <VirtualHost *:443>
35   ServerName <%= @aliases.first %>
36 <% @aliases.drop(1).each do |alias_name| -%>
37   ServerAlias <%= alias_name %>
38 <% end -%>
39   ServerAdmin webmaster@openstreetmap.org
40
41   SSLEngine on
42   SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
43   SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
44
45   CustomLog /var/log/apache2/<%= @name %>-access.log combined
46   ErrorLog /var/log/apache2/<%= @name %>-error.log
47
48   RedirectPermanent / https://<%= @name %>/
49 </VirtualHost>
50 <% end -%>
51
52 <VirtualHost *:80>
53   ServerName <%= @name %>
54 <% @aliases.each do |alias_name| -%>
55   ServerAlias <%= alias_name %>
56 <% end -%>
57         ServerAdmin webmaster@openstreetmap.org
58
59         CustomLog /var/log/apache2/<%= @name %>-access.log combined
60         ErrorLog /var/log/apache2/<%= @name %>-error.log
61
62         RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
63         RedirectPermanent / https://<%= @name %>/
64 </VirtualHost>