[mod_python] Possible partial answer to Windows config problems

ian McDowall i.d.mcdowall at gmail.com
Sat Jun 17 17:06:26 EDT 2006


There have been questions from Karl Kobata and John Cartwright and I may
have a partial answer.

In particular, one of the problems that I spent a little time over was the
use of the Apache <Directory> tag to control mod_python configuration.

The example in the mod_python tutorial is slightly ambiguous, particularly
as it is written from a Unix / Linux perspective.  I suspect that this is
bog-standard Apache configuration rather than anything peculiar to
mod_python but I guess that people are coming fairly new to both at the same
time (as was I).

The directory in the <Directory> tag has to be an absolute Windows directory
that should include a drive letter.  This will have to map to a directory
under the Apache root directory.  I was expecting the reference to be
relative to the Apache root directory.

For example, suppose that you have an Apache configuration with the Apache
root set to E:\ApacheRoot and you have a sub-directory testdir in which you
have placed mod_python sources.  Then you can refer to URIs in this
directory from the browser as http://yourdomain/testdir/test.py if you have
a set of Apache directives such as the folliowing
<Directory "E:\ApacheRoot\testdir">

      AddHandler mod_python .py

      PythonHandler mptest

      PythonDebug On

 </Directory>
In this case, my confusion was to assume that I would have a tag as follows:
<Directory "/testdir">
...

BTW, if you are really struggling with set-up, I got some initial progress
by omitting the <Directory> tag and just having the AddHandler etc. at the
root level.  Of course, this is not wise for a real implementaton but, if
you are trying to find out if your mod_python installation is OK then it
gave me some information.  of course, I had to put the .py file in the
Python Lib directory in the installation so it could be imported but that
did get me some basics working.

I hope that this helps.  if it is misleading or irrelevant then please
ignore it and accept my apologies.

-- 
Ian McDowall
i.d.mcdowall at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060617/7667de96/attachment.html


More information about the Mod_python mailing list