From 0004d26ce0dc0b05eae73e7168f100c627e6d9f2 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sat, 20 Jul 2013 20:33:30 +0000 Subject: [PATCH] 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 --- manifests/site.pp | 1 + templates/vhost.erb | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 templates/vhost.erb diff --git a/manifests/site.pp b/manifests/site.pp index d032965..ff4fa08 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -15,6 +15,7 @@ define meetbot::site( port => 80, docroot => "/srv/meetbot-${name}", priority => '50', + template => 'meetbot/vhost.erb', } file { $varlib: diff --git a/templates/vhost.erb b/templates/vhost.erb new file mode 100644 index 0000000..a137d57 --- /dev/null +++ b/templates/vhost.erb @@ -0,0 +1,29 @@ +# ************************************ +# Managed by Puppet +# ************************************ + +NameVirtualHost <%= vhost_name %>:<%= port %> +:<%= port %>> + ServerName <%= srvname %> +<% if serveraliases.is_a? Array -%> +<% serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%> +<% elsif serveraliases != '' -%> +<%= " ServerAlias #{serveraliases}" %> +<% end -%> + DocumentRoot <%= docroot %> + + ForceType text/plain + AddDefaultCharset UTF-8 + + > + Options <%= options %> + AllowOverride None + Order allow,deny + allow from all + + + ErrorLog /var/log/apache2/<%= name %>_error.log + LogLevel warn + CustomLog /var/log/apache2/<%= name %>_access.log combined + ServerSignature Off +