Bug 493070 - mod_log_config: format options for %p (locale, remote) broken
mod_log_config: format options for %p (locale, remote) broken
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: httpd (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Joe Orton
BaseOS QE
: FutureFeature
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2009-09-02 07:50:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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
     
     Listen 127.1.2.3:8765
   --%<--

2. Start server: /usr/sbin/httpd -f /tmp/foo/foo-httpd.conf -k start
3. Request document: wget http://127.1.2.3:8765/
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,
Roland
Comment 1 Roland Friedwagner 2009-03-31 10:46:29 EDT
BTW:
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.

http://rhn.redhat.com/errata/RHBA-2009-1380.html

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