From e20189e94a72b6e634f370c4d6cfea30a38ee995 Mon Sep 17 00:00:00 2001 From: Alexander Weidinger Date: Fri, 5 Jan 2018 00:59:57 +0100 Subject: [PATCH 1/2] Revert "Fix CustomLog default values in templates" This reverts commit 429039819def9f2738fb5a39b2d420345019693b. --- apache/vhosts/minimal.tmpl | 3 +-- apache/vhosts/proxy.tmpl | 3 +-- apache/vhosts/redirect.tmpl | 3 +-- apache/vhosts/standard.tmpl | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apache/vhosts/minimal.tmpl b/apache/vhosts/minimal.tmpl index b7372f1..98fab2f 100644 --- a/apache/vhosts/minimal.tmpl +++ b/apache/vhosts/minimal.tmpl @@ -12,9 +12,8 @@ 'LogLevel': site.get('LogLevel', 'warn'), 'ErrorLog': site.get('ErrorLog', '{0}/{1}-error.log'.format(map.logdir, sitename)), - 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log {1}'.format(map.logdir, sitename)), + 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)), 'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s %b"'), - 'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s %b" {0}'.format(sitename)), 'DocumentRoot': site.get('DocumentRoot', '{0}/{1}'.format(map.wwwdir, sitename)) diff --git a/apache/vhosts/proxy.tmpl b/apache/vhosts/proxy.tmpl index f6b79b2..af791a1 100644 --- a/apache/vhosts/proxy.tmpl +++ b/apache/vhosts/proxy.tmpl @@ -15,8 +15,7 @@ 'LogLevel': site.get('LogLevel', 'warn'), 'ErrorLog': site.get('ErrorLog', '{0}/{1}-error.log'.format(map.logdir, sitename)), 'LogFormat': site.get('LogFormat', '"%a %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\""'), - 'LogFormat': site.get('LogFormat', '"%a %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\"" {0}'.format(sitename)), - 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log {1}'.format(map.logdir, sitename)), + 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)), 'ProxyRequests': site.get('ProxyRequests', 'Off'), 'ProxyPreserveHost': site.get('ProxyPreserveHost', 'On'), diff --git a/apache/vhosts/redirect.tmpl b/apache/vhosts/redirect.tmpl index d207793..024cf36 100644 --- a/apache/vhosts/redirect.tmpl +++ b/apache/vhosts/redirect.tmpl @@ -16,8 +16,7 @@ 'LogLevel': site.get('LogLevel', 'warn'), 'ErrorLog': site.get('ErrorLog', '{0}/{1}-error.log'.format(map.logdir, sitename)), 'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s %O"'), - 'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s %O" {0}'.format(sitename)), - 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log {1}'.format(map.logdir, sitename)), + 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)), 'RedirectSource': site.get('RedirectSource', '/'), 'RedirectTarget': site.get('RedirectTarget', 'https://{0}/'.format(sitename)), diff --git a/apache/vhosts/standard.tmpl b/apache/vhosts/standard.tmpl index 880721f..d37c796 100644 --- a/apache/vhosts/standard.tmpl +++ b/apache/vhosts/standard.tmpl @@ -17,8 +17,7 @@ 'LogLevel': site.get('LogLevel', 'warn'), 'ErrorLog': site.get('ErrorLog', '{0}/{1}-error.log'.format(map.logdir, sitename)), 'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s"'), - 'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s" {0}'.format(sitename)), - 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log {1}'.format(map.logdir, sitename)), + 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)), 'DocumentRoot': site.get('DocumentRoot', '{0}/{1}'.format(map.wwwdir, sitename)), 'VirtualDocumentRoot': site.get('VirtualDocumentRoot'), From 08a21edb7301d2361d27614cec9305e79922251f Mon Sep 17 00:00:00 2001 From: Alexander Weidinger Date: Fri, 5 Jan 2018 01:30:42 +0100 Subject: [PATCH 2/2] Actually fix CustomLog default values in templates --- apache/vhosts/minimal.tmpl | 4 +++- apache/vhosts/proxy.tmpl | 4 +++- apache/vhosts/redirect.tmpl | 4 +++- apache/vhosts/standard.tmpl | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apache/vhosts/minimal.tmpl b/apache/vhosts/minimal.tmpl index 98fab2f..38545cb 100644 --- a/apache/vhosts/minimal.tmpl +++ b/apache/vhosts/minimal.tmpl @@ -28,5 +28,7 @@ {% if site.get('LogLevel') != False -%}LogLevel {{ vals.LogLevel }}{% endif %} {% if site.get('ErrorLog') != False -%}ErrorLog {{ vals.ErrorLog }}{% endif %} - {% if site.get('CustomLog') != False -%}CustomLog {{ vals.CustomLog }} {{ vals.LogFormat }}{% endif %} + {% if site.get('LogFormat') != False -%}LogFormat {{ vals.LogFormat }}{% endif %} + {% if site.get('CustomLog') != False -%}LogFormat {{ vals.LogFormat }} {{ sitename }} + CustomLog {{ vals.CustomLog }} {{ sitename }}{% endif %} diff --git a/apache/vhosts/proxy.tmpl b/apache/vhosts/proxy.tmpl index af791a1..b762a9e 100644 --- a/apache/vhosts/proxy.tmpl +++ b/apache/vhosts/proxy.tmpl @@ -40,7 +40,9 @@ {% if site.get('LogLevel') != False %}LogLevel {{ vals.LogLevel }}{% endif %} {% if site.get('ErrorLog') != False %}ErrorLog {{ vals.ErrorLog }}{% endif %} - {% if site.get('CustomLog') != False %}CustomLog {{ vals.CustomLog }} {{ vals.LogFormat }}{% endif %} + {% if site.get('LogFormat') != False -%}LogFormat {{ vals.LogFormat }}{% endif %} + {% if site.get('CustomLog') != False -%}LogFormat {{ vals.LogFormat }} {{ sitename }} + CustomLog {{ vals.CustomLog }} {{ sitename }}{% endif %} {% if site.get('SSLCertificateFile') %}SSLEngine on SSLCertificateFile {{ site.SSLCertificateFile }} diff --git a/apache/vhosts/redirect.tmpl b/apache/vhosts/redirect.tmpl index 024cf36..af86ea1 100644 --- a/apache/vhosts/redirect.tmpl +++ b/apache/vhosts/redirect.tmpl @@ -32,7 +32,9 @@ {% if site.get('LogLevel') != False %}LogLevel {{ vals.LogLevel }}{% endif %} {% if site.get('ErrorLog') != False %}ErrorLog {{ vals.ErrorLog }}{% endif %} - {% if site.get('CustomLog') != False %}CustomLog {{ vals.CustomLog }} {{ vals.LogFormat }}{% endif %} + {% if site.get('LogFormat') != False -%}LogFormat {{ vals.LogFormat }}{% endif %} + {% if site.get('CustomLog') != False -%}LogFormat {{ vals.LogFormat }} {{ sitename }} + CustomLog {{ vals.CustomLog }} {{ sitename }}{% endif %} Redirect {{ vals.RedirectSource }} {{ vals.RedirectTarget }} diff --git a/apache/vhosts/standard.tmpl b/apache/vhosts/standard.tmpl index d37c796..30684b0 100644 --- a/apache/vhosts/standard.tmpl +++ b/apache/vhosts/standard.tmpl @@ -53,7 +53,8 @@ {% if site.get('LogLevel') != False -%}LogLevel {{ vals.LogLevel }}{% endif %} {% if site.get('ErrorLog') != False -%}ErrorLog {{ vals.ErrorLog }}{% endif %} {% if site.get('LogFormat') != False -%}LogFormat {{ vals.LogFormat }}{% endif %} - {% if site.get('CustomLog') != False -%}CustomLog {{ vals.CustomLog }} {% endif %} + {% if site.get('CustomLog') != False -%}LogFormat {{ vals.LogFormat }} {{ sitename }} + CustomLog {{ vals.CustomLog }} {{ sitename }}{% endif %} {% if site.get('DocumentRoot') != False -%}DocumentRoot {{ vals.DocumentRoot }}{% endif %} {% if site.get('VirtualDocumentRoot') -%}VirtualDocumentRoot {{ vals.VirtualDocumentRoot }}{% endif %}