From 4798649130a58e39e34af4f1ba539391f663d1e9 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 17 Jan 2025 15:19:59 +0100 Subject: [PATCH] Configuring Apache --- .etckeeper | 1 + apache2/conf-available/custom-log.conf | 11 +++++++++++ apache2/conf-available/other-vhosts-access-log.conf | 4 +++- apache2/conf-enabled/custom-log.conf | 1 + apache2/mods-available/info.conf | 13 +++++++++++-- apache2/mods-available/status.conf | 13 +++++++++++-- 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 apache2/conf-available/custom-log.conf create mode 120000 apache2/conf-enabled/custom-log.conf diff --git a/.etckeeper b/.etckeeper index e2e81de..a8f261d 100755 --- a/.etckeeper +++ b/.etckeeper @@ -73,6 +73,7 @@ maybe chmod 0644 'apache2/apache2.conf' maybe chmod 0755 'apache2/conf-available' maybe chmod 0644 'apache2/conf-available/apache2-doc.conf' maybe chmod 0644 'apache2/conf-available/charset.conf' +maybe chmod 0644 'apache2/conf-available/custom-log.conf' maybe chmod 0644 'apache2/conf-available/javascript-common.conf' maybe chmod 0644 'apache2/conf-available/localized-error-pages.conf' maybe chmod 0644 'apache2/conf-available/other-vhosts-access-log.conf' diff --git a/apache2/conf-available/custom-log.conf b/apache2/conf-available/custom-log.conf new file mode 100644 index 0000000..bdf3893 --- /dev/null +++ b/apache2/conf-available/custom-log.conf @@ -0,0 +1,11 @@ +LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%T\" \"%v\" \"%f\"" full +LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" \"%T\" \"%v\" \"%f\"" full_combined + + + # You need to enable mod_logio.c to use %I and %O + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%T\" \"%v\" \"%f\" %I %O" full_io + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio + LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" vhostio + + +# vim: filetype=apache ts=4 sw=4 sts=4 sr noet diff --git a/apache2/conf-available/other-vhosts-access-log.conf b/apache2/conf-available/other-vhosts-access-log.conf index 9f7aecd..2b76f4a 100644 --- a/apache2/conf-available/other-vhosts-access-log.conf +++ b/apache2/conf-available/other-vhosts-access-log.conf @@ -1,2 +1,4 @@ # Define an access log for VirtualHosts that don't define their own logfile -CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined +CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log full_combined + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/apache2/conf-enabled/custom-log.conf b/apache2/conf-enabled/custom-log.conf new file mode 120000 index 0000000..bc5fa0f --- /dev/null +++ b/apache2/conf-enabled/custom-log.conf @@ -0,0 +1 @@ +../conf-available/custom-log.conf \ No newline at end of file diff --git a/apache2/mods-available/info.conf b/apache2/mods-available/info.conf index cf79351..5c04ca2 100644 --- a/apache2/mods-available/info.conf +++ b/apache2/mods-available/info.conf @@ -4,6 +4,15 @@ # SetHandler server-info - Require local - #Require ip 192.0.2.0/24 + AuthName "Server Status Access" + AuthType Basic + AuthBasicProvider file + AuthUserFile /etc/apache2/info_users_passwd + + Require local + Require valid-user + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/apache2/mods-available/status.conf b/apache2/mods-available/status.conf index cd7dd58..1f8ea74 100644 --- a/apache2/mods-available/status.conf +++ b/apache2/mods-available/status.conf @@ -4,8 +4,15 @@ SetHandler server-status - Require local - #Require ip 192.0.2.0/24 + AuthName "Server Status Access" + AuthType Basic + AuthBasicProvider file + AuthUserFile /etc/apache2/info_users_passwd + + Require local + Require valid-user + + # Keep track of extended status information for each request @@ -21,3 +28,5 @@ ExtendedStatus On # Show Proxy LoadBalancer status in mod_status ProxyStatus On + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet -- 2.39.5