That means that the web server doesn't know that at this location, a file ending with '.cgi' should be executed rather than passed directly to the browser. You need to configure the web server in such a way that the directory in which nph-proxy.cgi
resides or the extension are automatically considered programs. The specifics of the configuration will depend on your web server (Apache, lighttpd etc.).
Or try to move the file into an existing directory (such as /var/server/www/cgi-bin/
) that is already configured for executables.
To configure Apache, open the file (with sudo or gksu) /etc/apache/apache2.conf
:
gksu gedit /etc/apache/apache2.conf
Search whether there is a line like this:
ScriptAlias /cgi-bin/ /some/directory/or/another/cgi-bin/
If yes, create that directory (sudo mkdir /some/directory/blah/blah/cgi-bin/
) and put your CGI script there. If not, add this line. Then when you call the URL
http://your.machine.blah.foo/cgi-bin/nph-proxy.cgi
it will be executed.
Alternatively, you can allow the CGI scripts to be executed in a particular directory. Put the following in your config file:
<Directory /the/directory/where/your/script/is/>
Options +ExecCGI
</Directory>
AddHandler cgi-script cgi pl
(check whether the AddHandler line is already in your config!)