tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: access log and Apache server
Date Thu, 17 Sep 2009 14:05:16 GMT
On 17.09.2009 15:26, Tim Funk wrote:
> There is no way.
> 
> But you can alter the format property to log the Via header which does
> have the ip address. (But it will also have more text in it too)

The X-Forwarded-For request header should do it. mod_proxy sets it. If
you use mod_proxy_ajp, then everything is automatic, because ajp patches
the request data according to the original client:

http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html

> The javadocs for AccessLogValve have all the variables you can use.

Or:

http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access%20Log%20Valve

Regards,

Rainer

> Angelo Chen wrote:
>> Hi,
>> I run tomcat behind an Apache server, Apache will proxy to tomcat from
>> port
>> 80, this works quite well, but the access log in tomcat shows only
>> 127.0.0.1, not the real IP:
>>
>> 127.0.0.1 - - [17/Sep/2009:08:51:21 -0400] "POST /sendmsg HTTP/1.1" 302 -
>>
>> any idea how to have real IP in the log?
>>
>> Thanks,

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message