Tomcat Configuration

(version 2.4 and higher)

 

Related Docs:   Control Panel Server Configuration Changing CP URL

Tomcat installation is located in the /hsphere/local/home/cpanel/jakarta directory.

Important: The core H-Sphere directories such as shiva, shiva-templates, psoft, and psoft-config are now located in the /hsphere/local/home/cpanel/hsphere/WEB-INF/classes/ directory with H-Sphere classes run by Tomcat. Symlinks to these new locations are put in place of the old directories to preserve H-Sphere integrity with previous versions' configuration.

Tomcat Configuration Files

Tomcat configuration files are located in the /hsphere/local/home/cpanel/jakarta/conf directory.

/hsphere/local/home/cpanel/jakarta/conf/server.xml - XML config file for Tomcat;
/hsphere/local/home/cpanel/hsphere/WEB-INF/web.xml - XML configuration file where CP servlet configuration is set;
/hsphere/local/home/cpanel/apache/etc/mod_jk.conf - mod_jk configuration. mod_jk is a Tomcat-Apache plug-in that handles the communication between Tomcat and Apache. For more details, see Apache documentation on mod_jk.

Tomcat Log File

Tomcat log file is /hsphere/local/home/cpanel/jakarta/logs/catalina.out.
Jakarta connector log is /hsphere/local/home/cpanel/apache/logs/mod_jk.log.

Restart Tomcat

Stop Tomcat:

/hsphere/local/home/cpanel/jakarta/bin/catalina.sh stop

Start Tomcat:

/hsphere/local/home/cpanel/jakarta/bin/catalina.sh start

Tomcat is also restarted with H-Sphere restart (Tomcat is restarted together with CP Apache):

/etc/init.d/httpdcp restart

Note: Sometimes you might need to restart only CP Apache, keeping Tomcat running. Then, use the following option:

/etc/init.d/httpdcp restartapache

Customizing Tomcat Environment Variables

(version 2.4.1 Patch 2 and up)

The file ~cpanel/setenv.sh 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. Open ~cpanel/setenv.sh:
    -bash-2.05b$ vi ~cpanel/setenv.sh
    Set the following line in the file:
    export CATALINA_OPTS="-Xms64M -Xmx512M"
  3. 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

Related Docs:   Control Panel Server Configuration Changing CP URL







Home   Products   Services   News
© Copyright. . PSOFT. All Rights Reserved. Terms | Site Map