durusmail: quixote-users: Re: [PATCH] fix for mod_pythonDirtectory/VirtualHost
Having Quixote serve entire website
2004-05-04
2004-05-04
[PATCH] fix for mod_python Dirtectory/VirtualHost
2004-05-05
Shahms King (2 parts)
Re: [PATCH] fix for mod_python Dirtectory/VirtualHost
2004-05-05
Re: [PATCH] fix for mod_pythonDirtectory/VirtualHost
2004-05-05
2004-05-05
2004-05-05
Re: [PATCH] fix for mod_pythonDirtectory/VirtualHost
Shahms King
2004-05-05
A little more research and it seems that 'doing the right thing' for any
given combination of Alias, Directory, Location and VirtualHost
directives is simply not possible from within mod_python (unless you
want to manually search the Apache configuration for which directive
matches for the current uri).  Basically "the right thing" is:
For a URI: http://somehost.com/some/path/with/stuff SCRIPT_NAME and
PATH_INFO need to be "/some/path" and "/with/stuff" for all of the
following cases:

Alias "/some/path" "/webserver/python"
where /webserver/python is specified in a 





And it need to be "" and "/some/path/with/stuff" when DocumentRoot is
set to the python directory. (This is essentially the same as the Alias
or LocationMatch case).  Unfortunately, Apache sets SCRIPT_NAME to be
one path component beyond the last existing directory using DocumentRoot
or the  as a root.  There is no way of knowing what triggered
calling mod_python for that URI without "parsing" the current
configuration manually.  Yes, it could be done,
mod_python.apache.config_tree() will give you the current configuration,
but it wouldn't be pleasant.  During my investigation, I also discovered
that Quixote won't work with a Location or LocationMatch that is more
than one non-existent path component deep (i.e. Location /qdemo works,
Location /not_a_directory/qdemo will not).

There are a number of partial solutions, however, I am confident in
saying that it is impossible to fix for all possibilities without adding
another PythonOption.  Adding PythonOption quixote-document-root should
solve the problem for every case, but is a little ugly. Less so than the
other kludges, though.

--
Shahms King 



reply