[mod_python] ServerName, UseCanonicalName, and mod_python

Brian Beck exogen at gmail.com
Sat Oct 2 15:19:57 EDT 2004


I'm trying to determine how mod_python determines what server name its
handlers are being applied to?  Here's an example...

In Apache, ServerName is exogen.cwru.edu:80, and UseCanonicalName is Off.

What this combination means is that anyone can access the address
http://exogen.cwru.edu, and people inside the cwru.edu domain can
access http://exogen and NOT have Apache 'redirect' them to

If UseCanonicalName were On, it would effectively replace any request
for just 'exogen' with 'exogen.cwru.edu'.

Here's where mod_python comes in.

I have the following directive set up, which in short, enable the
mod_python handler for any files in the /python subdirectory of my
webserver ('Apache' is NOT Apache's install path, but what most people
name 'htdocs'):

<Directory "F:/Apache/python">
    AllowOverride FileInfo
    SetHandler mod_python
    PythonHandler mod_python.publisher

As expected, any request for a Python script when accessing it through
http://exogen.cwru.edu/python/ actually parses the requested script
using mod_python.

However, even with UseCanonicalName set to Off, a request for scripts
in  http://exogen/python/ (the same directory, but with a differently
supplied ServerName) return the contents of the script rather than
handing it over to mod_python.

Any help would be greatly appreciated -- I really do not want to set
UseCanonicalName to On but still want scripts to be handled using
mod_python.  Do I have to use virtual hosts or something to accomplish

Brian Beck
Adventurer of the First Order

More information about the Mod_python mailing list