From f2489b8885820c74273ef5fc0593bc1ab022b4a9 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Tue, 24 May 2011 09:07:42 +0000 Subject: add separate logs on vhost_base --- modules/apache/manifests/init.pp | 10 ++++++++++ modules/apache/templates/vhost_base.conf | 3 +++ 2 files changed, 13 insertions(+) (limited to 'modules/apache') diff --git a/modules/apache/manifests/init.pp b/modules/apache/manifests/init.pp index ead7d8f1..08f294c3 100644 --- a/modules/apache/manifests/init.pp +++ b/modules/apache/manifests/init.pp @@ -2,6 +2,7 @@ class apache { class base { $php_date_timezone = "UTC" + $httpd_logdir = "/var/log/httpd" package { "apache-mpm-prefork": alias => apache, @@ -145,6 +146,8 @@ class apache { $vhost = false, $aliases = {}, $server_aliases = [], + $access_logfile = false, + $error_logfile = false, $options = [], $enable_public_html = false) { include apache::base @@ -154,6 +157,13 @@ class apache { $real_vhost = $vhost } + if ! $access_logfile { + $access_logfile = $httpd_logdir/access_log-$real_vhost + } + if ! $error_logfile { + $error_logfile = $httpd_logdir/error_log-$real_vhost + } + if $use_ssl { include apache::mod_ssl if $wildcard_sslcert != 'true' { diff --git a/modules/apache/templates/vhost_base.conf b/modules/apache/templates/vhost_base.conf index e737e990..6737ad00 100644 --- a/modules/apache/templates/vhost_base.conf +++ b/modules/apache/templates/vhost_base.conf @@ -24,6 +24,9 @@ end <%- end -%> DocumentRoot <%= location %> + CustomLog <%= access_logfile %> combined + ErrorLog <%= error_logfile %> + <%- if enable_public_html -%> #TODO add the rest UserDir public_html -- cgit v1.2.1