From: Peter Palfrader Date: Thu, 26 Apr 2018 08:15:48 +0000 (+0200) Subject: Add apache vhost X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=ce159c3c166c75b310c4a4c31d1c5b774b043f7a;p=mirror%2Fdsa-puppet.git Add apache vhost --- diff --git a/modules/roles/manifests/snapshot_web.pp b/modules/roles/manifests/snapshot_web.pp index fefe24b52..e70c88966 100644 --- a/modules/roles/manifests/snapshot_web.pp +++ b/modules/roles/manifests/snapshot_web.pp @@ -6,4 +6,9 @@ class roles::snapshot_web { ], { ensure => 'installed', }) + + apache2::site { '020-snapshot.debian.org': + site => 'snapshot.debian.org', + content => template('roles/snapshot/snapshot.debian.org.conf.erb') + } } diff --git a/modules/roles/templates/snapshot/snapshot.debian.org.conf.erb b/modules/roles/templates/snapshot/snapshot.debian.org.conf.erb new file mode 100644 index 000000000..007b5d4d6 --- /dev/null +++ b/modules/roles/templates/snapshot/snapshot.debian.org.conf.erb @@ -0,0 +1,50 @@ +# vim: set ts=2 sw=2 et si sm: + +WSGIDaemonProcess snapshot.debian.org user=nobody group=nogroup home=/ processes=4 threads=10 maximum-requests=5000 inactivity-timeout=1800 umask=0077 display-name=wsgi-snapshot.debian.org + + + ServerName snapshot.debian.org + ServerAlias snapshot-dev.debian.org snapshot-master.debian.org snapshot-*.debian.org snapshot.debian.net + ServerAdmin team@snapshot.debian.org + + ErrorLog /var/log/apache2/snapshot.debian.org-error.log + CustomLog /var/log/apache2/snapshot.debian.org-access.log combined + + Alias /static /srv/snapshot.debian.org/web/public/static + Alias /robots.txt /srv/snapshot.debian.org/web/public/robots.txt + + SetEnv GIT_PROJECT_ROOT /srv/snapshot.debian.org/all-git + AliasMatch ^/gits/(.*)$ /srv/snapshot.debian.org/all-git/$1 + + RewriteEngine on + + # forbid POST requests + RewriteCond %{REQUEST_METHOD} POST + RewriteRule .* - [F,L] + + RewriteRule ^/archive/backports.org/(.*) /archive/debian-backports/$1 [L,R] + RewriteRule ^/git/(.*) /gits/snapshot.git/$1 [PT] + + RewriteCond %{HTTP_HOST} ^snapshot.debian.net$ + RewriteRule ^/(.*)$ http://snapshot.debian.org/ [R] + + + Require all granted + + + Require all granted + + + + Require all granted + + + + WSGIScriptAlias / /srv/snapshot.debian.org/bin/snapshot.wsgi + WSGIProcessGroup snapshot.debian.org + + + + ServerName snapshots.debian.org + RedirectPermanent / http://snapshot.debian.org/ +