4

Possible Duplicate:
Problems with OpenLayers and WFS - proxy.cgi issues

I have seen some example related to WMS Get Feature Info like :

http://openlayers.org/dev/examples/getfeatureinfo-control.html

In this example they are using

 OpenLayers.ProxyHost = "proxy.cgi?url=";

My question is :

How we can setup our own proxthost for our geoserver layers?

Help would be appreciated.

2
  • Hello guys I'm confused with the official openlayers explanation for the proxyHost... tell me if am wrong.. does this mean that I have to host an apache http server with the .cgi file in order for people using my openlayers pages to get WMSFeatures and capabilities? My software is using local javascript/html files to run openlayers so we do not currently have a server Sep 17, 2012 at 18:55
  • @ManuelArredondo Unfortunately, yes. What OS are you using btw? If you're on Windows, you could try XAMPP. If you're on Ubuntu, just install Apache using apt. If you want further clarification, it would be best to ask a question so that others might learn, too.
    – R.K.
    Sep 18, 2012 at 5:55

2 Answers 2

2

The OpenLayers FAQ has a section on setting up your own ProxyHost. Here's the relevant excerpt:

How do I set up a ProxyHost?

An example proxy host script is available here: trunk/openlayers/examples/proxy.cgi

For the standard Apache configuration, you would place proxy.cgi into your /usr/lib/cgi-bin/ directory.

Once a proxy host script has been installed, you must then edit the OpenLayers.ProxyHost variable to match that URL.

Given the above standard Apache configuration:

OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="; 

If you have done something like this, you should be able to visit:

http://YourDomain.example.com/cgi-bin/proxy.cgi

The resulting content at that page should be the openlayers.org website.

If you get a 404 error instead, either the proxy script is not in the right location, or your webserver is not configured correctly.

2
2

If you want to use Server side C# proxy, then use you can try this proxy.ashx.net proxy

Not the answer you're looking for? Browse other questions tagged or ask your own question.