Serve IRC log files as MIME type text/plain.

* modules/meetbot/manifests/site.pp: Specify a nondefault vhost
template.

* modules/meetbot/templates/vhost.erb: New file, similar in content
to the default puppetlabs-apache vhost template but forcing MIME
type text/plain and a default encoding of UTF-8 for files ending in
a .log suffix.

Change-Id: Ief0253c2baac32b126472d0f97f0aa503adbbd7f
This commit is contained in:
Jeremy Stanley 2013-07-20 20:33:30 +00:00
parent 0a18477e51
commit 0004d26ce0
2 changed files with 30 additions and 0 deletions

View File

@ -15,6 +15,7 @@ define meetbot::site(
port => 80,
docroot => "/srv/meetbot-${name}",
priority => '50',
template => 'meetbot/vhost.erb',
}
file { $varlib:

29
templates/vhost.erb Normal file
View File

@ -0,0 +1,29 @@
# ************************************
# 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 \.log$>
ForceType text/plain
AddDefaultCharset UTF-8
</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>