what defines the absolute_url() prefix?
G'day, I'm having a blast using (technically: playing with :-) Zope 2.1.4 on a RedHat 6.1 box, and mod_pcgi2 (1.0.1). For my first efforts, I've built a set of DTML methods which emulates www.python.org's style of website, with an index_html method that "includes" Banner, Sidebar, Body etc methods, which can be over-ridden in lower-down folders. All funky stuff, works well. In the Sidebar, I have links to folders within the site using absolute_url() (because of issues with BASE HREF giving me multiple folder syndrome). I can access the folder with the URL http://localhost/cws/Help (and the logfile shows "GET /cws/Help"), but the absolute_url() method on cws.Help is actually returning "http://localhost/cws/cws/Help" (which is also accessible - kinda odd, but not what I want). I kinda suspect I've screwed the mod_pcgi2 config, mainly because its the area I'm the most confused about :-) I have the following config in Apache: <Location /zope> SetHandler pcgi-handler PCGI_ROOT / PCGI_SetEnv SiteRootPATH / </Location> <Location /cws> SetHandler pcgi-handler PCGI_ROOT /cws PCGI_SetEnv SiteRootPATH /cws </Location> (Oh, and I've just added a <dtml-var REQUEST> to the Help page, and it's returning URL http://localhost/cws/cws/Help/index_html for accesses to http://localhost/cws/Help, so it's awfully consistent in its behaviour. How does zope determine what the prefix is, and better yet, how do I fix it to mesh with reality? Regards, Daryl Tester
On Thu, 9 Mar 2000, Daryl Tester wrote:
I can access the folder with the URL http://localhost/cws/Help (and the logfile shows "GET /cws/Help"), but the absolute_url() method on cws.Help is actually returning "http://localhost/cws/cws/Help" (which is also accessible - kinda odd, but not what I want).
You can even access http://localhost/cws/cws/cws/cws/cws/cws/Help :) It is aquisition's drawback...
I kinda suspect I've screwed the mod_pcgi2 config, mainly because its the area I'm the most confused about :-) I have the following config in Apache:
<Location /zope> SetHandler pcgi-handler PCGI_ROOT / PCGI_SetEnv SiteRootPATH / </Location>
Looks good.
<Location /cws> SetHandler pcgi-handler PCGI_ROOT /cws PCGI_SetEnv SiteRootPATH /cws </Location>
Try "PCGI_SetEnv SiteRootPATH /" here too... Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
Oleg Broytmann wrote:
You can even access http://localhost/cws/cws/cws/cws/cws/cws/Help :) It is aquisition's drawback...
Well, it's a "feature" I can live with (otherwise it wouldn't be working at all :-).
<Location /cws> SetHandler pcgi-handler PCGI_ROOT /cws PCGI_SetEnv SiteRootPATH /cws </Location>
Try "PCGI_SetEnv SiteRootPATH /" here too...
Tried that too, no joy (with all possible combinations of PCGI_ROOT and PCGI_SetEnv, as I don't exactly understand its affect on Zope itself). The dump from the REQUEST Session state shows (for both settings of PCGI_SetEnv, plus some judicious editing): URL: http://localhost/cws/cws/Help/index_html URL0: http://localhost/cws/cws/Help/index_html SERVER_URL: http://localhost REQUEST_URI: /cws/Help PATH_INFO: /cws/Help SiteRootPATH: changes (from /cws to /), so that's something. :-)
From an environmental point of view, things appear OK (but what would I know, I've only be using Zope for just over a week). I'm not sure how absolute_url() is constructing the full URL, but I guess it would be from those above components (there doesn't appear to be anything that defines the absolute hierarchy that I can find).
On a whim, I tried http://localhost/cws/manage, and the urls on that page suffer the same problem too (eg, in the left hand frame there are links of the form "http://localhost/cws/cws/Help/manage_workspace"). At least it's not just my DTML methods. :-) Regards, Daryl Tester
On Thu, 9 Mar 2000, Daryl Tester wrote:
<Location /cws> SetHandler pcgi-handler PCGI_ROOT /cws PCGI_SetEnv SiteRootPATH /cws </Location>
Try "PCGI_SetEnv SiteRootPATH /" here too...
Tried that too, no joy (with all possible combinations of PCGI_ROOT and PCGI_SetEnv, as I don't exactly understand its affect on Zope itself).
Well, let's me clarify a bit. PCGI_ROOT is the folder (or other object) in Zope which will serve your requests. In your situation it is folder "cws" in root folder. PCGI_SetEnv is *only an example* of how to set per-request environment variable. Whatever variable you'll use and what value to set - it is up to your configuration. In my example it is variable SiteRootPATH. This variable only works with SiteAccess. I use SiteAccess pretty happily, and it solves all my virtual hosting needs, including rewriting of BASE, absolute_url, etc. Without SiteAccess you'll get exactly what you get - additional path components. Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
Oleg Broytmann wrote:
This variable only works with SiteAccess. I use SiteAccess pretty happily, and it solves all my virtual hosting needs, including rewriting of BASE, absolute_url, etc.
And then the penny dropped. I never thought of the problem as a virtual hosting one. After installing and configuring SiteAccess, all my woes (well, my Zope related ones :-) have been resolved. Thanks a bundle! Regards, Daryl Tester
Daryl Tester wrote:
would I know, I've only be using Zope for just over a week). I'm not sure how absolute_url() is constructing the full URL, but I guess it would be from those above components (there doesn't appear to be anything that defines the absolute hierarchy that I can find).
Exactly, absolute_url tools up through the various aq_inner wrappers to build an objects absolute_url. Sorry, I don't know anything about fcgi. -Michel
participants (3)
-
Daryl Tester -
Michel Pelletier -
Oleg Broytmann