Multiple Rice Instances on the Same Server

Multiple Rice Instances on the Same Server

Given:

  1. You have multiple Tomcat instances, each with different shutdown and AJP ports
  2. You have an Apache server
  3. You want to host multiple Rice Standalone Servers on the same server like so:

    Rice Standalone Server

    CATALINA_HOME

    Rice Configuration

    application.url

    Shutdown port

    AJP port

    A

    /usr/share/tomcatA

    /usr/local/rice/instanceA/rice-config.xml

    https://rice-sandbox.sampleu.edu/instanceA

    8500

    8010

    B

    /usr/share/tomcatB

    /usr/local/rice/instanceB/rice-config.xml

    https://rice-sandbox.sampleu.edu/instanceB

    8501

    8011

Apache Mod Proxy AJP Configuration


MOD AJP

/etc/httpd/conf.d/proxy_ajp.conf
...
ProxyPass /instanceA ajp://localhost:8010/instanceA
ProxyPass /instanceB ajp://localhost:8011/instanceB
...

Rice Standalone Server Instance A Configuration


Rice Configuration Home

/usr/local/rice/instanceA

Rice Configuration

/usr/local/rice/instanceA/rice-config.xml
<param name="server.url">rice-sandbox.sampleu.edu</param>
<param name="machine.url">rice-sandbox.sampleu.edu</param>
<param name="application.url">http://${server.url}/${nonroot.context}</param>
 <!-- change these two lines -->
<param name="nonroot.context">instanceA</param>
<param name="rice.config.path">/usr/local/rice/instanceA</param>

CATALINA_HOME

/usr/share/tomcatA

Catalina Properties

/usr/share/tomcatA/conf/catalina.properties
# Kuali RICE configuration path for Instance A
# Necessary to allow multiple rice installations on a single server
additional.config.locations=/usr/local/rice/instanceA/rice-config.xml

Tomcat Configuration

/usr/share/tomcatA/conf/tomcat5.conf
CATALINA_OPTS="-Xms128m -Xmx256m -XX:PermSize=64m -XX:MaxPermSize=128m
export CATALINA_OPTS

*(optional) Tomcat Configuration in DEBUG mode *

/usr/share/tomcatA/conf/tomcat5.conf
CATALINA_OPTS="-Xms128m -Xmx256m -XX:PermSize=512m -XX:MaxPermSize=128m -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
export CATALINA_OPTS

Tomcat Connectors

/usr/share/tomcatA/conf/server.xml
<!-- A "Server" is a singleton element that represents the entire JVM,
     which may contain one or more "Service" instances.  The Server
     listens for a shutdown command on the indicated port.
...
<Server port="8500" shutdown="SHUTDOWN">
...
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8010" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
...