3

GeoServer's web service base URL is http://localhost:8080/geoserver/www/. How can I change it to be just http://localhost:8080/ in order to link a domain name to my machine?

  • 1
    I think you can simply map a domain to the full /geoserver/www path, but it depends on how you want to interact with geoserver... our external server (will hide the link unless you want to see it) open-example.dpsk12.org/geoserver/web which can be mapped to any domain I would think... – DPSSpatial Dec 1 '18 at 1:13
  • As far as I see from my DNS service provider, a domain name can be mapped only to an IP address. Is there a way to resolve it on the local machine then? – yaugenka Dec 1 '18 at 14:50
  • Oh a local machine? I wouldn't want to do that... but hopefully someone can advise. – DPSSpatial Dec 1 '18 at 15:55
2

You have two options:

  1. Deploy Geoserver in a production environment per their documentation. This would mean you deploy it in a full-fledged server, not the one that's bundled with it. Most of these allow you to change the port they are listening to, and also the routing. Part of this is described here, but you would also need to follow the documentation of the container server of your choice, such as Tomcat or Jetty.
  2. Deploy a reverse proxy on your local machine. This is essentially another webserver that listens where you want your Geoserver to be, and then re-directs those requests to Geoserver at its default URL. This would mean you would not be able to keep it at http://localhost:8080/, but rather http://localhost/ (which defaults to 80) or some other port where you would like the server to listen to, such as http://localhost:9999/. Examples of web servers that can act as Reverse Proxy for Geoserver are Apache httpd, NGINX, and Microsoft IIS/

To speak to the comment about mapping DNS to that subdomain, that could also work. You would need to look for the CNAME type record in your DNS settings.

For most of these setups, make sure you adjust the Geoserver base url setting in the GUI or via another means.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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