Maybe I should have explained the tests better then. All the requests are for the url http://example.com:8888/a/b/c/d/@@testing and the plone site as located at "/example" from the zope root.
OK, to analyze the "traditional" Apache + Zope setup: you are asking for requests to 'http://example.com/*" to be rewritten onto the Zope server at port 8888, with the '/example' folder serving as the virtual root. URLs generated by Zope should be relative to that root. So, the absolute_url for tha object whose physical path is '/example/foo' should be 'http://example.com/foo'. Correct? Yes >> Using wsgi with vhm_path > ------------------------ > Same rewrite rule as before (i.e., proxying onto a paste server)? Yes >> Using wsgi with vhm_xheaders > > ---------------------------- > > <VirtualHost *:8888> > > ServerName example.com > > ServerAlias example.com > > >> RewriteEngine On > > >> RewriteRule ^/(.*) http://127.0.0.1:8499/$1 [P,L] > > RequestHeader add X-Vhm-Host http://example.com:8888 > > RequestHeader add X-Vhm-Root /example > > </VirtualHost> > You aren't rewriting onto '/example' here, so why are you setting it as the virtual root? That's how the xheader filter works. The simple example from the docs shows ServerName www.example.com RewriteEngine on RewriteRule ^/(.*) http://localhost:8080/$1 [P,L] RequestHeader add X-Vhm-Host http://www.example.com RequestHeader add X-Vhm-Root /cms So I am doing it correctly. >> VIRTUAL_URL = http://example.com:8888/b/c/d/@@testing > > PATH_INFO = /a/b/c/d/@@testing > > ACTUAL_URL = http://example.com:8888/b/c/d/@@testing > > URL = http://example.com:8888/a/b/c/d/@@testing > > SCRIPT_NAME = > > repoze.vhm.virtual_root = /example > > repoze.vhm.virtual_url = http://example.com:8888/b/c/d/@@testing > > repoze.vhm.virtual_host_base = example.com:8888 > > HTTP_X_VHM_HOST = http://example.com:8888 > > HTTP_X_VHM_ROOT = /example > > It does seem like we have a problem here as its chopping off the first part > of the path with the xheaders setup. I'm surprised that the site works as > well as it does with this kind of issue. > I think your configuration is incorrect: the 'X-Vhm-Root' header is supposed to signal the "phanotom" path prefix in the URL apparent to the app. It is. "/example" is the actual root of zope to prepend every request with. The site is still serves the correct objects, just some things don't work completely right. I still think my configuration is correct. If not, how should it look? Thanks, Nathan On Wed, Dec 30, 2009 at 12:03 AM, Tres Seaver <tsea...@palladion.com> wrote: -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > Nathan Van Gheem wrote: > > > Thanks for the feedback on this. I've set up some tests that I > > > think illustrate what is going on pretty well. > > > > > >> What ends up happening in the current situation is that a url of > > > > > >> "/a/b/c/d" get chopped off to something like "/b/c/d" NOT including the > > > > > >> virtual root. > > > > > > > > >> Sorry, where is this happening? > > > > > > See below with the test results. > > > > > > > > >> I hate to go through it like this. I don't have svn access though and > > > > > >> either I'm completely misunderstanding something or this is a rather > > > > > >> ugly bug. > > > > > > > > >> We can get you svn access for sure. :) > > > > > > How can I go about getting that? > > > > > > > > > It is annoying. My suggestion would be: > > > > > > > > >> - Try the same setup with a "standard" Zope and vhosting via the old > > > > > > VirtualHostMonster, just to have a baseline. Write a simple view that > > > > > > prints the request (in particular the keys VIRTUAL_URL, PATH_INFO, > > > > > > ACTUAL_URL and URL) > > > > > > > > >> - Use the same view in a setup that uses repoze.vhm#vhm_path and a > > > > > > rewrite rule. Are you getting the same behaviour? > > > > > > > > >> - Use the same view in a setup that uses repoze.vhm#vhm_xheaders and > > > > > > set headers. Are you getting the same behaviour? > > > > > > > > >> Maybe the first setup would take some time to set up, but using a > > > > > > rewrite rule + vhm_path should be a minor change from using custom > > > > > > headers and vhm_xheaders. At least then we can find out where, if > > > > > > anywhere, there are differences. Then we can dig deeper. > > > > > > Here are the test results.. > > > > > > I've included the apache configuration in there just so you can see what > I'm > > > up to. > > > > > > Results > > > > > > ======= > > > > > > > > >> all requests coming on http://example.com:8888/a/b/c/d/@@testing > > > > > > > > >> Not using wsgi and virtual host monster > > > > > > --------------------------------------- > > > > > > > > >> <VirtualHost *:8888> > > > > > > ServerName example.com > > > > > > ServerAlias example.com > > > > > > > > >> RewriteEngine On > > > > > > > > >> RewriteRule ^/(.*) > > >> > http://127.0.0.1:8499/VirtualHostBase/http/example.com:8888/example/VirtualHostRoot/$1[L,P] > > > > > > </VirtualHost> > > > OK, to analyze the "traditional" Apache + Zope setup: you are asking > for requests to 'http://example.com/*" to be rewritten onto the Zope > server at port 8888, with the '/example' folder serving as the virtual > root. URLs generated by Zope should be relative to that root. So, the > absolute_url for tha object whose physical path is '/example/foo' should > be 'http://example.com/foo'. Correct? > > > > >> VIRTUAL_URL = http://example.com:8888/a/b/c/d/@@testing > > > > > > PATH_INFO = /VirtualHostBase/http/ > > >> example.com:8888/example/VirtualHostRoot/a/b/c/d/@@testing > > > > > > ACTUAL_URL = http://example.com:8888/a/b/c/d/@@testing > > > > > > URL = http://example.com:8888/a/b/c/d/@@testing > > > > > > SCRIPT_NAME = > > > > > > repoze.vhm.virtual_root = > > > > > > repoze.vhm.virtual_url = > > > > > > repoze.vhm.virtual_host_base = > > > > > > HTTP_X_VHM_HOST = > > > > > > HTTP_X_VHM_ROOT = > > > > >> Using wsgi with vhm_path > > > ------------------------ > > > Same rewrite rule as before (i.e., proxying onto a paste server)? > > > > > > > VIRTUAL_URL = http://example.com:8888/a/b/c/d/@@testing > > > > > > PATH_INFO = /example/a/b/c/d/@@testing > > > > > > ACTUAL_URL = http://example.com:8888/a/b/c/d/@@testing > > > > > > URL = http://example.com:8888/a/b/c/d/@@testing > > > > > > SCRIPT_NAME = > > > > > > repoze.vhm.virtual_root = /example > > > > > > repoze.vhm.virtual_url = http://example.com:8888/a/b/c/d/@@testing > > > > > > repoze.vhm.virtual_host_base = example.com:8888 > > > > > > HTTP_X_VHM_HOST = > > > > > > HTTP_X_VHM_ROOT = > > > > >> Using wsgi with vhm_xheaders > > > > > > ---------------------------- > > > > > > <VirtualHost *:8888> > > > > > > ServerName example.com > > > > > > ServerAlias example.com > > > > > > > > >> RewriteEngine On > > > > > > > > >> RewriteRule ^/(.*) http://127.0.0.1:8499/$1 [P,L] > > > > > > RequestHeader add X-Vhm-Host http://example.com:8888 > > > > > > RequestHeader add X-Vhm-Root /example > > > > > > </VirtualHost> > > > You aren't rewriting onto '/example' here, so why are you setting it as > the virtual root? > > > >> VIRTUAL_URL = http://example.com:8888/b/c/d/@@testing > > > > > > PATH_INFO = /a/b/c/d/@@testing > > > > > > ACTUAL_URL = http://example.com:8888/b/c/d/@@testing > > > > > > URL = http://example.com:8888/a/b/c/d/@@testing > > > > > > SCRIPT_NAME = > > > > > > repoze.vhm.virtual_root = /example > > > > > > repoze.vhm.virtual_url = http://example.com:8888/b/c/d/@@testing > > > > > > repoze.vhm.virtual_host_base = example.com:8888 > > > > > > HTTP_X_VHM_HOST = http://example.com:8888 > > > > > > HTTP_X_VHM_ROOT = /example > > > > > > It does seem like we have a problem here as its chopping off the first > part > > > of the path with the xheaders setup. I'm surprised that the site works as > > > well as it does with this kind of issue. > > > I think your configuration is incorrect: the 'X-Vhm-Root' header is > supposed to signal the "phanotom" path prefix in the URL apparent to the > app. > > > > Tres. > > - -- > > =================================================================== > > Tres Seaver +1 540-429-0999 tsea...@palladion.com > > Palladion Software "Excellence by Design" http://palladion.com > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.9 (GNU/Linux) > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > > iEYEARECAAYFAks6bpIACgkQ+gerLs4ltQ6QmQCgvS5XxhVF04bb9xgiAlM7N62I > nJgAoIeh02XfVqnQyiEcYdB/S6aDcAm7 > =WMMw > -----END PGP SIGNATURE----- > > _______________________________________________ > > Repoze-dev mailing list > > Repoze-dev@lists.repoze.org > > <http://lists.repoze.org/listinfo/repoze-dev> > http://lists.repoze.org/listinfo/repoze-dev > >
_______________________________________________ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev