After installation: Working with OpenGeo Suite for Red Hat Linux

This document contains information about various tasks specific to OpenGeo Suite for Ubuntu Linux. For more details, please see the System administration section.

Starting and stopping OpenGeo Suite services

OpenGeo Suite is comprised of two main services:

  1. The Tomcat web server that contains all the OpenGeo web applications such as GeoServer, GeoWebCache, and GeoExplorer.
  2. The PostgreSQL database server with the PostGIS spatial extensions.

Note

The Tomcat service used by OpenGeo Suite is pulled in from standard repository sources, and is not specific to OpenGeo Suite.

Controlling the Tomcat service

To start/stop/restart the Tomcat service:

service tomcat start|stop|restart

Note

Depending on the distribution and version the service name may be one of “tomcat”, “tomcat5”, or “tomcat6”. Use the service command to determine which one is installed:

service --status-all | grep tomcat

Controlling the PostgreSQL service

Before PostgreSQL service can be started it must first be initialized:

service postgresql-9.3 initdb

To start/stop/restart the PostgreSQL service:

service postgresql-9.3 start|stop|restart

Service port configuration

The Tomcat and PostgreSQL services run on ports 8080 and 5432 respectively. These ports can often conflict with existing services on the systemk, in which case the ports must be changed.

Changing the Tomcat port

To change the Tomcat port:

  1. Edit the file /etc/tomcat/server.xml.

    Note

    Depending on the distribution and version replace “tomcat” with “tomcat5” or “tomact6” accordingly. Use the service command to determine which one is installed:

    service --status-all | grep tomcat
    
  2. Search for “8080” (around line 75) and change the port attribute to the desired value.

  3. Restart tomcat.

    service tomcat restart
    

Changing the PostgreSQL port

To change the PostgreSQL port:

  1. Edit the file /var/lib/pgsql/9.3/data/postgresql.conf.

  2. Search or the port property (around line 63), uncomment and change it to the desired value.

  3. Restart PostgreSQL.

    service postgresql-9.3 restart
    

Working with Tomcat

Changing the Tomcat Java

If you wish to use the Oracle Java 7 JRE (rather than the OpenJDK 7 installed by default):

  1. Download and install Oracle Java 7 JRE.

  2. Open /etc/sysconfig/tomcat and update the JAVA_HOME environment variable.

    Note

    Make sure the line is uncommented (does not start with #).

  3. Save and close the file.

  4. Restart Tomcat.

Using OpenGeo Suite with custom Tomcat

OpenGeo Suite packages can be used to manage the contents /usr/share/opengeo components while making use of your own Tomcat application server.

  1. Install OpenGeo Suite.

  2. Stop your Tomcat service.

  3. Navigate to /etc/tomcat/Catalina/localhost/.

  4. Create the geoserver.xml with the following content:

    <Context displayName="geoserver"
             docBase="/usr/share/opengeo/geoserver"
             path="/geoserver"/>
    
  5. Create the geowebcache.xml with the following content:

    <Context displayName="geowebcache"
             docBase="/usr/share/opengeo/geowebcache"
             path="/geowebcache"/>
    
  6. Create the dashboard.xml with the following content:

    <Context displayName="dashboard"
             docBase="/usr/share/opengeo/dashboard"
             path="/dashboard"/>
    
  7. Create the geoexplorer.xml with the following content:

    <Context displayName="geoexplorer"
             docBase="/usr/share/opengeo/geoexplorer"
             path="/geoexplorer"/>
    
  8. Create the docs.xml with the following content:

    <Context displayName="docs"
             docBase="/usr/share/opengeo/docs"
             path="/docs"/>
    
  9. Restart Tomcat.

Adding other system parameters

You can add other system or application-specific parameters that will be picked up upon restart.

  1. Open /etc/sysconfig/tomcat in a text editor.
  2. Add the desired parameters to the bottom of the file.
  3. Save and close the file.
  4. Restart Tomcat.

Working with GeoServer

GeoServer Data Directory

The GeoServer Data Directory is the location on the file system where GeoServer stores all of its configuration, and (optionally) file-based data. By default, this directory is located at: /var/lib/opengeo/geoserver.

To point GeoServer to an alternate location:

  1. Edit the file /usr/share/opengeo/geoserver/WEB-INF/web.xml.

  2. Search for GEOSERVER_DATA_DIR section, uncomment, and change its value accordingly.

    <context-param>
       <param-name>GEOSERVER_DATA_DIR</param-name>
        <param-value>/path/to/new/data_dir</param-value>
    </context-param>
    
  3. Restart Tomcat.

Enabling spatial reference systems with Imperial units

A fix is available for spatial reference systems measured in Imperial units (feet). This setting is recommended for all users, and strongly recommended for those working with US State Plane projections measured in feet.

To enable this fix:

  1. Add the following parameter to /etc/sysconfig/tomcat:

    -Dorg.geotoools.render.lite.scale.unitCompensation=true
    
  2. Restart Tomcat.

Update GeoJSON output

GeoServer GeoJSON output is now provided in x/y/z order as required by the specification. In addition, the crs output has changed to support full URN representation of spatial reference systems:

"crs": {
   "type": "name",
   "properties": {
      "name": "urn:ogc:def:crs:EPSG::4326"
   }
}

Note

Previously, the output was:

"crs": {
   "type": "EPSG",
   "properties": {
      "code": "4326"
   }
}

To restore the previous crs representation for compatibility reasons (especially when working with OpenLayers 3):

  1. Add the following context parameter to /usr/share/opengeo/geoserver/WEB-INF/web.xml:

    <context-param>
        <param-name>GEOSERVER_GEOJSON_LEGACY_CRS</param-name>
        <param-value>true</param-value>
    </context-param>
    
  2. Restart Tomcat.

PostgreSQL configuration

PostgreSQL configuration is controlled within the postgresql.conf file. This file is located at /etc/postgresql/9.3/main/postgresql.conf.

You will want to ensure that you can connect to the database. Please see the section on Connecting to PostgreSQL on Linux for the first time to set this up.