[packages/apache/remoteip-logformat] add remoteip client ip configuration

glen glen at pld-linux.org
Wed Jan 23 12:08:51 CET 2019


commit 36da21514a98282f91c4c4f9ec244ea2e22f4cde
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Oct 23 12:15:07 2018 +0300

    add remoteip client ip configuration

 apache-httpd.conf          | 2 +-
 apache-mod_log_config.conf | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/apache-httpd.conf b/apache-httpd.conf
index 31ff912..7c51044 100644
--- a/apache-httpd.conf
+++ b/apache-httpd.conf
@@ -52,7 +52,7 @@ ErrorLog logs/error_log
 # https://httpd.apache.org/docs/2.4/mod/core.html#errorlogformat
 # There is no default value, Apache uses different built in function if
 # ErrorLogFormat is not defined.
-#ErrorLogFormat "[%{u}t] [%m:%l] [pid\ %P] [client\ %a] [vhost\ %v] %M"
+ErrorLogFormat "[%{u}t] [%m:%l] [pid\ %P] [client\ %a] [vhost\ %v] %M"
 
 # LogLevel: Control the number of messages logged to the error_log.
 # Possible values include: debug, info, notice, warn, error, crit,
diff --git a/apache-mod_log_config.conf b/apache-mod_log_config.conf
index 298a5d4..d49105f 100644
--- a/apache-mod_log_config.conf
+++ b/apache-mod_log_config.conf
@@ -17,12 +17,17 @@ LoadModule log_config_module modules/mod_log_config.so
 	LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
 	LogFormat "%h %l %u %t \"%r\" %>s %b" common
 
+	<IfModule remoteip_module>
+		# override with %a
+		LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+		LogFormat "%a %l %u %t \"%r\" %>s %b" common
+	</IfModule>
+
 	<IfModule logio_module>
 		# 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\" %I %O" combinedio
 	</IfModule>
 
-	#
 	# The location and format of the access logfile (Common Logfile Format).
 	# If you do not define any access logfiles within a <VirtualHost>
 	# container, they will be logged here.  Contrariwise, if you *do*
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apache.git/commitdiff/36da21514a98282f91c4c4f9ec244ea2e22f4cde



More information about the pld-cvs-commit mailing list