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.
- 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.
- Visit the GeoServer home page at www.geoserver.org and click the Download link.
- Choose to download the Maintenance version (version 2.12.3 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.
- Choose the Windows Installer and run geoserver-2.x.x.exe. (Do not click "Start Download" if you see it. This is an ad.)
- 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.
- 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.
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.
- 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.
- 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:
- 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.
- In the left-hand menu, click Layer Preview.
- Scroll down to the Tasmania state boundaries layer and click the OpenLayers link.
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.
- 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.
- 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.
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.