0

I followed Steven's excellent tutorial to setup Geoserver on a Tomcat7 gear on Openshift. This works relatively well. The main issue being that the gear doesn't restart. I build the gear three times now. The first two times the gear did not come alive again. I waited a few good hours before I deleted and rebuilt the application. I deploy the Geoserver 2.7 war as ROOT in my build.

The next problem is of course the CORS setting. Geoserver on Openshift is useless if I cannot access the services from my other applications. I have tested a reverse proxy to access Geoserver. This works but is slow. I would prefer a server side CORS solution. From version 7.0.41 Tomcat supports CORS. I do not know how this can be enabled on OpenShift. I also don't know which is the exact version of Tomcat 7 (JBoss EWS 2.0) which is run by OpenShift.

As always, any help or comments are welcome. Thx, Dennis

Dennis Bauszus
  • 1,624
  • 2
  • 19
  • 44
  • Possible duplicate of [Set CORS header in Tomcat](http://stackoverflow.com/questions/16296145/set-cors-header-in-tomcat) – BalusC Nov 11 '15 at 08:55

1 Answers1

0

Just to confirm, the current version of Tomcat 7 (JBoss EWS 2.0) supports CORS.

All I did was to edit .openshift/config/web.xml and add following filter:

.openshift/config/web.xml

<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

I push the changes to my openshift gear and two minutes later my service is available again.

Not sure what has changed, but my cartridges started just fine this time.

Dennis

EDIT: I put a more detailed explanation of the setup on my blog.

Dennis Bauszus
  • 1,624
  • 2
  • 19
  • 44