1

I’m in the middle of a prototype migration/deployment and have really hit a wall serving up my layers from geoserver. I’ve geoserver running from the “stand-alone” version running in jetty on one port and the webapp running in tomcat on another port. The webapp requests data from geoserver via localhost. This setup works fine on my laptop where I initially developed the prototype. Since moving everything to a server on the intranet, the webapp can request layers from geoserver, geoserver handles the request, and the webapp never gets anything returned. What’s even stranger, is if the prototype’s code is run a other hosts and requests data from the aforementioned geoserver, it gets data just fine. The webapp can successfully access remote WMS layers directly (not from, or cascaded by, my geoserver).

The laptop is running geoserver 2.3.0 and tomcat 7, both from an openSuSE 13.2 rpms, and Oracle's java 1.7.0_79. The server is running geoserver 2.7.2 (downloaded), and tomcat 7 and OpenJDK 1.7.0_85 from CentOS 7 rpms.

  • Any log errors on geoserver or the client app side? – artwork21 Sep 2 '15 at 11:35
  • None. I believe it to be a cross-origin issue since I got around the problem by specifying the server's IP instead of localhost, but I'd like to find a better solution. – Scottso Sep 4 '15 at 17:56
1

Did you also install Apache? You need to install an Apache Httpd Server (https://httpd.apache.org/) in the front (e.g. Port 80) and connect Tomcat and Jetty via mod_proxy/AJP so that Apache connects them to the same origin.

I am not quite sure how this is configured in Jetty as I have two parallel Tomcat Servrs installed and connected via Apache as described in the following answer. My geoserver is installed using the Geoserver.war file.

It might help to check the following sites for Jetty

In Tomcat this can be done in the Tomcat7/conf/server.xml file by enabling the Connector-Port (if that was not already done during Installation):

<Connector port="8009" protocol="AJP/1.3"

And the Apache conf/httpd.conf file must have the mod_proxy enabled by removing the "#" in front of the following lines:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

and inserting the following "ProxyPass" code. For example like this

ProxyPass /geoserver ajp://localhost:8009/geoserver

Some related articles can be found here:

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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