From 70ff1bdc2353cb1f484bf8b9582eeba53bbb4ed5 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 26 Jul 2013 06:46:19 -0400 Subject: [PATCH] enable htmlify on main log vhost Change-Id: Ic3289ca87726501d6904ebd8e23a30329b9b050f --- .../openstack_project/templates/logs.vhost.erb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/openstack_project/templates/logs.vhost.erb b/modules/openstack_project/templates/logs.vhost.erb index d45669b7d6..108962a034 100644 --- a/modules/openstack_project/templates/logs.vhost.erb +++ b/modules/openstack_project/templates/logs.vhost.erb @@ -1,3 +1,4 @@ +# -*- apache -*- # ************************************ # Managed by Puppet # ************************************ @@ -11,11 +12,12 @@ NameVirtualHost <%= vhost_name %>:<%= port %> <%= " ServerAlias #{serveraliases}" %> <% end -%> DocumentRoot <%= docroot %> - - ForceType text/plain - AddDefaultCharset UTF-8 - AddEncoding x-gzip gz - + + # use Apache to compress the results afterwards, to save on the wire + # it's approx 18x savings of wire traffic to compress. We need to + # compress by content types that htmlify can produce + AddOutputFilterByType DEFLATE text/plain text/html + ForceType text/html AddDefaultCharset UTF-8 @@ -34,6 +36,11 @@ NameVirtualHost <%= vhost_name %>:<%= port %> ReadmeName /help/tempest-logs.html + RewriteEngine On + # rewrite all txt.gz files to map to our internal htmlify wsgi app + RewriteRule ^/(.*\.txt\.gz)$ /htmlify/$1 [QSA,L,PT] + WSGIScriptAlias /htmlify /usr/local/bin/htmlify-screen-log.py + ErrorLog /var/log/apache2/<%= name %>_error.log LogLevel warn CustomLog /var/log/apache2/<%= name %>_access.log combined