[GIS] Problem with setting up proxy in Apache

apacheopenlayers-2PROXY

I've downloaded sample proxy.cgi file from here. I've placed it in Apache's cgi-bin directory. However, whenever I try to access it, it throws the error Can't find string terminator '"' anywhere before EOF at C:/dev_/dev_php/sws/xampp/cgi-bin/proxy.cgi line 80.\r. I'm using MS Windows and I've updated the first line of the CGI file to reflect my settings, i.e., to #!"C:\dev_\dev_php\sws\xampp\perl\bin\perl.exe".

All the cgi files in the same directory execute fine. Is it that I'm using an outdated proxy file? I'm using Apache 2.2.21.

Best Answer

In this case it is because your sample proxy script from Open Layers is written in Python. Changing the header line just changes the language that your cgi file tells the server that it's in. You either need to modify your apache server to run Python (see here for one method) or alternately download a Perl proxy and modify it for your purposes, for example the James Marshall CGI Proxy.