]> git.deb.at Git - deb/packages.git/blob - conf/apache.conf.sed.in
Merge branch 'master' into ubuntu-master
[deb/packages.git] / conf / apache.conf.sed.in
1 # Need to turn on negotiation_module
2 <Directory %TOPDIR%/www/>
3   Options +MultiViews +FollowSymLinks +Indexes
4   AddHandler type-map var
5   # Make sure that the srm.conf directive is commented out.
6   AddDefaultCharSet utf-8
7   AllowOverride AuthConfig FileInfo
8
9   # Nice caching..
10   ExpiresActive On
11   ExpiresDefault "access plus 1 day"
12   ExpiresByType image/gif  "modification plus 1 year"
13   ExpiresByType image/jpeg "modification plus 1 year"
14   ExpiresByType image/png  "modification plus 1 year"
15
16   # language stuff
17   # you need to keep this in sync with lib/Packages/I18N/Locale.pm
18   # %lang2charset
19   AddLanguage en .en
20   AddLanguage en-us .en-us
21   AddLanguage en-gb .en-gb
22   AddLanguage ar .ar
23   AddLanguage bg .bg
24   AddLanguage ca .ca
25   AddLanguage cs .cs
26   AddLanguage da .da
27   AddLanguage de .de
28   AddLanguage el .el
29   AddLanguage eo .eo
30   AddLanguage es .es
31   AddLanguage fi .fi
32   AddLanguage fr .fr
33   AddLanguage hr .hr
34   AddLanguage hu .hu
35   AddLanguage id .id
36   AddLanguage it .it
37   AddLanguage ja .ja
38   AddLanguage ko .ko
39   AddLanguage lt .lt
40   AddLanguage nl .nl
41   AddLanguage no .no
42   AddLanguage nb .nb
43   AddLanguage pl .pl
44   AddLanguage pt .pt
45   AddLanguage pt-pt .pt_PT
46   AddLanguage pt-br .pt_BR
47   AddLanguage ro .ro
48   AddLanguage ru .ru
49   AddLanguage sk .sk
50   AddLanguage sl .sl
51   AddLanguage sv .sv_SE
52   AddLanguage tr .tr
53   AddLanguage uk .uk
54   AddLanguage zh-CN .zh-cn
55   AddLanguage zh-HK .zh-hk
56   AddLanguage zh-TW .zh-tw
57   LanguagePriority en fr de it es ja pl hr da pt pt-pt pt-br fi zh-cn zh-hk zh-tw cs sv sv-se ko no nb ru tr uk eo ar nl hu ro sk el ca en-us en-gb id lt sl bg
58
59   DirectoryIndex index
60
61   # RSS stuff
62   AddType application/rss+xml .rdf .xml
63
64   RemoveType .gz
65   AddEncoding x-gzip .gz
66 </Directory>
67
68 <VirtualHost *>
69    ServerAdmin frank@lichtenheld.de
70    DocumentRoot %TOPDIR%/www/
71    ServerName %SITE%
72    ErrorLog /var/log/apache2/%SITE%-error.log
73    CustomLog /var/log/apache2/%SITE%-access.log combined
74
75    ScriptAlias /cgi-bin/ %TOPDIR%/cgi-bin/
76   
77    PerlModule ModPerl::Registry
78    PerlTaintCheck On
79    PerlRequire %TOPDIR%/bin/mod_perl-startup
80    PerlSwitches -T
81    <Location /cgi-bin/>
82       SetHandler perl-script
83       PerlInitHandler Apache2::Reload
84       PerlHandler ModPerl::Registry
85       Options +ExecCGI
86       PerlSendHeader On
87       allow from all
88    </Location>
89
90    BrowserMatch reportbug is_reportbug
91
92    RewriteEngine on
93    RewriteLog /var/log/apache2/rewrite.log
94    RewriteLogLevel 0
95
96    RewriteMap changelog-url txt:%TOPDIR%/files/changelogs-map
97
98    RewriteRule ^/cgi-bin/search_packages.pl(.*)$ /search$1
99    RewriteRule ^/cgi-bin/search_contents.pl(.*)$ /search$1
100    RewriteRule ^/unstable/newpkg_([a-z]+)\.[a-z]+\.rdf /unstable/$1/newpkg?format=rss [R=permanent,L]
101    RewriteRule ^/unstable/newpkg_([a-z]+) /unstable/$1/newpkg [R=permanent,L]
102
103    # we never want to rewrite those URLs
104    RewriteRule ^/cgi-bin/dispatcher.pl - [L]
105    RewriteRule ^/changelogs/ - [L]
106    RewriteRule ^/Pics/ - [L]
107    RewriteRule ^/about/ - [L]
108    RewriteRule ^/ubuntu/ - [L]
109    RewriteRule ^/[^/]+\.css - [L]
110    RewriteRule ^/[^/]+\.js - [L]
111    RewriteRule ^/favicon.ico$ - [L]
112    RewriteRule ^/robots.txt$ - [L]
113
114 #   RewriteRule ^/$ http://www.debian.org/distrib/packages
115    RewriteRule ^/$                      /index.html [L]
116    RewriteRule ^/([^/+]*)([+])([^/]*)$  "/$1%%{%}2B$3" [N]
117    RewriteRule ^/changelog:(.+)$        /changelogs/${changelog-url:$1} [R,L,NE]
118    RewriteRule ^/src:([^/]+)$           /search?searchon=sourcenames&keywords=$1 [R,L,NE]
119    RewriteRule ^/file:(.+)$             /search?searchon=contents&keywords=$1 [R,L,NE]
120    RewriteCond %{QUERY_STRING} ^$ [OR]
121    RewriteCond %{REQUEST_URI} !^/search$
122    RewriteCond %{REQUEST_URI} !^/cgi-bin/search_(contents|packages)\.pl$
123    RewriteRule ^/([^/]+)$               /search?keywords=$1 [R,L,NE]
124
125    RewriteCond %{QUERY_STRING} =""
126    RewriteCond %TOPDIR%/www%{REQUEST_FILENAME} -f [OR]
127    RewriteCond %TOPDIR%/www%{REQUEST_FILENAME}.en.html -f [OR]
128    RewriteCond %TOPDIR%/www%{REQUEST_FILENAME} -l
129    RewriteRule . - [L]
130
131    RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [L,PT]
132
133 #  In case we need to disable the site again
134
135 #   ErrorDocument 404 /index.html
136 #   RewriteCond %{SCRIPT_FILENAME} !^/(sbin|cgi-bin|Pics|test)/
137 #   RewriteCond %{SCRIPT_FILENAME} !^/favicon.ico
138 #   RewriteCond %{SCRIPT_FILENAME} !^/(stable|testing|unstable|experimental)/
139 #   RewriteRule . /index.html
140
141 </VirtualHost>
142
143 <VirtualHost *>
144    ServerAdmin frank@lichtenheld.de
145    DocumentRoot %TOPDIR%/www/
146    ServerName packages.ubuntu.net
147    ServerAlias packages.ubuntulinux.org
148    ErrorLog /var/log/apache2/%SITE%-error.log
149    CustomLog /var/log/apache2/%SITE%-access.log combined
150
151    ScriptAlias /cgi-bin %TOPDIR%/cgi-bin/
152
153    RedirectMatch permanent (.*) http://%SITE%$1
154 </VirtualHost>
155