Hi, On my Plone site, in CookieCrumbler.py, VIRTUAL_URL is not found in the request variable even though I have a Virtual Host Monster. This means that when logging in, the "came_from" URL that my site directs to becomes something ugly like http://my.domain.org/VirtualHostBase/http/my.domain.org:80/contentPages This doesn't seem to be an Apache rewriting issue. Should VIRTUAL_URL be found in the request variable and giving the right URL (http://my.domain.org/contentPages), and why isn't it showing up? Peace, George
George Lee wrote:
On my Plone site, in CookieCrumbler.py, VIRTUAL_URL is not found in the request variable even though I have a Virtual Host Monster. This means that when logging in, the "came_from" URL that my site directs to becomes something ugly like
What version of Zope are you using? Why do you think VIRTUAL_URL should be there? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Zope 2.8.1 In Plone 2.1.1, when I try to access a page Anonymous does not have permission to see, it redirects to a login. While doing so, it sets a came_from variable with the URL I'm trying to access. It sets an ugly http://my.domain.org/VirtualHostBase/http/my.domain.org:80/contentPages which does not work. Plone folks suspected this was a Zope problem. When Plone sets the came_from, it draws on the REQUEST variable. It first looks to see if there is a VIRTUAL_URL in the REQUEST variable, but it doesn't find one. I'm wondering if CookieCrumbler is supposed to set VIRTUAL_URL given that there's a VHM installed and doesn't? Peace, George Peace, George On 11/8/05, Chris Withers <chris@simplistix.co.uk> wrote:
George Lee wrote:
On my Plone site, in CookieCrumbler.py, VIRTUAL_URL is not found in the request variable even though I have a Virtual Host Monster. This means that when logging in, the "came_from" URL that my site directs to becomes something ugly like
What version of Zope are you using?
Why do you think VIRTUAL_URL should be there?
cheers,
Chris
-- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
George Lee wrote:
http://my.domain.org/VirtualHostBase/http/my.domain.org:80/contentPages
which does not work. Plone folks suspected this was a Zope problem.
Oh really? ;-)
When Plone sets the came_from, it draws on the REQUEST variable. It first looks to see if there is a VIRTUAL_URL in the REQUEST variable, but it doesn't find one.
Well, where is VIRTUAL_URL documented? Why doesn't Plohn do something sane if it's not there?
I'm wondering if CookieCrumbler is supposed to set VIRTUAL_URL given that there's a VHM installed and doesn't?
It's probably some code in the publisher or vhm. Maybe it's something that didn't get merged from a branch or the trunk. Your best bet is to come up with minimal (ie: no plone, no cookie crumbler, etc) way to reproduce this and file a bug report in the collector. Oh, and grab yourself a copy of grep and see where this should be defined ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Two main questions: (1) Does anybody *have* good documentation on VIRTUAL_URL and how it interacts with CookieCrumbler and VirtualHostMonster? (2) Does anyone know how to debug VirtualHostMonster or other Python libraries while running a Zope instance (it lives in Python not in Zope, so I don't know if I change the code there if those changes will actually get executed)? For people who care to read more about what I think is going on:
Well, where is VIRTUAL_URL documented? Why doesn't Plohn do something sane if it's not there?
It's not Plone's issue from what I can tell. CookieCrumbler, which lives in CMF, does do something sane if VIRTUAL_URL is not there -- it tries to create a substitute URL. VIRTUAL_URL is set by the VirtualHostMonster. Does anyone know how to debug it? Because it is in the python directories used to build Zope, not in a Zope product which I know how to debug. (Is there a way to restart python to register changes in VirtualHostMonster.py)? Here is what I can tell of what is going on: (1) VIRTUAL_URL is supposed to return the actual URL when there is a Virtual Hosting Monster, for instance http://subdomain.mydomain.org instead of http://ip:port/path/to/subdomain/object or http://mydomain.org/path/to/subdomain/object. (2) There's an Apache rewrite rule set to transform URL requests like http://subdomain.org to http://ip:port/VirtualHostBase/http/subdomain.mydomain.org before they get sent into Zope. (3) When VirtualHostMonster receives a request like http://ip:port/VirtualHostBase/http/subdomain.mydomain.org, it is supposed to return the currect object at http://ip:port/path/to/subdomain/object and set a variable VIRTUAL_URL http://subdomain.mydomain.org in the REQUEST variable. (4) When navigating to an authenticated-only page, CMFCore's CookieCrumbler sets a "came_from" variable to remember where to go. To set the "came_from" variable, it first looks for VIRTUAL_URL. If it doesn't find it, it uses another method to set "came_from" -- but this returns an URL, and one that does not work. (5) During login in Plone to a authenticated-only page, it uses CMFCore's CookieCrumbler came_from variable.
I'm wondering if CookieCrumbler is supposed to set VIRTUAL_URL given that there's a VHM installed and doesn't?
It's probably some code in the publisher or vhm. Maybe it's something that didn't get merged from a branch or the trunk.
Your best bet is to come up with minimal (ie: no plone, no cookie crumbler, etc) way to reproduce this and file a bug report in the collector.
Oh, and grab yourself a copy of grep and see where this should be defined ;-)
cheers,
Chris
-- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
(2) Does anyone know how to debug VirtualHostMonster or other Python libraries while running a Zope instance (it lives in Python not in Zope, so I don't know if I change the code there if those changes will actually get executed)?
Oh wait it is in a Zope product, scratch that. Peace, George
The correct thing to use in a recent Zope is REQUEST['ACTUAL_URL']. Florent George Lee wrote:
Two main questions: (1) Does anybody *have* good documentation on VIRTUAL_URL and how it interacts with CookieCrumbler and VirtualHostMonster? (2) Does anyone know how to debug VirtualHostMonster or other Python libraries while running a Zope instance (it lives in Python not in Zope, so I don't know if I change the code there if those changes will actually get executed)?
For people who care to read more about what I think is going on:
Well, where is VIRTUAL_URL documented? Why doesn't Plohn do something sane if it's not there?
It's not Plone's issue from what I can tell. CookieCrumbler, which lives in CMF, does do something sane if VIRTUAL_URL is not there -- it tries to create a substitute URL.
VIRTUAL_URL is set by the VirtualHostMonster. Does anyone know how to debug it? Because it is in the python directories used to build Zope, not in a Zope product which I know how to debug. (Is there a way to restart python to register changes in VirtualHostMonster.py)?
Here is what I can tell of what is going on:
(1) VIRTUAL_URL is supposed to return the actual URL when there is a Virtual Hosting Monster, for instance http://subdomain.mydomain.org instead of http://ip:port/path/to/subdomain/object or http://mydomain.org/path/to/subdomain/object.
(2) There's an Apache rewrite rule set to transform URL requests like http://subdomain.org to http://ip:port/VirtualHostBase/http/subdomain.mydomain.org before they get sent into Zope.
(3) When VirtualHostMonster receives a request like http://ip:port/VirtualHostBase/http/subdomain.mydomain.org, it is supposed to return the currect object at http://ip:port/path/to/subdomain/object and set a variable VIRTUAL_URL http://subdomain.mydomain.org in the REQUEST variable.
(4) When navigating to an authenticated-only page, CMFCore's CookieCrumbler sets a "came_from" variable to remember where to go. To set the "came_from" variable, it first looks for VIRTUAL_URL. If it doesn't find it, it uses another method to set "came_from" -- but this returns an URL, and one that does not work.
(5) During login in Plone to a authenticated-only page, it uses CMFCore's CookieCrumbler came_from variable.
I'm wondering if CookieCrumbler is supposed to set VIRTUAL_URL given that there's a VHM installed and doesn't?
It's probably some code in the publisher or vhm. Maybe it's something that didn't get merged from a branch or the trunk.
Your best bet is to come up with minimal (ie: no plone, no cookie crumbler, etc) way to reproduce this and file a bug report in the collector.
Oh, and grab yourself a copy of grep and see where this should be defined ;-)
cheers,
Chris
-- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
_______________________________________________ Zope maillist - Zope-CWUwpEBWKX0@public.gmane.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 )
-- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
The correct thing to use in a recent Zope is REQUEST['ACTUAL_URL'].
Florent
This gives something like http://ip:port/path/to/subdomain though rather than http://subdomain.mydomain.org ... what if anything gives the latter? Peace, George
George Lee wrote at 2005-11-9 11:21 -0500:
... "request['ACTUAL_PATH']" ... This gives something like http://ip:port/path/to/subdomain though rather than http://subdomain.mydomain.org ... what if anything gives the latter?
I fear you fight a CookieCrumbler bug. The most natural "REQUEST['URL']" will give the correct value (as it gives what the primary HHTP cleint sees). -- Dieter
I fear you fight a CookieCrumbler bug.
Vicious monsters, indeed. Thanks for the REQUEST['URL'] tip. It's a pretty good workaround for now, although not exactly right. If I am going to an object http://here.org/object with default page or default method "default", then REQUEST['URL'] equals http://here.org/object/default instead of http://here.org/object This works for purposes of redirecting after login but isn't exactly what should happen. From what I recall browsing a few ACTUAL_URL, etc. threads, this is one reason there's a difference between the few different URL variables. Also, I opened up a collector issue at http://www.zope.org/Collectors/CMF/393 Peace, George
The most natural "REQUEST['URL']" will give the correct value (as it gives what the primary HHTP cleint sees).
-- Dieter
participants (4)
-
Chris Withers -
Dieter Maurer -
Florent Guillaume -
George Lee