Deploying the Enterprise Gateway in Multiple Environments

Contents

Overview

You can specify configuration values in the Enterprise Gateway on a per-environment basis using environment variables in the envSettings.props file. For example, you can specify the port on which the Enterprise Gateway listens for HTTP traffic with different values depending on the environment in which the Enterprise Gateway is deployed.

The environment variable settings in the envSettings.props file are external to the Enterprise Gateway core configuration. The Enterprise Gateway runtime settings are determined by a combination of external environment variable settings and core configuration polices. This mechanism provides a simple and powerful approach for configuring the Enterprise Gateway to work across multiple environments.

The envSettings.props file is located in the conf directory of your Enterprise Gateway installation, and is read each time the Enterprise Gateway server starts up. The environment variable values specified in the envSettings.props file are displayed as environment variable properties in the Policy Studio.

Configuring Environment Variables

The envSettings.props file enables you to externalize configuration values and set them on a per-environment basis. This section shows the configuration syntax used, and shows some example values in this file.

Environment Variable Syntax
If the Enterprise Gateway server configuration contains a property with a format of ${env.X}, where X is any string (for example, MyCustomSetting), the envSettings.props file must contain an equivalent name-value pair with the following format:

env.MyCustomSetting=MyCustomValue

When the Enterprise Gateway server starts up, every occurrence of the ${env.MyCustomSetting} property is expanded to the value of MyCustomValue. For example, by default, the HTTP port in the server configuration is set to ${env.PORT.TRAFFIC}. Specifying a name-value pair of env.PORT.TRAFFIC=8080 in the envSettings.props file results in the server opening up port 8080 at start up.

Example Settings
The following simple example shows some environment variables set in the envSettings.props file:

# the default port which the Gateway listens on for HTTP traffic
env.PORT.TRAFFIC=8080

# the default port which the Gateway listens on for management/configuration HTTP traffic
env.PORT.MANAGEMENT=8090

The following example screenshot shows the corresponding ${env.PORT.TRAFFIC} property displayed in the Configure HTTP Interface dialog. At runtime, this property is expanded to the value of the env.PORT.TRAFFIC environment variable specified in the envSettings.props file:

Environment Variable in Policy Studio

Environment Variable in Policy Studio

Important Note:
All entries in the envSettings.props file must use the env. prefix, and all properties specified in the Policy Studio must use the ${env.*) syntax. If you update the envSettings.props file, you must restart or deploy the Enterprise Gateway for updates to be applied to the currently running Enterprise Gateway configuration.

Configuring Certificates as Environment Variables

You can also use the envSettings.props file to bind a reference to a server host-specific SSL certificate to a specific deployment.

Example Syntax:
The following entry shows an example of the environment variable syntax used to specify a server host-specific certificate:

env.serverCertificate=${system.prefix.cert}MY_ALIASED_CERT_NAME

Alternatively, the following entry shows the syntax when the alias is the same as the Distinguished Name:

env.serverCertificate=${system.prefix.cert}CN=MY_HOST

Example Settings
When the env.serverCertificate variable is specified in the envSettings.props file, the X.509 Certificate field in the Configure HTTPS Interface dialog can then reference its value using the ${env.serverCertificate} property. The following example screenshot shows the corresponding ${env.serverCertificate} property specified at the bottom of the Select Certificate dialog, which is displayed by pressing the X.509 Certificate button:

Referencing a Certificate Environment Variable in Policy Studio

Referencing a Certificate Environment Variable in Policy Studio

The following example screenshot then shows the ${env.serverCertificate} property referenced in X.509 Certificate field:

Certificate Environment Variable in Policy Studio

Certificate Environment Variable in Policy Studio

Important Note:
In the envSettings.props file, you must specify commas using \\ escape characters. For example:

env.serverCertificate=${system.prefix.cert}CN=
linux-test-desktop\\,OU=QA\\,O=Saturn Inc.\\,L=Dublin\\,ST=Dublin\\,C=IE