How To Install Cgi Proxy Free

With the way CGI proxy servers owners often limit allowed sites, run out of bandwidth or just suddenly stop working, I realized I had to get my personal CGI proxy server up and running. It’s dead easy to get one too and it’s gonna take probably less than an hour.The first thing you have to do is look for a host that supports CGI/Perl or has a cgi-bin/directory. I used a free host and you can google one out too. The only problem is that most free hosts do not allow cgi scripts.

Proxy Server Install
The webhost you need must:1. Support CGI/PERL2. Offer you a free sub-domain (or you’ll have to get a domain name)3. Must have a file upload size limit above 500kb4. Must be reliable.is a good example. I have to warn you that certain free hosts do not allow using their server for proxy related stuffs and might give you a ban if its against their terms of service.If you can afford a paid server, my advice for you is to use one because free hosting in most cases share a common ip. What does this mean?
It means your proxy server and someone else’s proxy server might point to the same ip address and this makes it easy for your network operator to block. A proxy server on the same ip address might already be on their blacklist.After getting the host, download my or the original script from. I believe now you have already registered wit a free host, right? Now, check the welcome email you got from your webhost including your account details.You should see your ftp server, username and password.If not, navigate around your cpanel, it should be hooked up somewhere.Now you’ve got the details, you need a ftp client software to upload your scriptsome hosts offer you a web based ftp interface but most do not.Ftp clients softwares to upload stuffs to your server include SmartFTP, Filezilla etc.
I want to setup a proxy for openlayers to use so I followed these steps:.Downloaded the proxy.cgi file from the OpenLayers web site:.Modify the proxy.cgi file to include my domain in the allowedHosts list:allowedHosts = 'localhost:6901'.Copy the proxy.cgi file to the following folder:$TOMCATPATH$/webapps/yourApp/WEB-INF/cgi/.Modify the file web.xml of your web app by adding the sections below. You find the file at$TOMCATPATH$/webapps/yourApp/WEB-INF/web.xmlComment: In case the web.xml file doesn’t exist for your webapp, just create it yourself or copy it from another webapp and modify it. (created!)Comment: the “param-value” for the “executable” parameter has to contain the path to your Python installation. (it does!) cgiorg.apache.catalina.servlets.CGIServletdebug0cgiPathPrefixWEB-INF/cgiexecutablec:python25python.exepassShellEnvironmenttrue5cgi/cgi-bin/.Modify the file context.xml of your web app by adding the element below. You find the file at $TOMCATPATH$/webapps/yourApp/META-INF/context.xml.Restart Tomcat.To use the proxy with OpenLayers, just include this single line into your code:OpenLayers.ProxyHost = '/yourWebApp/cgi-bin/proxy.cgi?url=';But when I try to use it like: /webappname/cgi-bin/proxy.cgi?url=labs.metacarta.comI get this error: Some unexpected error occurred. Error text was: list index out of rangeI think its related with os.environ'REQUESTMETHOD' but I dont know how its related.
The answer is: You don't install or use cgi proxy on Tomcat.cgi is for apache server or IIS that are used as a front-end server. Tomcat may sit behind it. The configuration of Apache is detailed in:Be warned that OpenLayers warns that its proxy.cgi is only an example and may not have good enough check to stop it from being exploited, i.e. It may run some malicious script.If you are serving your OpenLayers client page on Tomcat alone and it contains layers from other GeoServer or Mapserver, you can use proxy servlet and specify it as:OpenLayers.ProxyHost = 'sevlet URL on the server that served this page';There are reverse proxy or rewrite sevlet solutions to it, too. Please Google on these.