Change the configuration directory
| This how-to describes how you can change the path of the configuration directory from which security.manager for OGC reads its configuration. |
As described in the section about security.manager for OGC directories, the configuration directory is by default identical to the data directory. So if you change the data directory, you change the path of the configuration directory, too.
However, it may make sense to set the path of the configuration directory independently of the data directory.
This document describes two ways you can specify any path from which the configuration files should be read:
Prerequisites
-
You are running security.manager for OGC in an Apache Tomcat.
-
You have the rights to modify the Tomcat configuration or the security.manager web app directory.
Set path via environment variable
One way to specify the location of the configuration files is to use the environment variable CONFIG_DIRECTORY_LOCATION.
For example, to use the directory /opt/secman-ogc/config as the storage location, set the environment variable as follows:
CONFIG_DIRECTORY_LOCATION=/opt/secman-ogc/config
security.manager for OGC will then load all configuration files from the directory /opt/secman-ogc/config.
This means that you need to place the server configuration, for example, in the file /opt/secman-ogc/config/server-config.json.
How you set the Tomcat environment variable depends on your operating system and how you start Tomcat.
Set path via custom-application.properties
This method for customizing the configuration directory requires you to modify the file custom-application.properties in the folder of the unpacked web app.
It has the disadvantage that you have to repeat the customization every time you update or reinstall the web app as part of an update of security.manager for OGC.
In the following it is assumed that you have copied the security.manager for OGC web app as a WAR file to the Tomcat webapps folder.
If you have installed security.manager for OGC as described in the installation documentation, this is the case.
To load the configuration files from the directory /opt/secman-ogc/config, for example, proceed as follows:
-
Locate the directory
[TOMCAT]/webapps/secman-ogc/WEB-INF/classesof the security.manager for OGC web app. -
Create the file
custom-application.propertiesin the located directory. -
Add the following line:
custom-application.propertiesconfig.directory.location=/opt/secman-ogc/config -
Save the file.
-
Make sure the specified directory exists and contains the necessary configuration files.
-
Restart Tomcat.
Check the log file of security.manager for OGC to ensure that the configuration files were loaded from the specified directory.