REMOTE_ADDR unavailable when using Virtual host
Hi, I am using a Zope installation on a windows 200 server behind an Apache 2. Accessing the site trough ZMI i get the correct REQUEST.REMOTE_ADDR. When I do the same in a product, request.REMOTE_ADDR contains the server IP address. How can I get to the original client ip address? I tried to set ProxyVia on in the Apache config file. However REQUEST.HTTP_VIA remains empty. Any hints are much appreciated. mit freundlichen Grüssen Robert Rottermann www.redCOR.ch
robert wrote at 2003-6-1 15:32 +0200:
I am using a Zope installation on a windows 200 server behind an Apache 2.
Accessing the site trough ZMI i get the correct REQUEST.REMOTE_ADDR.
When I do the same in a product, request.REMOTE_ADDR contains the server IP address.
On my Zope page, you will find a VHM patch that allows Apache to pass in the correct remote addr. <http://www.dieter.handshake.de/pyprojects/zope> Dieter
Good morning Dieter, thanks for your tip. I had tried your patch allredy. However it did not work. Somehow the condition + if stack and stack[-1] == 'VirtualHostRemoteAddr': was never true (I checked by having the stack printed). My solution is patching ZServer/HTTPServer.py to add "REMOTE_ADDR_X" to its list of variables which I then check. This works but seems ugly and akward. Robert Am Sonntag, 1. Juni 2003 22:53 schrieb Dieter Maurer:
robert wrote at 2003-6-1 15:32 +0200:
I am using a Zope installation on a windows 200 server behind an Apache 2.
Accessing the site trough ZMI i get the correct REQUEST.REMOTE_ADDR.
When I do the same in a product, request.REMOTE_ADDR contains the server IP address.
On my Zope page, you will find a VHM patch that allows Apache to pass in the correct remote addr.
<http://www.dieter.handshake.de/pyprojects/zope>
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- mit freundlichen Grüssen Robert Rottermann www.redCOR.ch
robert wrote at 2003-6-2 07:02 +0200:
I had tried your patch allredy. However it did not work. Somehow the condition + if stack and stack[-1] == 'VirtualHostRemoteAddr': was never true (I checked by having the stack printed).
You must use it in your Apache RewriteRule: .../VirtualHostBase/http/domain/VirtualHostRemoteAddr/%{REMOTE_ADDR}/... Dieter
Dieter Maurer wrote:
robert wrote at 2003-6-2 07:02 +0200:
I had tried your patch allredy. However it did not work. Somehow the condition + if stack and stack[-1] == 'VirtualHostRemoteAddr': was never true (I checked by having the stack printed).
You must use it in your Apache RewriteRule:
.../VirtualHostBase/http/domain/VirtualHostRemoteAddr/%{REMOTE_ADDR}/...
The traversal stack must not be used as a vehicle for trusted information. -- Jamie Heilman http://audible.transient.net/~jamie/ "We must be born with an intuition of mortality. Before we know the words for it, before we know there are words, out we come bloodied and squalling with the knowledge that for all the compasses in the world, there's only one direction, and time is its only measure." -Rosencrantz
On Sunday 01 June 2003 14:32, robert wrote:
Hi, I am using a Zope installation on a windows 200 server behind an Apache 2.
Accessing the site trough ZMI i get the correct REQUEST.REMOTE_ADDR.
When I do the same in a product, request.REMOTE_ADDR contains the server IP address.
How can I get to the original client ip address? I tried to set ProxyVia on in the Apache config file. However REQUEST.HTTP_VIA remains empty.
Any hints are much appreciated.
In Zope 2.7 or the cvs trunk, REQUEST.getClientAddr() That change is in the CVS branch toby-http-forwarded-for-branch, and merges cleanly with zope 2.6.x -- Toby Dickenson http://www.geminidataloggers.com/people/tdickenson
have you tried REQUEST.HTTP_X_FORWARDED_FOR robert wrote:
Hi, I am using a Zope installation on a windows 200 server behind an Apache 2.
Accessing the site trough ZMI i get the correct REQUEST.REMOTE_ADDR.
When I do the same in a product, request.REMOTE_ADDR contains the server IP address.
How can I get to the original client ip address? I tried to set ProxyVia on in the Apache config file. However REQUEST.HTTP_VIA remains empty.
Any hints are much appreciated.
mit freundlichen Grüssen
Robert Rottermann www.redCOR.ch
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- " No man's life, liberty or fortune is safe while our legislature is in session." --Benjamin Franklin Jason Bush | (402) 471-6517 | jason@nol.org | http://www.nol.org
participants (5)
-
Dieter Maurer -
Jamie Heilman -
Jason Bush -
robert -
Toby Dickenson