[mod_python] processing py-scripts with apache 1.3 and mod_python

Colin Bean ccbean at gmail.com
Tue Apr 4 17:14:13 EDT 2006


My mistake(s)...
I stand corrected :)
I've only configured mod_python 3.X or newer, and somehow overlooked the
fact that he was running 2.7.

-Colin

On 4/4/06, Graham Dumpleton <grahamd at dscpl.com.au> wrote:
>
>
> On 05/04/2006, at 2:32 AM, Colin Bean wrote:
>
> > For starters, try putting quotes around the path in the "Directory"
> > section, so:
> >     <Directory "/anydir/py/">
>
> Adding quotes should make no different. Quotes are only really required
> where path has space or other magic characters in it.
>
> > Also, chage "PythonHandler mod_python.publisher" to "SetHandler
> > mod_python.publisher".
>
> This is an incorrect suggestion as well.
>
> > Once you've done this, I don't beleive that you need the PythonPath
> > directive (since it is the same path as the publisher directory),
> > nor the "SetHandler python-program".
> >
> > This doesn't really answer your question in depth, but I beleive
> > that the "SetHandler python-program" directive is only necessisary
> > in older versions(?) of mod_python, in which case you also needed
> > to specify a "PythonHandler" directive.  In your case, the line
> > "SetHandler mod_python.publisher" should be all that's needed.
>
> He is using an older version so must use "python-program". Note that
> "python-program"
> still works in newer versions as well.
>
> > Also, posting relevant snippets of your error logs will help us to
> > diagnose further problems.
> >
> > HTH,
> > -Colin
> >
> >
> > On 4/4/06, Emanuel Rumpf <x at branwelt.de> wrote: Hello,
> >
> > I wanted /anydir/py/test.py to be processed by mod_python
> > on apache 1.3 server, when requesting http://domain.org/py/test.py
> > (where /anydir/ is the DocumentRoot)
> >
> >
> > No matter, what I tried, there was no success,
> > either the file was delivered as textfile-download,
> > or I got a "File not Found" error.
> >
> > my current config, which is inside a virtual host:
> >
> > <Directory /anydir/py/>
> >                 Options -FollowSymLinks +Indexes
> >                 Order allow,deny
> >                 Allow from all
> >
> >                 PythonPath "sys.path+['/anydir/py/']"
>
> No necessary to have PythonPath.
>
> >                 #PythonHandler handler_script
> >                 PythonHandler mod_python.publisher