[Mageia-sysadm] [1010] add vhost for static.mageia.org

Michael Scherer misc at zarb.org
Fri Feb 11 19:15:53 CET 2011


 On Fri, 11 Feb 2011 17:46:37 +0100 (CET), root at mageia.org wrote:
> Revision: 1010
> Author:   boklm
> Date:     2011-02-11 17:46:37 +0100 (Fri, 11 Feb 2011)
> Log Message:
> -----------
> add vhost for static.mageia.org
>
> Modified Paths:
> --------------
>     puppet/deployment/websites/manifests/init.pp
>
> Added Paths:
> -----------
>     puppet/deployment/websites/templates/vhost_static.conf
>
> Modified: puppet/deployment/websites/manifests/init.pp
> ===================================================================
> --- puppet/deployment/websites/manifests/init.pp	2011-02-11 15:39:14
> UTC (rev 1009)
> +++ puppet/deployment/websites/manifests/init.pp	2011-02-11 16:46:37
> UTC (rev 1010)
> @@ -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'

 This path is ugly and really do not help much to know what is there.
 What is wrong with the /var/www we used everywhere ?


> +    # 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/"

 the same goes for this one ( yes, I already told it on irc , but I rest 
 my case, this is not gonna
 help in the futur to have a readable system, much like the bunch of 
 symlink on mandriva cluster
 created just by pure lazyness ).


> +<VirtualHost *:80>
> +    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
> +
> +    <Location />
> +       Allow from all
> +    </Location>
> +
> +    <Directory <%= vhostdir %>>
> +       Order deny,allow
> +       Allow from All
> +       AllowOverride None
> +    </Directory>
> +</VirtualHost>

 I think you should take in account the templates I wrote for apache, 
 much more concise :
 http://svnweb.mageia.org/adm/puppet/modules/apache/manifests/init.pp?revision=1021&view=markup

 And also we should make sure mod_deplate is installed

-- 
 Michael Scherer


More information about the Mageia-sysadm mailing list