From 38019ffd8a3dd79ddf5bafa0fa520a5c904a2d84 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Thu, 17 Dec 2020 10:27:18 -0500 Subject: [PATCH] Lp 1908540: Add example proxy log configuration for Apache Add comments in eg.conf.in example configuration to explain how to log remote IP addresses when using a proxy in front of Apache. Signed-off-by: Jason Stephenson --- Open-ILS/examples/apache_24/eg.conf.in | 8 +++++++ .../Administration/apache-proxy-logformat.adoc | 27 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/apache-proxy-logformat.adoc diff --git a/Open-ILS/examples/apache_24/eg.conf.in b/Open-ILS/examples/apache_24/eg.conf.in index 0733794e34..b0892ae9c3 100644 --- a/Open-ILS/examples/apache_24/eg.conf.in +++ b/Open-ILS/examples/apache_24/eg.conf.in @@ -1,5 +1,13 @@ # :vim set syntax apache +# The following custom log formats may be used to log remote client IP +# addresses when using a proxy (nginx or haproxy) in front of Apache +# for Evergreen with the RemoteIP module (mod_remoteip). In order to +# use this, change the last entry on the CustomLog lines below to use +# the desired LogFormat. +LogFormat "%a %l %u %t \"%r\" %>s %b" proxy-common +Logformat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" proxy-combined + LogLevel info # - log locally # CustomLog /var/log/apache2/access.log combined diff --git a/docs/RELEASE_NOTES_NEXT/Administration/apache-proxy-logformat.adoc b/docs/RELEASE_NOTES_NEXT/Administration/apache-proxy-logformat.adoc new file mode 100644 index 0000000000..4d8100b141 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/Administration/apache-proxy-logformat.adoc @@ -0,0 +1,27 @@ +Apache Proxy LogFormat Configuration +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Two `LogFormat` entries have been added to the sample Apache +configuration in `eg.conf.in` that are useful when a proxy runs in +front of Evergreen's Apache. These configurations mimic the default +"common" and "combined" log formats, but log the remote client's +actual IP address when `mod_remoteip` is enabled. The entries are +repeated here in case you prefer to manually update your Apache +configuration. + + LogFormat "%a %l %u %t \"%r\" %>s %b" proxy-common + Logformat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" proxy-combined + +To use these formats, simply replace the "common" or "combined" at the +end of the `CustomLog` entries in the `eg.conf` file with either the +"proxy-common" or "proxy-combined" entry, depending upon which you +want to use. + +From: + + CustomLog "|/usr/bin/logger -p local7.info" common + +to: + + CustomLog "|/usr/bin/logger -p local7.info" proxy-common + +for example. -- 2.11.0