From aa8a2584c1cd89529c3fe2867c8ffd2f2151fbde Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 17 Oct 2014 11:16:09 +1100 Subject: [PATCH] Deploy vhost template for nodepool.o.o logs In Ie0b269835ebb8effbac0285b782d8add7b47db32 I didn't consider how difficult it is to get puppet to put in AllowOverride directives to allow .htaccess to work. The puppetlabs-apache version we use does not support "override" as an argument, so you can't easily add this to allow apache to read htaccess. Upgrading is a big task because we are so far behind (see I6fa5f3275a84ec4480169de562d1d4a656111814). So deploy a full template for nodepool vhost that includes the config options we need. Additionally, the existing mimetype isn't set for the log-files --- $ curl -I http://nodepool.openstack.org/image.log.2014-10-14 HTTP/1.1 200 OK Date: Fri, 17 Oct 2014 00:02:39 GMT Server: Apache/2.2.22 (Ubuntu) Last-Modified: Tue, 14 Oct 2014 23:59:56 GMT ETag: "f89bb-d458315-5056acfe33700" Accept-Ranges: bytes Content-Length: 222659349 --- I'm pretty sure this means it defaults to text/plain, but this makes it explicit. This should also matches on the timestampped log files per the rules of multiple extensions [1] [1] http://httpd.apache.org/docs/2.2/mod/mod_mime.html#multipleext Change-Id: I7fa2603f4160b06af71a515e655d4a705fa0c768 --- modules/nodepool/files/nodepool-log.htaccess | 3 --- modules/nodepool/manifests/init.pp | 14 ++---------- .../nodepool/templates/nodepool-log.vhost.erb | 22 +++++++++++++++++++ 3 files changed, 24 insertions(+), 15 deletions(-) delete mode 100644 modules/nodepool/files/nodepool-log.htaccess create mode 100644 modules/nodepool/templates/nodepool-log.vhost.erb diff --git a/modules/nodepool/files/nodepool-log.htaccess b/modules/nodepool/files/nodepool-log.htaccess deleted file mode 100644 index 494e8a7abb..0000000000 --- a/modules/nodepool/files/nodepool-log.htaccess +++ /dev/null @@ -1,3 +0,0 @@ - -AddOutputFilterByType DEFLATE text/text - \ No newline at end of file diff --git a/modules/nodepool/manifests/init.pp b/modules/nodepool/manifests/init.pp index ff268084bf..bc9ff26b2f 100644 --- a/modules/nodepool/manifests/init.pp +++ b/modules/nodepool/manifests/init.pp @@ -252,7 +252,8 @@ class nodepool ( apache::vhost { $vhost_name: port => 80, priority => '50', - docroot => $image_log_document_root, + docroot => 'MEANINGLESS_ARGUMENT', + template => 'nodepool/nodepool-log.vhost.erb', } if $image_log_document_root != '/var/log/nodepool' { @@ -267,17 +268,6 @@ class nodepool ( ], } } - - # htaccess to enable the large .log files to send with gzip - # compression - file { "${image_log_document_root}/.htaccess": - ensure => present, - source => 'puppet:///modules/nodepool/nodepool-log.htaccess', - mode => '0644', - owner => 'nodepool', - group => 'nodepool', - require => File[$image_log_document_root], - } } if $sudo == true { diff --git a/modules/nodepool/templates/nodepool-log.vhost.erb b/modules/nodepool/templates/nodepool-log.vhost.erb new file mode 100644 index 0000000000..a0e6fccb3f --- /dev/null +++ b/modules/nodepool/templates/nodepool-log.vhost.erb @@ -0,0 +1,22 @@ +:80> + + DocumentRoot <%= scope.lookupvar("nodepool:image_log_document_root") %> + + Options <%= scope.lookupvar("apache::params::options") %> + AllowOverride None + Order allow,deny + allow from all + + + ErrorLog /var/log/<%= scope.lookupvar("apache::params::apache_name") %>/nodepool_error.log + LogLevel warn + CustomLog /var/log/<%= scope.lookupvar("apache::params::apache_name") %>/nodepool_access.log combined + ServerSignature Off + + AddType text/plain .log + + + SetOutputFilter DEFLATE + + +