Application Properties¶
While many configuration and setup options are available through the Web Administration application Settings > Global page, more fundamental (and security minded) changes to how the application operates are made using "Application Properties" defined by:
- Java System Properties
- Web Application context parameters
- System Environmental Variable.
As part of the operating environment GeoServer application properties, unlike settings, cannot be changed at runtime.
Setting Application property¶
Application properties are determined using the first value obtained from: Java System Properties, Web Application context parameters, or System Environmental Variable.
See also:
- Application Properties
- Set Java startup options
- Configure
GEOSERVER_DATA_DIRECTORYto point to an external folder.
Using GEOSERVER_DATA_DIR as an example:
-
Java System Properties: Supplied to the java virtual machine as part of your application server configuration.
-
For Tomcat on linux edit
setenv.shto append additional java system properties: -
For Tomcat on windows use Apache Tomcat Properties application, navigating to the Java tab to edit Java Options:
While not commonly used for GEOSERVER_DATA_DIR, this approach is a popular way to enable/disable optional geoserver functionality.
See Set Java startup options for more details.
-
-
Web Application context parameter:
-
Recommended: Use your application server to configure the GeoServer web application via
conf/Catalina/localhost/geoserver.xmlfile:<Context docBase="geoserver.war"> <Parameter name="GEOSERVER_DATA_DIR" value="/var/opt/geoserver/data" override="false"/> </Context>This is the approach documented in our setup instructions for GEOSERVER_DATA_DIR and is recommended.
Note
Tomcat management of application properties as using
overide="false"is not the most straight forward to understand. This setting prevents theWEB-INF/web.xmlincluded in thegeoserver.warto overide the provided file location.Other application servers provide a user inteface to manage web application properties and are more intuitive.
-
Not recommended: Hand editing the
webapps/geoservere/WEB-INF/web.xmlfile:<context-param> <param-name>GEOSERVER_DATA_DIR</param-name> <param-value>/var/lib/geoserver_data</param-value> </context-param>Note
This file is part of the GeoServer application and will be replaced when updating the application.
As a result this approach is error prone making updates more difficult and is not recommended.
-
-
Operating environmental variable:
This approach can be useful for GEOSERVER_DATA_DIR when running GeoServer in a docker container, traditionally managed with environmental variables.
GeoTools system properties¶
The GIS library used by GeoTools for working with spatial data has a number of configuration options avaialble as system properties.
-
Recommended:
org.geotools.referencing.forceXY=trueThe official EPSG database specifies ordinates following the scientific tradition of most accurate value first. Many computer systems assume that the order should follow easting / northing order (corresponding to x / y pixel order on screen).
This setting is recommended for greater compatibility with a wider range of web services.
Reference: Axis Order
-
Optional:
org.geotools.referencing.operation.order=AreaFirstWhen choosing a math transform between coordiante reference systems GeoTools defaults to an
AccuracyFirstsetting. For greater compatibility with PROJ systems anAreaFirstsetting may be used, prioritizing math transforms that covers a larger area.Reference: Coordinate operations tuning