[Zope] Logging client IPs to Z2.log

Oliver Hookins oliver.hookins at anchor.com.au
Wed Aug 16 10:43:20 EDT 2006


Quoting Jonathan <dev101 at magma.ca>:

> 
> ----- Original Message ----- 
> From: "Oliver Hookins" <oliver.hookins at anchor.com.au>
> To: <zope at zope.org>
> Sent: Wednesday, August 16, 2006 10:26 AM
> Subject: [Zope] Logging client IPs to Z2.log
> 
> 
> > Hi there,
> >
> > First up:
> > Python 2.4.2
> > Zope 2.9.4
> >
> > I'm a relative Zope newbie so please forgive my ignorance but I have not 
> > been
> > able to find an answer anywhere else. AFAIK there are a couple of options
> 
> > for
> > running Zope behind Apache - PCGI/FCGI or mod_proxy. It seems PCGI/FCGI
> is
> > deprecated in later versions and mod_proxy is recommended.
> >
> > However, when running Zope behind mod_proxy all of the requests to Zope
> > naturally come from the webserver (in this case running on the same 
> > machine)
> > hence all entries in Z2.log are prefixed by a client address of
> 127.0.0.1.
> >
> > I have the following options turned on:
> > trusted-proxy 127.0.0.1  (in zope/etc/zope.conf)
> >
> > ProxyPass / http://127.0.0.1:8080/
> > ProxyPassReverse / http://127.0.0.1:8080/
> > ProxyPreserveHost On
> > ProxyVia On
> > (in the vhost config in apache)
> >
> > The trusted-proxy parameter seems to related to the X-Forwarded-For header
> 
> > which
> > doesn't appear to be dealt with by Apache. It would seem that neither 
> > Apache nor
> > Zope can communicate the client's IP by the methods I have used, as Z2.log
> 
> > still
> > contains 127.0.0.1 for every request.
> >
> > So... is it at all possible to log the real client IPs in Z2.log using
> > mod_proxy? If not what is going to happen when (and if) PCGI/FCGI support
> 
> > is
> > removed?
> 
> It may be that you need to reconfigure apache, have a look at the apache 
> docs:
> 
> http://httpd.apache.org/docs/2.0/mod/mod_proxy.html

What do you mean by reconfigure? If the directives I have used weren't supported
then httpd would have complained on restart. This is clearly not the problem.

Surely I'm not the only one who has run into this issue, or is everyone else
steadfastly sticking to ZServer or PCGI/FCGI?

-- 
Regards,
Oliver


More information about the Zope mailing list