Administration on Ubuntu

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

Note

This section is also applicable to those running the Boundless Suite virtual machine on any operating system.

Starting and stopping Boundless Suite services

Boundless Suite is comprised of two main services:

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

Note

The Tomcat service used by Boundless Suite is pulled in from standard repository sources, and (other than configuration) is not specific to Boundless Suite.

Controlling the Tomcat service

To start|stop|restart the Tomcat service:

service tomcat8 start|stop|restart

Other options in addition to the above are try-restart, force-restart, and status.

Controlling the PostgreSQL service

To start|stop|restart the PostgreSQL service:

service postgresql start|stop|restart

Other options in addition to the above are reload, force-reload, and status.

Note

If you have multiple versions of PostgresSQL installed you can specify which version to control with a third argument. For example:

sudo service postgresql start 9.6

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 system, in which case the ports must be changed.

Changing the Tomcat port

To change the Tomcat port:

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

  2. Search for the following line:

    <Connector port="8080" protocol="HTTP/1.1"
    
  3. Change the port value.

  4. Save the file.

  5. Restart Tomcat.

Note

If you are using a virtual machine, you will need to adjust the port forwarding settings in your virtualization software to ensure that the new port is accessible to the host machine.

Changing the PostgreSQL port

To change the PostgreSQL port:

  1. Edit the file /etc/postgresql/9.6/main/postgresql.conf.
  2. Search or the port property and change it to the desired value.
  3. Restart PostgreSQL.

Note

If you are using a virtual machine, you will need to adjust the port forwarding settings in your virtualization software to ensure that the new port is accessible to the host machine.

Working with Tomcat

Changing the Tomcat Java

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

  1. Download and install Oracle Java 8 JRE.

  2. Open /etc/tomcat8/tomcat8.conf and update the JAVA_HOME environment variable.:

    export $JAVA_HOME=/usr/lib/jvm/jre1.8.0_77
    

    Note

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

  3. Save and close the file.

  4. Restart Tomcat.

Adding other system parameters

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

  • To provide an environmental variable, open /etc/tomcat8/tomcat8.conf in a text editor, add the desired parameters to the bottom of the file, such as GDAL_DATA=/usr/share/gdal.

  • System properties are read in from the files in /etc/tomcat8/suite-opts/. So you could create a text file named memory and populate it with -Xmx2G. See the section on How to add startup parameters for GeoServer.

  • Context Parameters are application-specific, and are read in from the files in /etc/tomcat8/Catalina/localhost/. All parameters should be under the top-level <Context> tag. For example, the GeoServer data directory context parameter in /etc/tomcat8/Catalina/localhost/geoserver.xml looks like this:

    <Parameter name="GEOSERVER_DATA_DIR"
         value="/var/opt/boundless/suite/geoserver/data" override="false"/>
    

After making any changes, be sure to 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/opt/boundless/suite/geoserver/data.

To point GeoServer to an alternate location:

  1. Edit the file /etc/tomcat8/Catalina/localhost/geoserver.xml.

    Define GEOSERVER_DATA_DIR with an appropriate value accordingly.

    <Parameter name="GEOSERVER_DATA_DIR"
      value="/var/opt/boundless/suite/geoserver/data" override="false"/>
    
  2. 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/tomcat8/suite-opts/scale

    -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. Navigate to /etc/tomcat8/Catalina/localhost/ and edit the file geoserver.xml.

  2. Add the following context parameter to geoserver.xml:

    <Parameter name="GEOSERVER_GEOJSON_LEGACY_CRS" value="true" override="false"/>
    
  3. Restart Tomcat.

PostgreSQL configuration

PostgreSQL configuration is controlled within the postgresql.conf file. This file is located at /etc/postgresql/9.6/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.