Take the 2-minute tour ×

There have been several questions very similar to this asked already (including ones not involving GeoServer), but their solutions have not solved my problem. I am trying to use getFeatureInfo on my GeoServer WMS layers, which are hosted on a different domain than the website on which they will be used, and have since learned that I need a proxy to accomplish this.

I have followed the instructions on how to set this up in Tomcat 6 (except for renaming .jar file as it's unnecessary in v6), added www.greengeography.org and the IP of my local network to the proxy.cgi file, then changed the top line to #!/usr/bin python as that's where it's at in Amazon's EC2 Linux (and also tried a slash instead of space as I've seen both ways).

I am confused on URL mapping, servlet mapping, and where to create a cgi directory, so I tried it in just about every location within the /tomcat6/webapps, including the main geoserver directory. The only place I am able to access the cgi file in a browser is at the root. Why can I not make this happen in the geoserver directory, which is where I think it needs to be? I did not see instructions about changing the URL mapping, so I'm not positive it's the problem.

As suggested in several other questions posted on this site, I attempted to install the GeoServer Proxy Extension instead of configuring this stuff manually, but every time I tried to access it from the GS admin page, I got java errors (no matter which version of the extension I tried), so I gave up and went back to manual.

If it helps, here is some of my javascript, and I have tried just about every URL variation I could think of:


And the GeoExt part:

var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
             url: '',
             queryVisible: true,    
             exceptions: "application/vnd.ogc.se_xml",       
             layerUrls: ["",""],
                eventListeners: {
                    getfeatureinfo: function(e) {
                         new GeoExt.Popup({
                         title: "Feature Info",
                         width: 400,
                         height: 300,
                         autoScroll: true,
                         queryVisible: true,
                         map: map,
                         feature_count: 50,
                         lonlat: mapPanel.map.getLonLatFromPixel(e.xy),
                         html: e.text


I have also been getting these errors in my GeoServer logs:

2012-02-13 23:52:22,922 ERROR [config.XMLConfiguration] - Configuration file cannot be read or does not exist!
2012-02-13 23:52:22,923 ERROR [layer.TileLayerDispatcher] - Configuration /usr/share/tomcat6/webapps/geoserver/../resources contained no layers.
2012-02-13 23:52:22,924 ERROR [layer.TileLayerDispatcher] - Error reading service information from /usr/share/tomcat6/webapps/geoserver/../resources: Error parsing file /usr/share/tomcat6/webapps/geoserver/../resources/geowebcache.xml

I also get ones when a file cannot be found. This one happens to be an html file since it was just a test to see if I could figure out the paths, but the rest of them are for proxy.cgi:

2012-02-13 19:50:22,785 WARN [servlet.PageNotFound] - No mapping found for HTTP request with URI [/geoserver/OR_wild_wkspc/test.html] in DispatcherServlet with name 'dispatcher'

Last but not least, I also tried more paths to point to the .cgi file, as suggested here. But no matter what, I get this error in Chrome Developer:

XMLHttpRequest cannot load Origin http://www.greengeography.org is not allowed by Access-Control-Allow-Origin. OpenLayers.js:516Uncaught TypeError: Cannot read property 'x' of null

If you feel I should've been able to solve this given that there have been so many similar questions asked already, that's fine, but please don't downvote it, because I did do my research. Thanks!

share|improve this question
where to put cgi-bin folder ??? –  bgc Feb 19 at 11:08
Sorry, I don't have my server set up anymore, and I can't recall off the top of my head where to place that directory... –  travelampel Feb 19 at 23:10
add comment

1 Answer

up vote 2 down vote accepted

You should be pointing OpenLayers to a local proxy. Not the proxy on GeoServer.

For example, my OpenLayers.ProxyHost property is like:

OpenLayers.ProxyHost = "proxy/proxy.ashx?url=";

But you might want something like this:



enter image description here

share|improve this answer
@travelampel Did placing the proxy cgi in your openlayers local machine work? –  CaptDragon Feb 20 '12 at 19:52
YES, thank you for the input, and sorry for the delayed reply. However, the website on which the map will ultimately be placed may not be very accessible to me in terms of doing anything but adding an html file. That said, I ended up making the map on the same domain as my GeoServer, then using a full-page iframe on the destination site: greengeography.org/projects/oregonwild/tests/test2.html . I realize how cheeky this is, but it seems to work and bypasses the cross-domain issue entirely. –  travelampel Mar 11 '12 at 21:03
add comment

Your Answer


