REM on Apache Tomcat

By default REM runs on the Jetty web server bundled in the REM distribution package. The REM application is packaged as a standard war though, so running it on a different servlet container, like Apache Tomcat, is quite straightforward.

You will need:

  • the REM distribution package — rhino-element-manager-<version>.zip; expanded to a location of your choice.

  • an Apache Tomcat installation — either downloaded and configured manually, or installed via a package manager; minimum supported version is 7.0.39.

Setting up Tomcat to run REM

1

REM requires a few System Properties to be set in order to function properly.

In your Apache Tomcat installation, edit (or create) bin/setenv.sh and add the following lines:

REM_HOME="$CATALINA_BASE/rem_home"
CATALINA_OPTS="-Drem.home=$REM_HOME -Dderby.stream.error.file=$REM_HOME/derby.log -Drem.norestart=true"
CLASSPATH="$CATALINA_BASE/bin/rem-rmi.jar"

If you wish to have REM store its working files in a different location, you can change the REM_HOME value above.

2

The rem-rmi.jar is required to be on the System class path for REM Plugins to function correctly. You can find the jar in the root of the REM distribution package (rhino-element-manager-<version>/rem-rmi.jar). Copy it to $CATALINA_BASE/bin/rem-rmi.jar (to match the path specified in the CLASSPATH entry above).

3

Copy rem.war from rhino-element-manager-<version>/admin/resources/rem.war to $CATALINA_BASE/webapps/rem.war.

You should now be able to start Apache Tomcat and access REM at <tomcat_base_url>/rem. If running Apache Tomcat locally using the default port 8080 then that would be http://localhost:8080/rem.

Customize REM logging

1

Unzip log4j.properties from rem.war:

cd apache-tomcat-<version>
mkdir rem-tmp
cd rem-tmp
unzip ../webapps/rem.war WEB-INF/classes/log4j.properties

2

Edit WEB-INF/classes/log4j.properties with this content (customize as desired):

log4j.rootLogger=INFO, FILE, CONSOLE

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p <%t> [%c] %m%n

log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=${rem.home}/rem.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p <%t> [%c] %m%n

log4j.logger.rem=INFO

3

Replace WEB-INF/classes/log4j.properties in rem.war:

zip ../webapps/rem.war WEB-INF/classes/log4j.properties

4

Remove temporary files:

cd ..
rm -rf rem-tmp
Tip See Log4j documentation for more information on logging configuration.
Previous page Next page