[mod_python] python scripts like mod_perl

Jeremy McCormick jeremym at ipnetwork.com
Thu Aug 30 13:47:08 EST 2001

Hi, y'all.  I've gleaned a lot of good info and programs off this site,
including a mod_python dll for Win32 that links to the latest ActiveState
build of Python.

I'm having a minor configuration issue in getting my python scripts to
execute from a directory just under the Apache root of my Windows Nusphere
install, i.e. <Apache root> / python_scripts.  I can only get the scripts to
execute if they are located under the document root.  I would like to copy
the configuration of mod_perl, i.e. <Apache root> / perl-bin, which is an
alias for  "nsperl-bin"; these scripts execute perfectly.  However, when I
try a similar set-up with Python, Apache can't find the interpreter.  

Here is the relevant section from my httpd.conf (anything strange-looking
was inspired by the lines for mod_perl).

LoadModule python_module modules/mod_python.dll
ScriptAlias /python-bin/ "d:/programs/nusphere/apache/nspython-bin"
<Location /python-bin>
   SetHandler python-script
   PythonHandler testpy
   Options ExecCGI

I would like to be able to execute scripts from my html like so:

<a href="/python-bin/testpy.py"> Test a python script </a>

...but, alas, tis not working unless I put the scripts somewhere in the
document root.  Any ideas?

Thanks in advance.  Please let me know if more information is needed about
my set-up.

More information about the Mod_python mailing list