Configuring GeoNode for Production

This page documents recommendations for configuring GeoNode in production environments. The steps mentioned in the first section are required to run GeoNode, the ones in the second section are either optional or ways to get more performance.

Note

This document makes numerous references to the <host> variable, please replace it with the IP Address of your GeoNode or the DNS entry.

For example: instead of http://<host>/geoserver, write down: http://mygeonode.com/geoserver or http://127.0.0.1/geoserver

Required steps

Creating a super user

To create a superuser you can run:

$ geonode createsuperuser

or, if you installed by source:

$ source path/to/geonode/virtualenv/bin/activate
$ django-admin.py createsuperuser --settings=geonode.settings

Once your user is created, you can navigate to your site using the IP address or hostname and log in.

Note

Don’t forget to change the SITEURL as explained in the next step before uploading data.

Configuring the correct DNS or IP address

By default GeoNode runs in http://localhost/, but when running in production it needs to know the public IP address or the DNS entry.

To configure it, edit the SITEURL setting in local_settings.py (which can be found either in your GeoNodePy/src/geonode folder or in /etc/geonode/local_settings.py if you used an automated installer, for example:

SITEURL='http://127.0.0.1/'

Once that it is changed you have to re-start the apache server:

$ sudo service apache2 restart

Warning

Don’t forget the trailing slash, because it is used to construct the GEOSERVER_BASE_URL param.

Set the correct GeoServer Proxy URL value

Navigate to http://localhost/geoserver, log in and click on the Global link in the Settings section.

../_images/geoserver_global_settings.png

Find the Proxy Base URL text field, put the complete address there:

http://<host>/geoserver/
../_images/geoserver_proxy_url.png

Configure the Printing Module

This lives in the GeoServer Data dir /var/lib/geoserver/geonode-data/printing/config.yaml, add your server’s IP address or domain name to the list of exceptions:

hosts:
  - !dnsMatch
    host: YOUR_IP_ADDRESS
    port: 80

GeoServer Configuration

There are a few controls to be set in the GeoServer configuration itself as well.

On the JAI Settings page

../_images/GeoServer-JAI-Settings.png

There are two considerations for the JAI settings.

  • Enable JPEG and PNG Native Acceleration to speed up the performance of WMS requests
  • Disable Tile Recycling as this optimization is less relevant on recent JVM implementations and has some overhead itself.

On the WMS Service page

../_images/GeoServer-Web-Map-Service.png

There is only one consideration for the Web Map Service page

  • Don’t set the “Resource Consumption Limits.” This sounds a bit counterintuitive, but these limits are implemented in an inefficient way such that unless resource-intensive requests are common on your server it is more efficient to avoid the limits. A better implementation of this feature is available for GeoServer 2.1 and will be incorporated in GeoNode 1.1.

Printing with the Mapfish Print Service

The GeoNode map composer can “print” maps to PDF documents using the Mapfish print service. The recommended way to run this service is by using the printing extension to GeoServer (if you are using the pre-built GeoNode package, this extension is already installed for you). However, the print service includes restrictions on the servers that can provide map tiles for printed maps. These restrictions have a fairly strict default, so you may want to loosen these constraints.

Adding servers by hostname

The Mapfish printing module is configured through a YAML configuration file, usually named print.yaml. If you are using the GeoServer plugin to run the printing module, this configuration file can be found at GEOSERVER_DATA_DIR/printing/config.yaml. The default configuration should contain an entry like so:

hosts:
  - !dnsMatch
    host: labs.metacarta.com
    port: 80
  - !dnsMatch
    host: terraservice.net
    port: 80

You can add host/port entries to this list to allow other servers.

See also

The Mapfish documentation on configuring the print module.

The GeoServer documentation on configuring the print module.