Setting up Python for CGI

Gregory Piñero gregpinero at gmail.com
Tue Jul 12 02:35:27 UTC 2005


I think I tried what you said but now I can't get Apache to restart,
here's what it says:

chiefinnovator at server1:/usr/bin$ /usr/sbin/apache2ctl restart
httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address [::]:3391
no listening sockets available, shutting down
Unable to open logs

Specifically read below for what I did:

> Basically, you just add a line like this:
> 
> AddHandler cgi-script .py

I added this to my /etc/apache2/apache2.conf

> to tell apache that .py files should be executed as scripts.  Then you need to
> tell apache that the folder you have the script in is allowed to have CGI
> scripts, by adding ExecCGI to the Options line for it, something like this:
> 
> <Directory /path/to/your/directory>
>    Options FollowSymLinks ExecCGI
> </Directory>

I added this to the file /etc/apache2/sites-available/default
I wasn't really sure what file to edit for this part.  Do I need to
add every directory like this that I want python to run from or is
there a recursive way to set this up.

Thanks,

Greg




More information about the ubuntu-users mailing list