From c17601ee42cc4aa0222ec60e8ec3176d902b32f1 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Tue, 13 Oct 2020 23:56:20 +0200 Subject: [PATCH 1/4] fix(debian): fix default moddir on debian --- apache/osfamilymap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apache/osfamilymap.yaml b/apache/osfamilymap.yaml index 779f055..42497d6 100644 --- a/apache/osfamilymap.yaml +++ b/apache/osfamilymap.yaml @@ -47,7 +47,7 @@ Debian: logdir: /var/log/apache2 logrotatedir: /etc/logrotate.d/apache2 wwwdir: /srv - moddir: /etc/apache2/mods-available + moddir: /etc/apache2/mods-enabled sitesdir: /etc/apache2/sites-enabled RedHat: From 5844322de46b82cad6beedd2b99c8808df8f2485 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Wed, 14 Oct 2020 00:09:21 +0200 Subject: [PATCH 2/4] fix(debian): don't execute a2enmod on every run --- apache/config/modules/install.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apache/config/modules/install.sls b/apache/config/modules/install.sls index a3a6734..9cc5273 100644 --- a/apache/config/modules/install.sls +++ b/apache/config/modules/install.sls @@ -18,7 +18,7 @@ apache-config-modules-{{ module }}-enable: cmd.run: - name: a2enmod -f {{ module }} - - onlyif: ls {{ apache.moddir }}/{{ module }}.load + - unless: ls {{ apache.moddir }}/{{ module }}.load {% elif grains.os_family in ('RedHat', 'Arch') %} From 47ec5fcc343ea889898e2418cd7c03a4a75c8f87 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Wed, 14 Oct 2020 01:55:01 +0200 Subject: [PATCH 3/4] test(pillar): remove modules that aren't installed from being enabled --- test/salt/pillar/modules.sls | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/salt/pillar/modules.sls b/test/salt/pillar/modules.sls index c265866..1a1b41d 100644 --- a/test/salt/pillar/modules.sls +++ b/test/salt/pillar/modules.sls @@ -377,7 +377,6 @@ apache: modules: enabled: # List modules to enable - ssl - - prefork - rewrite - proxy - proxy_ajp @@ -385,7 +384,6 @@ apache: - headers # geoip - status - - logio - dav - dav_fs - dav_lock From 2b52e11a8a91b0837a442bac816e7383dbe6fb13 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Wed, 14 Oct 2020 02:57:00 +0200 Subject: [PATCH 4/4] fix(vhosts): replace %O with %b in default LogFormat %O needs mod_logio, which isn't enabled by default everywhere, so it also shouldn't be used as default fallback LogFormat. --- apache/config/vhosts/proxy.tmpl | 2 +- apache/config/vhosts/redirect.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apache/config/vhosts/proxy.tmpl b/apache/config/vhosts/proxy.tmpl index 740f169..b9cc934 100644 --- a/apache/config/vhosts/proxy.tmpl +++ b/apache/config/vhosts/proxy.tmpl @@ -16,7 +16,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 %b \\"%{Referer}i\\" \\"%{User-Agent}i\\""'), 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)), 'ProxyRequests': site.get('ProxyRequests', 'Off'), diff --git a/apache/config/vhosts/redirect.tmpl b/apache/config/vhosts/redirect.tmpl index 8f91b1c..4ccbd3d 100644 --- a/apache/config/vhosts/redirect.tmpl +++ b/apache/config/vhosts/redirect.tmpl @@ -17,7 +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 %O"'), + 'LogFormat': site.get('LogFormat', '"%h %l %u %t \\\"%r\\\" %>s %b"'), 'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)), 'RedirectSource': site.get('RedirectSource', '/'),