Book Image

Mastering Geoserver

By : Colin Henderson
Book Image

Mastering Geoserver

By: Colin Henderson

Overview of this book

Table of Contents (19 chapters)
Mastering GeoServer
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Deploying GeoServer to Apache Tomcat


We are getting there for a basic configuration of GeoServer, which we can use as a basis to architect our production environment for high-availability, failover, and scalability. Now we need to deploy GeoServer into Apache Tomcat, which is happily a straightforward process.

We will utilize Apache Tomcat's auto-deploy feature that allows us to copy the GeoServer WAR (Web Archive) file directly to appBase of a running Tomcat instance. Tomcat will detect the presence of the WAR file, and then deploy it ready for use.

First, we need to download the WAR file from the GeoServer download page at http://geoserver.org/release/Stable. At the time of writing, the current stable version of GeoServer is 2.5.2:

Click on the Web Archive link and save the downloaded ZIP file somewhere it is accessible.

Deploying on CentOS 6.3

Deployment of GeoServer on CentOS is a very straightforward process, thanks to the way Tomcat is architected. WAR files can automatically be deployed by copying them to a specific location in the Tomcat home directory.

Download the WAR file to a location on your system, for example, your home directory:

$ cd ~
$ wget http://sourceforge.net/projects/geoserver/files/GeoServer/2.5.2/geoserver-2.5.2-war.zip

The WAR file that we want to deploy to GeoServer is contained within the downloaded ZIP file, so we need to extract this from the Tomcat appBase directory:

$ sudo unzip geoserver-2.5.2-war.zip *.war –d $CATALINA_HOME/webapps/

This command will only extract the geoserver.war file from the ZIP file and place it in the Tomcat appBase directory. Tomcat will then autodeploy the WAR file, and you should see a geoserver directory appear.

Deploying on Windows Server 2008 R2 SP1

Deploying the GeoServer WAR file on Windows follows the same process as that of Linux. The WAR file is copied in the Tomcat home directory, where it is unpacked and the GeoServer context started.

The following steps are required to deploy the GeoServer WAR file in Tomcat:

  1. Download the WAR file to a location on your system, for example, the Downloads folder within your home directory.

  2. Double-click on the geoserver-2.5.2-war.zip file to open it in Windows Explorer (assuming you do not have another ZIP application installed).

  3. Drag and drop the geoserver.war file from the ZIP folder to the webapps folder in your Tomcat service home directory. If you followed the steps to install Tomcat on Windows, then this directory will be C:\Tomcat7-1\webapps:

  4. After dropping the file into the folder, Tomcat will autodeploy it and a directory called geoserver will appear.

Checking GeoServer deployment

We should now have a basic configuration of GeoServer deployed inside an Apache Tomcat instance. Test that GeoServer was successfully deployed by opening a web browser and navigating to the GeoServer administration interface:

http://[your server address]:8080/geoserver

If everything worked as expected, then we should be presented with the GeoServer administration interface's front page: