Article ID: 3248, created on Nov 30, 2007, last review on May 11, 2014

  • Applies to:
  • H-Sphere


Customizing Tomcat Environment Variables

(version 2.4.1 Patch 2 and up)

The file ~cpanel/ is designed to customize Tomcat environment variables.

For example, to allocate Java memory in the range between 64 MB and 512 MB:

  1. Login as cpanel user.
  2. Stop Tomcat.
  3. Open ~cpanel/
    -bash-2.05b$ vi ~cpanel/
    Set the following line in the file:
    export CATALINA_OPTS="-Xms64M -Xmx512M"
  4. Start Tomcat. You will see something like this:
    Using external settings -Xms64M -Xmx512M
    + java version 1.4.x
    Using CATALINA_BASE: /hsphere/local/home/cpanel/jakarta
    Using CATALINA_HOME: /hsphere/local/home/cpanel/jakarta
    Using CATALINA_TMPDIR: /hsphere/local/home/cpanel/jakarta/temp
    Using JAVA_HOME: /usr/java/jdk
  5. Check Java to make sure the custom settings are applied:
    -bash-2.05b$ ps auwx | grep java

    cpanel 3010 99.9 29.6 436776 27652 pts/0 S 05:54 0:09 /usr/java/jdk/bin/java -Xms64M -Xmx512M -Djava.awt.headless=true -Djava.endorsed.dirs=/hsphere/local/home/cpanel/jakarta/common/endorsed -classpath /usr/java/jdk/lib/tools.jar:/hsphere/local/home/cpanel/jakarta/bin/bootstrap.jar:/hsphere/local/home/cpanel/j
    cpanel 3020 0.0 0.7 3680 664 pts/0 S 05:54 0:00 grep java

f213b9fa8759d57bee5d547445806fe7 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF