Serve gz html/txt files from logs.o.o.

Change-Id: I9c5405dcf19af6a48f39848fbb4f140e7e38dc48
Reviewed-on: https://review.openstack.org/13189
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
James E. Blair 2012-09-18 07:58:10 +00:00 committed by Jenkins
parent 0c25c7bce2
commit cfa1be910f
2 changed files with 35 additions and 0 deletions

View File

@ -33,6 +33,7 @@ class openstack_project::static (
priority => '50',
docroot => '/srv/static/logs',
require => File['/srv/static/logs'],
template => 'openstack_project/logs.vhost.erb',
}
file { '/srv/static':

View File

@ -0,0 +1,34 @@
# ************************************
# Managed by Puppet
# ************************************
NameVirtualHost <%= vhost_name %>:<%= port %>
<VirtualHost <%= vhost_name %>:<%= port %>>
ServerName <%= srvname %>
<% if serveraliases.is_a? Array -%>
<% serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
<% elsif serveraliases != '' -%>
<%= " ServerAlias #{serveraliases}" %>
<% end -%>
DocumentRoot <%= docroot %>
<FilesMatch \.txt\.gz$>
ForceType text/plain
AddDefaultCharset UTF-8
AddEncoding x-gzip gz
</FilesMatch>
<FilesMatch \.html\.gz$>
ForceType text/html
AddDefaultCharset UTF-8
AddEncoding x-gzip gz
</FilesMatch>
<Directory <%= docroot %>>
Options <%= options %>
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/<%= name %>_error.log
LogLevel warn
CustomLog /var/log/apache2/<%= name %>_access.log combined
ServerSignature Off
</VirtualHost>