Graham Dumpleton
grahamd at dscpl.com.au
Sat Jun 17 19:47:54 EDT 2006
On 18/06/2006, at 7:06 AM, ian McDowall wrote: > 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. The best way to avoid the confusion is not to set it up in the main Apache configuration file but do it in a specific directory within a .htaccess file. That way the whole issue of how to set Directory directive goes away. Where mod_python is already installed and you just want to start playing, it also avoids the whole issue of pestering some administrator to fiddle with the main Apache configuration unnecessarily. This is why the instructions I post a reference to occasionally use a .htaccess file. It is generally easier to get going and shows more problems in setup more quickly and more easily. Those alternate instructions again are: http://www.dscpl.com.au/articles/modpython-001.html Graham -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060618/197f8b65/attachment.html
|