]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/roles/templates/static-mirroring/vhost/lintian.debian.org.erb
2d112f239383314a647919f80f3f5d59bcfd7f34
[dsa-puppet.git] / modules / roles / templates / static-mirroring / vhost / lintian.debian.org.erb
1 <Virtualhost <%= vhost_listen %> >
2         ServerName lintian.debian.org
3         ServerAdmin lintian-maint@debian.org
4
5         ErrorLog /var/log/apache2/lintian.debian.org-error.log
6         CustomLog /var/log/apache2/lintian.debian.org-access.log privacy
7
8         <IfModule mod_userdir.c>
9                 UserDir disabled
10         </IfModule>
11
12         DocumentRoot /srv/static.debian.org/mirrors/lintian.debian.org/cur
13         AddDefaultCharset utf-8
14
15         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur>
16                 # These two lines makes apache serve "lintian.log.gz" as a text/plain with encoding gzip
17                 # making it easier to view the log in the browser.
18                 RemoveType .gz
19                 AddEncoding x-gzip .gz
20                 AddType text/plain .log
21
22                 <IfModule mod_userdir.c>
23                         AddOutputFilterByType DEFLATE image/svg+xml
24                         AddOutputFilterByType DEFLATE text/plain
25                 </IfModule>
26         </Directory>
27
28         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur/graphs>
29                 # Cache graphs for an hour (Technically, a "expires" of "24h after last mod"
30                 # might be better, but oh well)
31                 Header set Cache-Control "max-age=3600, must-revalidate, public"
32         </Directory>
33
34         <Directory /srv/static.debian.org/mirrors/lintian.debian.org/cur/resources>
35                 # Cache these for a year (3600 * 24 * 365.25)
36                 # Files in here will change name if their content change
37                 Header set Cache-Control "max-age=31557600, public"
38         </Directory>
39
40         RewriteEngine on
41         RewriteMap source-map txt:/srv/static.debian.org/mirrors/lintian.debian.org/cur/lookup-tables/source-packages
42
43         # Re-direct from the "old" locations to the new ones
44         RewriteRule ^/reports/T(.*)\.html$ /tags/$1.html [L,R=permanent]
45         RewriteRule ^/reports/(.*)$ /$1 [L,R=permanent]
46
47         # Map source packages to reports (this mapping is re-written once per lintian run,
48         # serve it as a 302 rather than a permanent redirect)
49         # Version-less request
50         RewriteRule ^/source/([a-z0-9-]+)/?$ /${source-map:$1} [L,R,NE]
51         # Versioned request
52         RewriteRule ^/source/([a-z0-9-]+)/([a-zA-Z0-9.+:~-]+)$ /${source-map:$1/$2} [L,R,NE]
53 </VirtualHost>
54 # vim:set syn=apache: