Bug 493070

Summary: mod_log_config: format options for %p (locale, remote) broken
Product: Red Hat Enterprise Linux 5 Reporter: Roland Friedwagner <roland.friedwagner>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: asersen, ohudlick, roland.friedwagner
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 11:50:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Roland Friedwagner 2009-03-31 14:42:14 UTC
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>, 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 14:46:29 UTC
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 15:33:05 UTC
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 11:50:56 UTC
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