Handle apache 2.4 authz_host config in www.debian.org template
[mirror/dsa-puppet.git] / modules / roles / templates / static-mirroring / static-vhost.conf.erb
1 # puppet maintained
2 <Macro common-dsa-vhost-https-redirect $name>
3         <VirtualHost <%= vhost_listen %> >
4                 ServerName $name
5                 ServerAdmin debian-admin@lists.debian.org
6
7                 CustomLog /var/log/apache2/$name-access.log privacy
8                 ErrorLog /var/log/apache2/$name-error.log
9
10                 Redirect permanent / https://$name/
11         </VirtualHost>
12 </Macro>
13
14 <Macro common-dsa-vhost-https-redirect-temp $name>
15         <VirtualHost <%= vhost_listen %> >
16                 ServerName $name
17                 ServerAdmin debian-admin@lists.debian.org
18
19                 CustomLog /var/log/apache2/$name-access.log privacy
20                 ErrorLog /var/log/apache2/$name-error.log
21
22                 Redirect / https://$name/
23         </VirtualHost>
24 </Macro>
25
26 <Macro common-static-base $name>
27         <IfModule mod_userdir.c>
28                 UserDir disabled
29         </IfModule>
30         ServerSignature On
31
32         DocumentRoot /srv/static.debian.org/mirrors/$name/cur
33         <Directory /srv/static.debian.org/mirrors/$name/cur>
34                 AllowOverride FileInfo Indexes Options=Multiviews
35                 IndexOptions FancyIndexing NameWidth=*
36                 Order allow,deny
37                 Allow from all
38         </Directory>
39
40         Header set Surrogate-Key <%= hostname %>
41
42         DefaultType text/plain
43         AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
44 </Macro>
45
46
47 <Macro common-static-vhost-with-extra $name $extra>
48         <Virtualhost <%= vhost_listen %> >
49                 ServerName $name
50                 ServerAdmin debian-admin@lists.debian.org
51
52                 ErrorLog /var/log/apache2/$name-error.log
53                 CustomLog /var/log/apache2/$name-access.log privacy
54
55                 Use common-static-base $name
56                 $extra
57         </VirtualHost>
58 </Macro>
59
60 <Macro common-static-vhost $name>
61         Use common-static-vhost-with-extra $name "# nada"
62 </Macro>
63
64
65 <Macro common-static-vhost-ssl $name>
66         Use common-dsa-vhost-https-redirect $name
67
68         <Virtualhost <%= vhost_listen_443 %> >
69                 ServerName $name
70                 ServerAdmin debian-admin@lists.debian.org
71
72                 ErrorLog /var/log/apache2/$name-error.log
73                 CustomLog /var/log/apache2/$name-access.log privacyssl
74
75                 Use common-debian-service-ssl $name
76                 Use common-ssl-HSTS
77
78                 Use common-static-base $name
79         </VirtualHost>
80 </Macro>
81
82 # vim:ft=apache: