GEOG 585
Open Web Mapping

Walkthrough: Setting up GeoServer

Print

GeoServer is free and open source software (FOSS) that exposes your data as geospatial web services. You'll be using GeoServer later in this course and possibly in your term project if you choose. This week, we'll take some time to get GeoServer installed and configured. This is a detour from our discussion of web map elements, but you'll soon revisit that topic in the weekly assignment.

Again, the lesson materials provide instructions for Windows. You are welcome to install on another platform, but you are on your own for instructions and troubleshooting.

  1. If you do not already have Java on your computer, visit the Java download page and install the latest version of Java. Make note of the file system location where you install it. You will need this when you set up GeoServer. In case that a new Java version will be released during the course and your computer asks you whether it should install the update, be warned that GeoServer may stop working if you decide to do so, until you adapt the Java path in the GeoServer startup .bat file.
  2. Visit the GeoServer home page at www.geoserver.org and click the Download link.
  3. Choose to download the Maintenance version (version 2.10.5 at the time of this writing) by clicking the version number. Make sure you click the link with the version number and not the link that says "Nightly builds".
    As you progress with FOSS, you may get more adventurous and want to download the latest "bleeding edge" build to get the newest features, but, for this course, we are going to play it safe.
  4. Choose the Windows Installer and run geoserver-2.x.x.exe. (Do not click "Start Download" if you see it. This is an ad.)
  5. Continue through the installer and accept the default settings on each wizard page. When prompted for the JRE (Java Runtime Environment) location, you need to browse down to the folder where you installed Java and choose the JRE subfolder. If you're using Windows, this is probably C:\Program Files (x86)\Java\jre8 or C:\Program Files (x86)\Java\jre1.8.x  or something similar. The installer will tell you whether you have selected a folder with a valid JRE.

    I am asking you to accept all the defaults in the wizard so that it is easier to help troubleshoot later if needed. Obviously, in a professional environment, you would select something other than the default administrator name and password admin/geoserver and you might install onto a port other than 8080.
  6. Once GeoServer is installed, start it by clicking Start > All Programs > GeoServer 2.x.x > Start GeoServer.

    You'll see a bunch of status messages appearing in a black and white console, like the following.
     
     Screen capture: Start GeoServer
    Figure 2.2 This is the image caption.
    Wait a second for the messages to stop appearing, then go on to the next step. (If you keep this window open, you'll see messages appear as you interact with GeoServer. This is okay, and may even help you with troubleshooting.)

    If you get a Windows Security Alert that Windows Firewall has blocked some features of the program, check the top box to allow it to run on private networks and click Allow access. Uncheck the bottom box, as public access will not be needed in this course.
  7. Click Start > All Programs > GeoServer 2.x.x > GeoServer Web Admin Page (or go to your browser and enter the address localhost:8080/geoserver/web).

    This is a web page that you can use to administer GeoServer from this or any other computer in your network. You might be wondering, "How did my machine get the ability to serve out web pages?" This is possible because GeoServer includes a servlet called Jetty, which allows your machine to respond to web service and web page requests without having a full-blown web server software package installed.

    In an enterprise environment, you would install GeoServer onto your existing web server such as Apache Tomcat, and it is very possible that you will need to do this sometime in the future. The process is straightforward enough that I was able to do it following this instructional YouTube video even though the video is not in English; however, for the assignments in this class, please use the Jetty server and only attempt the Tomcat install if Jetty is not working. My intent is to keep everyone on as close to the same environment as possible, so that I can be more helpful with troubleshooting if needed.
  8. Type a GeoServer username and password in the upper boxes and click Login. You may remember that the installation created an administrative user with the username admin and the password geoserver. You must use this the first time you log in.

    You will see a welcome page similar to the following:
     
     Screen capture: GeoServer Welcome page
    Figure 2.3
  9. Rather than working with files that represent an entire map, like .mxd or .qgs, GeoServer works with the concept of layers and layer groups. You define a set of datasets that you want to have exposed on your server, and then you define what characteristics they'll exhibit when brought into web maps as web service layers.
    GeoServer comes with a bunch of sample layers already loaded. Let's take a look at those.
  10. In the left-hand menu, click Layer Preview.
     
     Screen capture: Layer Preview link
    Figure 2.4
  11. Scroll down to the Tasmania state boundaries layer and click the OpenLayers link.
     
     Screen capture: OpenLayers preview link
    Figure 2.5
    This displays your map as a web service that you can navigate. The web service was delivered through the Open Geospatial Consortium (OGC) Web Map Service (WMS) specification, an openly documented way of serving web maps that you'll learn more about in Lesson 4. The map frame and navigation buttons were created through the OpenLayers JavaScript framework.

    It's important to understand that you also could have done this by clicking the dropdown list and choosing WMS > OpenLayers. Looking at this list, you get a better idea of the many different output formats supported by GeoServer.
     Screen capture: Layer preview options
    Figure 2.6
    Let's try one of these other options.
  12. Close the map preview window and return to the GeoServer layer preview list. This time, click the KML link to get the layer as KML, and XML-based open specification for geographic data, often used by Google. If you have Google Earth installed, the layer should open there. If you don't have Google Earth, you can open the layer in Notepad and just examine the raw KML.

    In addition to requesting many layer formats, you can request groups of layers together if they have been configured as a group layer. GeoServer comes with a few preconfigured group layers.
  13. In the GeoServer layer preview list, scroll down to the Tasmania group layer (symbolized by green squares). Using the techniques you have learned, preview this in OpenLayers.
     
     Screen capture: Preview group layer in OpenLayers
    Figure 2.7
    Here, you see three layers that have been delivered together as one map.
     
     Screen capture: Result of group layer preview
    Figure 2.8

You'll return to GeoServer later in this course. This walkthrough just ensures you have it up and running correctly. If technical difficulties prevented you from getting to this point, please alert your instructor.