From 44a24564e5d5a0c83330cfd66ce4517520e04dad Mon Sep 17 00:00:00 2001 From: Martin Zobel-Helas Date: Fri, 4 Feb 2011 17:25:07 +0100 Subject: [PATCH] Let's break the website! Signed-off-by: Martin Zobel-Helas --- manifests/site.pp | 5 +- .../apache2/sites-available/www.debian.org | 136 ++++++++++++++++++ modules/apache2/manifests/www_mirror.pp | 18 +++ modules/debian-org/misc/local.yaml | 7 + 4 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 modules/apache2/files/common/etc/apache2/sites-available/www.debian.org create mode 100644 modules/apache2/manifests/www_mirror.pp diff --git a/manifests/site.pp b/manifests/site.pp index b0d412981..428b78eae 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -74,8 +74,11 @@ node default { "true": { case extractnodeinfo($nodeinfo, 'apache2_security_mirror') { true: { include apache2::security_mirror } - default: { include apache2 } } + case extractnodeinfo($nodeinfo, 'apache2_www_mirror') { + true: { include apache2::www_mirror } + } + default: { include apache2 } } } diff --git a/modules/apache2/files/common/etc/apache2/sites-available/www.debian.org b/modules/apache2/files/common/etc/apache2/sites-available/www.debian.org new file mode 100644 index 000000000..879be6615 --- /dev/null +++ b/modules/apache2/files/common/etc/apache2/sites-available/www.debian.org @@ -0,0 +1,136 @@ +# Need to turn on negotiation_module + + Options +MultiViews +FollowSymLinks +Indexes + AddHandler type-map var + # Make sure that the srm.conf directive is commented out. + AddDefaultCharSet Off + AllowOverride AuthConfig FileInfo + + # Serve icons as image/x-icon + AddType image/x-icon .ico + + # Serve RSS feeds as application/rss+xml + AddType application/rss+xml .rdf + + # Nice caching.. + ExpiresActive On + ExpiresDefault "access plus 1 day" + ExpiresByType image/gif "access plus 1 week" + ExpiresByType image/jpeg "access plus 1 week" + + # language stuff, for web site translations + # for boot-floppies docs only: sk + AddLanguage en .en + AddLanguage en-us .en-us + AddLanguage en-gb .en-gb + AddLanguage ar .ar + AddLanguage bg .bg + AddLanguage ca .ca + AddLanguage cs .cs + AddLanguage da .da + AddLanguage de .de + AddLanguage el .el + AddLanguage eo .eo + AddLanguage es .es + AddLanguage fi .fi + AddLanguage fr .fr + AddLanguage hr .hr + AddLanguage hu .hu + AddLanguage hy .hy + AddLanguage id .id + AddLanguage it .it + AddLanguage ja .ja + AddLanguage ko .ko + AddLanguage lt .lt + AddLanguage nl .nl + AddLanguage no .no + AddLanguage nb .nb + AddLanguage pl .pl + AddLanguage pt .pt + AddLanguage pt-br .pt + AddLanguage ro .ro + AddLanguage ru .ru + AddLanguage sk .sk + AddLanguage sl .sl + AddLanguage sv .sv + AddLanguage tr .tr + AddLanguage uk .uk + AddLanguage vi .vi + AddLanguage zh-CN .zh-cn + AddLanguage zh-HK .zh-hk + AddLanguage zh-TW .zh-tw + LanguagePriority en fr de it es ja pl hr da pt pt-br fi zh-cn zh-hk zh-tw cs sv ko no nb ru tr eo ar nl hu ro sk el ca en-us en-gb id lt sl bg uk hy vi + + DirectoryIndex index index.html index.shtml index.htm + + + ForceType text/html + + + + ForceType application/pdf + + + + ForceType text/plain + + + + + ServerName www.nl.debian.org + ServerAdmin webmaster@debian.org + ServerAlias www.debian.com www.debian.de www.*.debian.org newwww.deb.at www.debian.net debian.net + DocumentRoot /srv/www.debian.org/www/ + ErrorLog /var/log/apache2/www-other.debian.org-error.log + CustomLog /var/log/apache2/www-other.debian.org-access.log combined + RewriteLog /var/log/apache2/www-other.debian.org-recirect.log + + RewriteEngine on + RewriteRule ^(.*)$ http://www.debian.org/$1 [R=301,L] + + + + ServerName www.debian.org + ServerAdmin webmaster@debian.org + ServerAlias debian.org www-staging.debian.org + DocumentRoot /srv/www.debian.org/www/ + ErrorLog /var/log/apache2/www.debian.org-error.log + CustomLog /var/log/apache2/www.debian.org-access.log combined + + # CacheNegotiatedDocs: By default, Apache sends Pragma: no-cache with each + # document that was negotiated on the basis of content. This asks proxy + # servers not to cache the document. Uncommenting the following line disables + # this behavior, and proxies will be allowed to cache the documents. + CacheNegotiatedDocs On + +# the joys of backwards compatibility + Redirect /cgi-bin/cvsweb http://cvs.debian.org + Redirect /Lists-Archives http://lists.debian.org + Redirect /search http://search.debian.org + Redirect /Packages http://packages.debian.org + Redirect /lintian http://lintian.debian.org + + Redirect /SPI http://www.spi-inc.org +# Redirect /OpenHardware http://www.openhardware.org + Redirect /OpenSource http://www.opensource.org + + Redirect /Bugs/db/ix/pseudopackages.html http://www.debian.org/Bugs/pseudo-packages + RewriteEngine on + RewriteRule ^/Bugs/db/pa/l([^/]+).html$ http://bugs.debian.org/$1 + RewriteRule ^/Bugs/db/[[:digit:]][[:digit:]]/([[:digit:]][[:digit:]][[:digit:]]+).html$ http://bugs.debian.org/$1 + RewriteRule ^/Bugs/db/ma/l([^/]+).html$ http://bugs.debian.org/cgi-bin/pkgreport.cgi?maintenc=$1 + + Userdir http://people.debian.org/~*/ + + Redirect /doc/prospective-packages http://www.debian.org/devel/wnpp/ + Redirect /devel/maintainer_contacts http://www.debian.org/intro/organization + Redirect /zh/ http://www.debian.org/intl/Chinese/ + Redirect /devel/help http://www.debian.org/devel/join/ + Redirect /distrib/books http://www.debian.org/doc/books + Redirect /distrib/vendors http://www.debian.org/CD/vendors/ + Redirect /distrib/cdinfo http://www.debian.org/CD/vendors/info + Redirect /related_links http://www.debian.org/misc/related_links + Redirect /ports/laptops http://www.debian.org/misc/laptops/ + Redirect /misc/README.mirrors http://www.debian.org/mirror/list + Redirect /misc/README.non-US http://www.debian.org/mirror/list.non-US + diff --git a/modules/apache2/manifests/www_mirror.pp b/modules/apache2/manifests/www_mirror.pp new file mode 100644 index 000000000..e0e18f67f --- /dev/null +++ b/modules/apache2/manifests/www_mirror.pp @@ -0,0 +1,18 @@ +class apache2::www_mirror inherits apache2 { + file { + "/etc/apache2/sites-available/www.debian.org": + source => [ "puppet:///modules/apache2/per-host/$fqdn/etc/apache2/sites-available/www.debian.org", + "puppet:///modules/apache2/common/etc/apache2/sites-available/www.debian.org" ]; + + } + + activate_apache_site { + "010-www.debian.org": site => "www.debian.org"; + "www.debian.org": ensure => absent; + } + +} + +# vim:set et: +# vim:set sts=4 ts=4: +# vim:set shiftwidth=4: diff --git a/modules/debian-org/misc/local.yaml b/modules/debian-org/misc/local.yaml index 4bac2404d..cf4ee40c9 100644 --- a/modules/debian-org/misc/local.yaml +++ b/modules/debian-org/misc/local.yaml @@ -166,6 +166,13 @@ host_settings: - steffani.debian.org - villa.debian.org - wieck.debian.org + apache2_www_mirror: + - senfl.debian.org + - bellini.debian.org + - englund.debian.org + - gluck.debian.org + - klecker.debian.org + - kokkonen.debian.org timeserver: - merikanto.debian.org - orff.debian.org -- 2.20.1