[mod_python] VirtualHost

rickzolun1 at charter.net rickzolun1 at charter.net
Fri Dec 29 02:22:41 EST 2006

The following is working:

<VirtualHost *:80>
    ServerName srv01.local
	DocumentRoot "C:/Company/apps"
    <Location "/">
        AllowOverride None
        Order allow,deny
        Allow from all

        PythonPath "['C:/Company/apps/ClientX/ProductY','C:/Company/scripts'] + sys.path"
        SetHandler mod_python
        PythonHandler mpcp
		PythonDebug On
		PythonOption cherrysetup project_start::mp_setup


1. I would prefer to have relative path
<Location "/ClientX/ProductY">
but this is not working. I get "Forbidden  You don't have permission to access / on this server." message when I do this. How can I use relative paths?

2. Are relative paths allowed in PythonPath?

Different context...

3. It appears that environment variables cannot be used in the Python code with mod_python (os.environ.get). Is there an alternate recommended approach?


More information about the Mod_python mailing list