Newbie: How do you enable python scripts in apache server?

Joe Francia usenet at soraia.com
Thu Jun 5 18:00:13 EDT 2003


Husam wrote:

>>This seems not so much a python issue then a apache-configuration issue.
> 
> Indeed, I tried to look for apache configuration on google but couldn't find
> any thing usable.
> 
> 
>>ScriptAlias /url_for_scriptdir "/scriptdir"
> 
> I will try this one.
> 

Oddly enough, http://httpd.apache.org/ has some very good information 
about configuring Apache. ;)

Add this line in the relevant section of your httpd.conf (I have it in 
the IfModule mod_mime.c part):

AddHandler cgi-script .py

And if you put the .py files in a directory that's not the CGI 
directory, you'll need to set Options ExecCGI for the dir.  I do it with 
.htaccess files, but you can also do it in the httpd.conf.

jf





More information about the Python-list mailing list