1

I would like to host a website, which is addressable as a sub-domain of my GeoServer. For example http://mygeoserver.com:8080/geoserver/web/my_website.html.

My question is: where do I have to place the html file in my folder structure so that I can access and run it with the http request above? How can I make the web page available in the web directory of GeoServer?

The GeoServer is installed under Ubuntu.


Edit (1):

Thanks for your comment BradHards.

Background: The background to my question is that I want to have an html file with an OpenLayers WMS map, which shows my GeoServer data. In this map I need WFS as an overlay to the WMS map. Up to now, I can run the HTML file with WMS fine, but I can't get the WFS overlay to work. In this forum thread (WFS layer not showing?) someone mentioned a hint according to which the OpenLayers/WMS/WFS html file must be located within the GeoServer web directory in order to get it to work.

My steps: First I installed Tomcat6 under Ubuntu 12.04 LTS (sudo apt-get install tomcat6). After that, I installed the GeoServer version 2.2-SNAPSHOT (apt-get install opengeo-geoserver). It is running well.

My tries: I tried a bit for myself and I am close to a solution. In the folder "var/lib/tomcat6/webapps/geoserver/data/www" are two HTML demo files, ol-demo.html as demo for OpenLayers and wfs-t.html as demo for WFS-T. I can successfully call these files in the browser (localhost and from remote) by (http://myaddress.com/geoserver/www/ol-demo.html). But when I additionally place my HTML file in this folder I can't reach them from the browser in an analogous way. Instead: HTTP 404 the requested resource() is not available.

Hope this helps to be able to better answer my question.

1
  • Welcome to gis.se. Can you tell us more about how you installed your GeoServer instance? There are a range of ways to do it, and your question doesn't tell us which one you did. Without that information, it'll be hard to help you. Can you click "edit" below the question and add some more details such as how you installed GeoServer, which version, what you've already looked at, what you already tried and what the results were?
    – BradHards
    Mar 22, 2014 at 23:09

1 Answer 1

3

Ciao, placing static things inside the www directory of the geoserver data directory should work.

Check this docs: GeoServer - serving HTML files http://docs.geoserver.org/latest/en/user/tutorials/staticfiles.html

So you might want to dig a bit more to find the error.

We use that approach in some small scale apps ourselves like this one: http://www.fao.org/figis/geoserver/factsheets/rfbs.html

Some observations: -1- you are not using the vanilla geoserver which does not ship as deb package. I would install tomcat and use the standard GeoServer you can get from the distribution website. To be extremely onest, I would also put down Apache HTTP or NGinx and I would use one of them to serve static content. Mapping GeoServer through the same domain would allow you to NOT have any problems with CORS limitations. This is opinion of course.

-2- The version you are getting (which is not the standard GeoServer) is very old and unsupported, are you sure it is the version you want to use? I wouldn't :)

Ciao, Simone.

2
  • Thanks for your answer simogeo. The hint concerning the GeoServer version was the solution. I downloaded and installed GeoServer 2.5 and did all the same as described and it works now. It seems as if GeoServer 2.2 is not able to host custom static web content in the www folder.
    – steffen
    Mar 24, 2014 at 0:08
  • Honestly, It should have been able to do that. It might have been a bug on that (old) version.
    – simogeo
    Mar 24, 2014 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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