Re: Apache error log problem

From: John Helliwell <john.helliwell#gmail.com>
Date: Thu, 7 Apr 2011 21:30:09 +0100


On 7 April 2011 19:44, Greg Connolly <greg#dmcontact.com> wrote:

> I’m having an issue getting the apache error logs to receive the client
> ip’s. the proxy ip is the only one showing up. I have the apache access log
> working using the forward-for but not the error logs. Can anyone shed most
> light in this issue? Here is the current configuration.
>
>
>
> Apache2.conf
>
>
>
> LogFormat "%v:%p %{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" vhost_combined
>
> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" combined
>
> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common
>
> LogFormat "%{Referer}i -> %U" referer
>
> LogFormat "%{User-agent}i" agent
>
>
>
> Haproxy.cfg
>
>
>
> listen Test01 10.1.8.52:80
>
> mode http
>
> maxconn 1000
>
> balance roundrobin
>
> cookie JSESSIONID prefix
>
> option httplog
>
> option httpclose
>
> option forwardfor except 10.0.0.0/16
>
> option httpchk HEAD /haproxy_check.txt HTTP/1.0
>
> stick-table type ip size 200k expire 18m
>
> stick on src
>
> server 10.1.109.52 10.1.109.52:80 weight 60 cookie B check
>
> server 10.1.108.52 10.1.108.52:80 weight 40 cookie A check
>
>
>
> Thanks Greg
>

Hi Greg,

Have you considered installing mod_rpaf into Apache? It effectively replaces the REMOTE_ADDR so that instead of containing the IP address of your proxy, it is replaced with the contents of your X-Forwarded-For header. In the Apache logs, the end-user's IP address is logged.

Regards

John.

-- 
John Helliwell
Received on 2011/04/07 22:30

This archive was generated by hypermail 2.2.0 : 2011/04/07 22:45 CEST