Bug 493070 - mod_log_config: format options for %p (locale, remote) broken
mod_log_config: format options for %p (locale, remote) broken
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: httpd (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Joe Orton
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2009-03-31 10:42 EDT by Roland Friedwagner
Modified: 2010-07-26 04:51 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-02 07:50:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Roland Friedwagner 2009-03-31 10:42:14 EDT
Description of problem:
Wrong remote (local) port number on logging of the requests.

Steps to Reproduce:
1. Create minimal server config:
     ServerRoot "/tmp/foo"
     DocumentRoot "/tmp/foo"
     PidFile /tmp/foo/foo-httpd.pid
     LoadModule log_config_module /usr/lib/httpd/modules/mod_log_config.so
     User nobody
     Group nobody
     ErrorLog  foo-error_log
     LogFormat "localport:%{local}p remoteport:%{remote}p" testformat
     CustomLog foo-access_log testformat

2. Start server: /usr/sbin/httpd -f /tmp/foo/foo-httpd.conf -k start
3. Request document: wget
4. Lookup access log foo-access_log
Actual results:
localport:80 remoteport:80

Expected results:
localport:8765 remoteport:xxxx

Additional info:
seem to be fixed upstream in 2.2.9 apache httpd
  *) mod_log_config: Add format options for %p so that the actual local
     or remote port can be logged.  PR 43415.  [Adam Hasselbalch Hansen
     <ahh@one.com>, Ruediger Pluem, Jeff Trawick]

Please Upgrade httpd package or do a backport of this fix.

Kind Regrads,
Comment 1 Roland Friedwagner 2009-03-31 10:46:29 EDT
Because logging remote port in like this (old style):
  LogFormat "%{REMOTE_PORT}e" testformat
is always empty (-),
I can not see any possibility to log the source port of requests?
Comment 2 Joe Orton 2009-03-31 11:33:05 EDT
Adding the format options is very simple; thanks for the request.

I don't think that REMOTE_PORT would be set in the environment unless a CGI/SSI script is being executed; so without %{remote}p support, no, there probably isn't any easy way.
Comment 7 errata-xmlrpc 2009-09-02 07:50:56 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.