Lp 1908540: Add example proxy log configuration for Apache user/dyrcona/lp1908540-apache-proxy-logformat
authorJason Stephenson <jason@sigio.com>
Thu, 17 Dec 2020 15:27:18 +0000 (10:27 -0500)
committerJason Stephenson <jason@sigio.com>
Thu, 28 Jan 2021 18:12:36 +0000 (13:12 -0500)
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 <jason@sigio.com>
Open-ILS/examples/apache_24/eg.conf.in
docs/RELEASE_NOTES_NEXT/Administration/apache-proxy-logformat.adoc [new file with mode: 0644]

index 0733794..b0892ae 100644 (file)
@@ -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 (file)
index 0000000..4d8100b
--- /dev/null
@@ -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.