Apache and Python and Ubuntu

Paul Boddie paul at boddie.org.uk
Thu Mar 30 12:57:49 CEST 2006

msuemnig at jjhill.org wrote:
> Thanx a lot for your input and advice.  I went through the
> documentation on httpd.apache.org/docs/2.2/howto/cgi.html and added the
> following:
> AddModule cgi-script .cgi .py
> <DIRECTORY /var/www/>
>  Options +ExecCGI

Does Apache actually support "DIRECTORY" as opposed to "Directory"? The
configuration file isn't "old-school HTML", and I'd recommend following
the conventions in the documentation as closely as possible until you
have something working.

> It now gives me a 403 forbidden.  When I check the error logs, it still
> says that Options ExecCGI is not turned on in /var/www/
> Is there a special place inside of apache2.conf I'm supposed to have
> the <Directory..> tag? and/or AddModule line?

I would imagine that you're not supposed to be editing apache2.conf
unless the changes are fairly important and change the global
configuration of the server. On Debian/Ubuntu, you're supposed to add
files to the /etc/apache2/sites-available directory and then use the
a2ensite program to enable the new site.

> I also double checked to make sure owner/group/other all have execute
> and it does.

You could also investigate the ScriptAlias directive to permit access
to a particular file or directory as a CGI program (or a collection of
CGI programs) at (or under) a specified location; I've found that to be
much more convenient.


More information about the Python-list mailing list