]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/roles/templates/static-mirroring/static-vhost.conf.erb
Enable Indexes option for static vhosts
[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                 Options Indexes
36                 IndexOptions FancyIndexing NameWidth=*
37                 <% if @lsbmajdistrelease > '7' -%>
38                         Require all granted
39                 <% else -%>
40                         Order allow,deny
41                         Allow from all
42                 <% end -%>
43         </Directory>
44
45         Header set Surrogate-Key <%= hostname %>
46
47         DefaultType text/plain
48         AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
49 </Macro>
50
51
52 <Macro common-static-vhost-with-extra $name $extra>
53         <Virtualhost <%= vhost_listen %> >
54                 ServerName $name
55                 ServerAdmin debian-admin@lists.debian.org
56
57                 ErrorLog /var/log/apache2/$name-error.log
58                 CustomLog /var/log/apache2/$name-access.log privacy
59
60                 Use common-static-base $name
61                 $extra
62         </VirtualHost>
63 </Macro>
64
65 <Macro common-static-vhost $name>
66         Use common-static-vhost-with-extra $name "# nada"
67 </Macro>
68
69
70 <Macro common-static-vhost-ssl $name>
71         Use common-dsa-vhost-https-redirect $name
72
73         <Virtualhost <%= vhost_listen_443 %> >
74                 ServerName $name
75                 ServerAdmin debian-admin@lists.debian.org
76
77                 ErrorLog /var/log/apache2/$name-error.log
78                 CustomLog /var/log/apache2/$name-access.log privacyssl
79
80                 Use common-debian-service-ssl $name
81                 Use common-ssl-HSTS
82
83                 Use common-static-base $name
84         </VirtualHost>
85 </Macro>
86
87 # vim:ft=apache: