Reputation: 5540
I have a standard Apache2 installation on an Ubuntu server. The default settings use ScriptAlias
to refer /cgi-bin/
to /usr/lib/cgi-bin/
. If I place my Python CGI script in /usr/lib/cgi-bin/
it executes.
I created /var/www/cgi-bin/
with appropriate permissions, removed the ScriptAlias
line, changed the Directory
entry in the default
file for the site, moved the CGI file to /var/www/cgi-bin/
and restarted Apache2, but I was not able to get the script to run. It was appearing as a text file in the browser instead of being executed. The HTML file calling the script refers to /cgi-bin/SCRIPT
, so I left that unchanged. I tried variations on /cgi-bin
and /var/www/cgi-bin
in the config files without success. How can I get a Python CGI file to run from /var/www/cgi-bin
?
Upvotes: 2
Views: 3948
Reputation: 1532
please make sure:
Upvotes: 0
Reputation: 32094
If you removed the ScriptAlias
directive, you should probably add the following lines into the main config for the directory or into .htaccess
file:
Options +ExecCGI
AddHandler cgi-script py
Upvotes: 4