From cc66d0dc4bcf8f2687fe37529fb0673979a1f539 Mon Sep 17 00:00:00 2001 From: Simon L Date: Sun, 18 Jun 2023 01:04:42 +0200 Subject: [PATCH] fix and adjust mastercontainer apache logging Signed-off-by: Simon L --- Containers/mastercontainer/Dockerfile | 5 +++++ Containers/mastercontainer/mastercontainer.conf | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Containers/mastercontainer/Dockerfile b/Containers/mastercontainer/Dockerfile index 3fb5b914..82f94304 100644 --- a/Containers/mastercontainer/Dockerfile +++ b/Containers/mastercontainer/Dockerfile @@ -80,6 +80,8 @@ RUN set -ex; \ \ sed -i \ -e '/^Listen /d' \ + -e 's/^LogLevel .*/LogLevel error/' \ + -e 's|^ErrorLog .*|ErrorLog /proc/self/fd/2|' \ -e 's/User apache/User www-data/g' \ -e 's/Group apache/Group www-data/g' \ -e 's/^#\(LoadModule .*mod_rewrite.so\)/\1/' \ @@ -95,6 +97,9 @@ RUN set -ex; \ mkdir -p /etc/apache2/logs; \ rm /etc/apache2/conf.d/ssl.conf; \ echo "ServerName localhost" | tee -a /etc/apache2/httpd.conf; \ + grep -q '^LoadModule lbmethod_heartbeat_module' /etc/apache2/conf.d/proxy.conf; \ + sed -i 's|^LoadModule lbmethod_heartbeat_module.*|#LoadModule lbmethod_heartbeat_module|' /etc/apache2/conf.d/proxy.conf; \ + echo "SSLSessionCache nonenotnull" | tee -a /etc/apache2/httpd.conf; \ echo "LoadModule ssl_module modules/mod_ssl.so" | tee -a /etc/apache2/httpd.conf; \ echo "LoadModule socache_shmcb_module modules/mod_socache_shmcb.so" | tee -a /etc/apache2/httpd.conf; \ echo "Include /etc/apache2/sites-available/mastercontainer.conf" | tee -a /etc/apache2/httpd.conf; \ diff --git a/Containers/mastercontainer/mastercontainer.conf b/Containers/mastercontainer/mastercontainer.conf index e56bac19..701cb420 100644 --- a/Containers/mastercontainer/mastercontainer.conf +++ b/Containers/mastercontainer/mastercontainer.conf @@ -11,8 +11,11 @@ Listen 8080 ServerName localhost # Add error log - CustomLog /proc/self/fd/1 combined + CustomLog /proc/self/fd/1 proxy + LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy ErrorLog /proc/self/fd/2 + ErrorLogFormat "[%t] [%l] [%E] [client: %{X-Forwarded-For}i] [%M] [%{User-Agent}i]" + LogLevel warn # PHP match