Protecting Configuration Settings

This step is optional and required only if it is your company's policy not to store passwords with configuration files. These files are not in any way accessible by an end user, so this capability simply provides an added level of security by abstracting the passwords and primary server information to become environment variables within the server.

This capability moves configuration settings out of the Configuration.properties file, and instead stores them as environment variables which are read at the time of the Apache Tomcat startup.

Any setting within the Configuration.properties file can be defined this way, but for the purpose of example, we will choose the following settings:

DB_HOST
DB_USER
DB_PASSWORD
DB_URL

The following steps will remove all of the above configuration settings from the Configuration.properties file.

Unix / Linux / Solaris

First, define environment variables which will contain the values that will be used at ExtraView startup:

export DB_HOST=extraview.yourcompany.com
export DB_USERNAME=extraview
export DB_PASSWORD=password
export DB_URL=’jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST= extraview.yourcompany.com)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=ev )))’

Then, edit your Configuration.properties file to tell ExtraView which environment variables to look for:

cd /usr/local/extraview/tomcat/webapps
vi evj/WEB-INF/configuration/Configuration.properties

Replace the actual configuration settings with the name of your environment variable, surrounded by ‘$$’:

DB_HOST = $$DB_HOST$$
DB_USER = $$DB_USERNAME$$
DB_PASSWORD = $$DB_PASSWORD$$
DB_URL = $$DB_URL$$

Finally, edit catalina.sh to tell Tomcat to pick up the environment variables:

cd /usr/local/extraview/tomcat/bin
vi catalina.sh

Search for the lines:

"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH"
-Dcatalina.base="$CATALINA_BASE"
-Dcatalina.home="$CATALINA_HOME"
-Djava.io.tmpdir="$CATALINA_TMPDIR"
org.apache.catalina.startup.Bootstrap "$@" start
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

Add the environment variables that you have defined:

"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH"
-Dcatalina.base="$CATALINA_BASE"
-Dcatalina.home="$CATALINA_HOME"
-DDB_HOST="$DB_HOST"
-DDB_PASSWORD="$DB_PASSWORD"
-DDB_USERNAME="$DB_USERNAME"
-DDB_URL="$DB_URL"
-Djava.io.tmpdir="$CATALINA_TMPDIR"
org.apache.catalina.startup.Bootstrap "$@" start
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

Windows Servers

First, define environment variables which will contain the values that will be used at ExtraView startup then, edit the configuration file C:ExtraViewTomcatwebappsevjWEB-INFconfigurationConfiguration.properties to tell ExtraView which environment variables to look for.

Replace the actual configuration settings with the name of your environment variable, surrounded by ‘$$’:

DB_HOST = $$DB_HOST$$
DB_USER = $$DB_USERNAME$$
DB_PASSWORD = $$DB_PASSWORD$$
DB_URL = $$DB_URL$$

Finally, edit the file C:ExtraViewTomcatbincatalina.bat to tell Tomcat to pick up the environment variables:

Search for the lines:

%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%

Add the environment variables that you have defined:

%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -DDB_HOST="%DB_HOST%" -DDB_PASSWORD="%DB_PASSWORD%" -DDB_USERNAME="%DB_USERNAME%" -DDB_URL="%DB_URL%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%