Chapter 14. Configuration Sources
Configuration File on Specified Location |
Alternative Configuration Sources |
Priorities of Configuration Sources |
Specifying the Path to the Configuration File |
Once installed, CloverDX Server requires the configuration of essential
(database connection,
license,
sandboxes) and optional
(SMTP, LDAP,
SAML, etc.) features.
The configuration is done by specifying
configuration properties
in a [property-key]=[property-value]
format.
Important | |
---|---|
The configuration might contain sensitive data; therefore, CloverDX Server enables you to encrypt the configuration properties (for more information, see Chapter 18, Secure Configuration Properties). |
CloverDX can load the configuration properties from several sources. We recommend the easiest, most convenient way:
Configuration File on Specified Location
The cloverServer.properties
configuration file is a text file
which contains all CloverDX settings.
You can edit the file either manually, or using a
simple and intuitive Setup GUI.
Example of configuration file's content for PostgreSQL database:
# Modify the url, username and password for your environment. jdbc.driverClassName=org.postgresql.Driver jdbc.url=jdbc:postgresql://hostname/clover_db?charSet=UTF-8 jdbc.username=user jdbc.password=pass jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect
The path to the file can be specified by system property, context parameter or environment variable.
We recommend specifying the path with the
clover.config.file
system property.
Example for Apache Tomcat:
Edit bin/setenv.sh
(or bin\setenv.bat
) and add
-Dclover.config.file=/absolute/path/to/cloverServer.properties
to CATALINA_OPTS
.
For more information and examples on the supported application containers, see Specifying the Path to the Configuration File.
Alternative Configuration Sources
There are other sources of configuration properties, as well. Each source containing the configuration data has a different priority. If a property isn't set, application's default setting is used.
Warning | |
---|---|
Combining configuration sources could lead to a confusing configuration which would make maintenance much more difficult. |
Environment Variables
Environment variables are variables configured by means of your operating system (e.g.
$PATH
is an environment variable).There are two ways of configuration via environment variables:
direct override - using environment variables with the same name as the configuration properties and adding the
clover.
prefix. For example, the environment variableclover.sandboxes.home
will override the configuration propertysandboxes.home
.Some operating systems may not use a dot (
.
) character, so underlines (_
) may be used instead of dots. So theclover_config_file
name works as well.placeholders - configuration properties can reference environment variables using the
${env:ENVIRONMENT_VARIABLE}
syntax. For instance,sandboxes.home=${env:SANDBOXES_ROOT}
.Placeholders can be used in all CloverDX Server properties. If placeholder must not be resolved, use doubled '$' character, e.g.
security.ldap.user_search.filter=(sn=$${username})
.
System Properties
System properties are configured by means of JVM, i.e. with the
-D
argument (-Dclover.config.file
).Set a system property with the
clover.
prefix, i.e. (clover.config.file
).Underlines (
_
) may be used instead of dots (.
) so theclover_config_file
name works as well.System properties can also be referenced from within placeholders in all CloverDX Server properties. For instance,
sandboxes.home=${sys:user.home}/sandboxes
.Configuration File on Default Location
A text file containing configured CloverDX properties. By default, CloverDX searches for the file on the
[AppServerDir]/cloverServer.properties
path.Modification of Context Parameters in web.xml
This way isn't recommended, since it requires a modification of the WAR file, but it may be useful when none of the approaches above are possible.
Unzip
clover.war
and modify theWEB-INF/web.xml
file. Add the following piece of code into the file:<context-param> <param-name>[property-name]</param-name> <param-value>[property-value]</param-value> </context-param>
Context Parameters (Available on Apache Tomcat)
Some application servers allow you to set context parameters without modification of the WAR file.
This way of configuration is possible, but it is not recommended, as Apache Tomcat may ignore some context parameters in some environments. Using the configuration file is almost as convenient and much more reliable.
Example for Apache Tomcat:
On Tomcat, it is possible to specify context parameters in a context configuration file
[Tomcat_home]/conf/Catalina/localhost/clover.xml
which is created automatically just after deployment of the CloverDX Server web application.You can specify a property by adding this element:
<Parameter name="[propertyName]" value="[propertyValue]" override="false" />
(Note: by setting the
override
attribute tofalse
), the context parameter does not override the default setting associated with the owning host.)
Priorities of Configuration Sources
Configuration sources have the following priorities (from the highest to lowest):
Context parameters
Context parameters are specified in an application server or directly in a
web.xml
file (not recommended).External configuration file
The path to the external configuration file can be specified in several ways. CloverDX Server attempts to find the file in this order (only one of them is loaded):
the path specified with a
config.file
context parameter;the path specified with a
clover_config_file
orclover.config.file
system property (recommended);the path specified with a
clover_config_file
orclover.config.file
environment variable;the default location (
[AppServerDir]/cloverServer.properties
).
System properties
Environment variables
Default values
Specifying the Path to the Configuration File
Setup
uses the configuration file to save the Server's settings.
The path to the file is specified by the clover.config.file
system property.
Each application server has a different way to configure the path:
Apache Tomcat
Edit
bin/setenv.sh
(orbin/setenv.bat
) and add-Dclover.config.file=/absolute/path/to/cloverServer.properties
toCATALINA_OPTS
.See also Apache Tomcat.
JBoss Enterprise Application Platform
Edit the configuration file
/standalone/configuration/standalone.xml
and add the following snippet just under the<extensions>
section:<system-properties> <property name="clover.config.file" value="C:/jboss-eap-6.2/cloverServer.properties" /> </system-properties>
See also JBoss Enterprise Application Platform.
IBM WebSphere
Go to Integrated Solutions Console (default URL:
http://localhost:9060/ibm/console/
).Go to
→ → → → → → .Create a system property named
clover_config_file
whose value is a full path to the properties file (e.g.cloverServer.properties
) on your file system.
See also IBM WebSphere.
WebLogic
Set JAVA_OPTIONS variable in the WebLogic domain start script
[domainHome]/startWebLogic.sh
JAVA_OPTIONS="${JAVA_OPTIONS} -Dclover_config_file=/path/to/clover-config.properties
See also Oracle WebLogic Server.
Note | |
---|---|
Continue with: Chapter 16, System Database Configuration |