From 1dabe4b15e5a34d4207966acf150b4fb14fae9c2 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Fri, 11 Feb 2011 16:46:37 +0000 Subject: add vhost for static.mageia.org --- deployment/websites/manifests/init.pp | 25 +++++++++++++++++++++ deployment/websites/templates/vhost_static.conf | 30 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 deployment/websites/templates/vhost_static.conf (limited to 'deployment/websites') diff --git a/deployment/websites/manifests/init.pp b/deployment/websites/manifests/init.pp index 975a32e1..dbc09c0e 100644 --- a/deployment/websites/manifests/init.pp +++ b/deployment/websites/manifests/init.pp @@ -1,4 +1,16 @@ class websites { + class base { + # FIXME : + # We should be able to define this path on each host. + # Maybe using Facter ? + $webdatadir = '/srv/web1-dd0/www' + + file { "$webdatadir": + ensure => directory, + mode => 755, + } + } + # should expire on June 2011 class donate { apache::vhost_other_app { "donate.$domain": @@ -6,6 +18,19 @@ class websites { } } + # vhost to host static files used by web sites + class static inherits base { + $vhostdir = "$webdatadir/static.$domain" + $svn_location = "svn://svn.$domain/svn/web/www/trunk/g/" + apache::vhost_other_app { "static.$domain": + vhost_file => 'websites/vhost_static.conf', + } + + subversion::snapshot { $vhostdir: + source => $svn_location + } + } + class svn { apache::vhost_redirect { "svn.$domain": url => "http://svnweb.$domain/", diff --git a/deployment/websites/templates/vhost_static.conf b/deployment/websites/templates/vhost_static.conf new file mode 100644 index 00000000..32a3d5ab --- /dev/null +++ b/deployment/websites/templates/vhost_static.conf @@ -0,0 +1,30 @@ + + ServerName static.<%= domain %> + + DocumentRoot <%= vhostdir %> + CustomLog /var/log/httpd/static_log combined + ErrorLog /var/log/httpd/error_static_log + + FileETag none + Header unset ETag +    ExpiresActive On +    ExpiresByType text/css "access plus 1 month" +   ExpiresByType image/gif "access plus 2 months" +   ExpiresByType image/png "access plus 2 months" +   ExpiresByType image/jpeg "access plus 2 months" +   ExpiresByType image/x-icon "access plus 2 months" +   ExpiresByType application/x-javascript "access plus 1 month" +   ExpiresByType text/javascript "access plus 1 month" +   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css +   AddOutputFilterByType DEFLATE application/json text/javascript application/javascript application/x-javascript + + + Allow from all + + + > + Order deny,allow + Allow from All + AllowOverride None + + -- cgit v1.2.1