Please note that these documents apply to OpenShift Online v2 only (accounts created before August 1st, 2016).
If you are using one of the OpenShift 3 products, please refer to documents available at docs.openshift.com.

Tomcat Environment Variables

The Tomcat cartridge provides several environment variables to reference for ease of use:

Variable Name Purpose

OPENSHIFT_JBOSSEWS_IP

The IP address used to bind EWS

OPENSHIFT_JBOSSEWS_HTTP_PORT

The EWS listening port

OPENSHIFT_JBOSSEWS_JPDA_PORT

The EWS JPDA listening port

JAVA_OPTS_EXT

Appended to JAVA_OPTS prior to invoking the Java VM

For more information, consult the Environment Variables guide.

Environment Variable Replacement Support

The jbossews cart provides special environment variable replacement functionality for some of the Tomcat configuration files. For the following configuration files:

  • .openshift/config/server.xml

  • .openshift/config/context.xml

Ant-style environment replacements are supported for all OPENSHIFT_-prefixed environment variables in the application. For example, the following replacements are valid in server.xml:

<Connector address="${OPENSHIFT_JBOSSEWS_IP}"
           port="${OPENSHIFT_JBOSSEWS_HTTP_PORT}"
           protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />

During server startup, the configuration files in the source repository are processed to replace OPENSHIFT_* values, and the resulting processed file is copied to the live Tomcat configuration directory.