Bug 493070 - mod_log_config: format options for %p (locale, remote) broken
Summary: mod_log_config: format options for %p (locale, remote) broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: httpd
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Joe Orton
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-31 14:42 UTC by Roland Friedwagner
Modified: 2010-07-26 08:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 11:50:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1380 0 normal SHIPPED_LIVE httpd bug fix update 2009-09-01 11:48:49 UTC

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


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