/ Zope / Apsis / Pound Mailing List / Archive / 2006 / 2006-05 / Logging IP addresses in apache logs

[ << ] [ >> ]

[ HOWTO convert pound logs to apache logs for ... ] [ What does "error copy chunk" means? / ... ]

Logging IP addresses in apache logs
"Tim Smith" <smith.timsmith(at)gmail.com>
2006-05-11 23:41:25 [ FULL ]
Using Pound causes the proxy IP address to show up in the apache logs.  This
is understandable since Pound is the proxy.

What I would like to do is to configure Pound to pass the client IP address
through the HTTP header.  Then I can configure Apache to include that header
in the log file.  The goal is to simplify debugging of the proxied
applications.  Is there a way to do this?

Also, it would be VERY helpful if the Pound manpage was kept on the Pound
website.


Regards,
Tim
Attachments:  
text.html text/html 533 Bytes

Re: [Pound Mailing List] Logging IP addresses in apache logs
Tobias Brox <tobias(at)nordicbet.com>
2006-05-11 23:45:35 [ FULL ]
Maybe we should share our pound-patch?

[Tim Smith - Thu at 04:41:25PM -0500][...]
[...]

Re: [Pound Mailing List] Logging IP addresses in apache logs
Tobias Brox <tobias(at)nordicbet.com>
2006-05-11 23:48:12 [ FULL ]
Oups, this one was not ment to be Cc'ed the list ;-)

We have had the same problem, our backend need to track the real IP address
of the client, so we've patched up pound to pass this address to the
backend.  Since I didn't write this up myself, I'm a bit uncertain how it
works, though.

[Tobias Brox - Thu at 11:45:35PM +0200][...]
[...]

Re: [Pound Mailing List] Logging IP addresses in apache logs
Jacques Caron <jc(at)oxado.com>
2006-05-12 01:32:24 [ FULL ]
Hi,

The IP is already passed to the server via a standard HTTP header. 
You just need Apache to use it when appropriate. The following module 
will do that for you:

http://web.warhound.org/mod_extract_forwarded/

Or, on a FreeBSD box, cd /usr/ports/www/mod_extract_forwarded; make install

Jacques.

At 23:41 11/05/2006, Tim Smith wrote:[...]

Re: [Pound Mailing List] Logging IP addresses in apache logs
"Tim Smith" <smith.timsmith(at)gmail.com>
2006-05-12 04:49:44 [ FULL ]
I shouldn't even need an apache mod since using %{X-Forwarded-For}i in
Apache's LogFormat directive should give me what I want.

Log format reference:
http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats

Excellent information.  Thanks Jacques!

On 5/11/06, Jacques Caron <jc(at)oxado.com> wrote:[...]
Attachments:  
text.html text/html 2542 Bytes

Re: [Pound Mailing List] Logging IP addresses in apache logs
Jacques Caron <jc(at)oxado.com>
2006-05-12 10:23:17 [ FULL ]
Hi,

The advantage with mod_extract_forwarded is that it changes the 
remote address as seen (and logged) by Apache, but also by CGI & 
mod_perl programs (and probably PHP and any other modules). Likewise, 
any IP address filtering in Apache will also use the "right" IP 
address rather than the one of the proxy.

Jacques.

At 04:49 12/05/2006, Tim Smith wrote:[...][...][...]

MailBoxer