newbie simple exec problems

Matthew Barre mbarre at
Wed Mar 8 16:17:51 CET 2000

I put them in the cgi-bin directory and added the "AddHandler cgi-script
.py" to the srm.conf file for apache as per the python cgi FAQ. I don't know
a lot about linux, and that I think compounds my problem. Does anyone know
of a good webpage that walks through configuring Apache to run python cgi's.

"Ray! When someone asks you if you're a god, you say YES!!" -Winston Zedmore

> From: Steve Holden <sholden at>
> Organization: Holden Web: Intranet Technology Specialists
> Reply-To: sholden at
> Newsgroups: comp.lang.python
> Date: Wed, 08 Mar 2000 13:58:11 GMT
> Subject: Re: newbie simple exec problems
> Matthew Barre wrote:
>> That works, thank you. What do I need to do to get it to work for cgi? Can I
>> just put ~user/cgi-bin/
>>> From: Michael Hudson <mwh21 at>
>>> Organization: University of Cambridge, England
>>> Matthew Barre <mbarre at> writes:
>>>> I have been learning python on my mac, and I just setup a RH6.1 box on my
>>>> little LAN to practice Python as a cgi tool etc. Well the cgi thing has me
>>>> completely baffled and right now I can't even get a Hello World script to
>>>> run at the prompt ie:
>>>> $
>>>> bash:unrecognized command
>>>> I have tried chmod 0755 and
>>>> chmod a+x
>>>> The first line of the file is
>>>> #!/usr/bin/python
>>>> which is where I checked and that's where python is. I'm baffled. Right now
>>>> if I try to get a cgi the browser just prints the script...ack...what am I
>>>> doing wrong?
>>>> -Matt
>>>> ---------
>>>> "Ray! When someone asks you if you're a god, you say YES!!" -Winston
>>>> Zedmore
>>> Try
>>> $ ./
>>> `.' may well not be on your $PATH...
>>> Michael
>>> --
>>> very few people approach me in real life and insist on proving they are
>>> drooling idiots.                         -- Erik Naggum, comp.lang.lisp
> No, the issue of your browser simply showing you the script is different.
> First of all you have to let Apache (or whatever other server you are
> using) know that the content of the *.py files has to be executed.  For
> a simple start, try putting them in a cgi-bin directory.
> When a web server serves content, it has to describe the TYPE of the
> content.  It will normally do this with HTTP "Content-Type:" headers.
> You will have to arrange for your CGI script to output such a header.
> regards
> Steve
> --
> "If computing ever stops being fun, I'll stop doing it"

More information about the Python-list mailing list