Apache web server and CGI

Lad export at hope.cz
Tue Aug 10 03:06:50 EDT 2004


Jeffrey Froman <jeffrey at I.slack> wrote in message news:<10hf2ugjngver5e at corp.supernews.com>...
> Lad wrote:
> 
> > How can I set up Apache web server to use Python for CGI processing( for
> > file *.py). Thanks for help
> 
> A simple method would be to include the line:
> 
> AddHandler cgi-script .py
> 
> in your httpd.conf. This should work fine so long as your .py files start
> with a proper invocation of the python interpreter (i.e.,
> #!/usr/bin/python). You might also want to look at mod_python
> (http://www.modpython.org/).
> 
> Jeffrey

Thank you Jeffrey and Peter for help.
I added AddHandler cgi-script .py to httpd.conf
I also tried to run the test script as Peter suggested but the Apache
says( in error log)

[Tue Aug 10 08:51:32 2004] [error] [client 127.0.0.1] (2)No such file
or directory: script not found or unable to stat: c:/program
files/apache group/apache/cgi-bintest.py

The name of script is test.py and is in cgi-bin (Apache subdirectory).

I tried to run the script from IE browser with the command 
http://localhost/cgi-bin/test.py

but without success. I use XP home edition.

Apache runs without problem as I could check it by inserting
http://localhost/

BTW, how can I set up a different directory for cgi scripts? For
example I would like to have all my scripts in
C:\Scripts\MyScripts

Thank you for help
LAd



More information about the Python-list mailing list