How do I setup multiple instances of Tomcat on Linux?

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Web Server (EWS)

    • 1.x
    • 2.x
  • Red Hat JBoss Web Server (JWS)

    • 3.x
    • 5.x
    • 6.x
  • Red Hat Enterprise Linux (RHEL)

    • Tomcat 5
    • Tomcat 6
    • Tomcat 7
    • Tomcat 9
    • Tomcat 10

Issue

  • How do I setup multiple instances of Tomcat as a service?
  • How do I configure multiple tomcat daemons on the same server?
  • Unable to get multiple instances of tomcat working on a single server.
  • We are using default tomcat package provided in RHEL7.1, We want to know the configuration to run multiple tomcat instances on rhel7.1?

Resolution

  • The setup of multiple instances of Tomcat is not achievable with RPM packages (not achievable in a supported manner) as the supplied tomcat rpm package is not designed to run this way. However, the support for multiple instances of tomcat is offered with This content is not included.Red Hat JBoss Web Server product entitlements.
  • You can install multiple instances of Tomcat from the This content is not included.JBoss Web Server ZIP distribution which can be downloaded from the customer portal.
  • You can unzip the package in multiple different directories. Please keep in mind you will need to have the different Tomcat instances listen on different ports.

Root Cause

  • The tomcat5/6/7 package is not relocatable. Relocating non relocatable RPMS is not supported.
$ rpm -qip tomcat6-6.0.24-45.el6.noarch.rpm | head -1
Name        : tomcat6                      Relocations: (not relocatable)
$ rpm -qlp tomcat6-6.0.24-45.el6.noarch.rpm 
/etc/init.d/tomcat6
/etc/logrotate.d/tomcat6
/etc/sysconfig/tomcat6
/etc/tomcat6
/etc/tomcat6/Catalina
/etc/tomcat6/Catalina/localhost
/etc/tomcat6/catalina.policy
/etc/tomcat6/catalina.properties
/etc/tomcat6/context.xml
/etc/tomcat6/log4j.properties
/etc/tomcat6/logging.properties
/etc/tomcat6/server.xml
/etc/tomcat6/tomcat-users.xml
/etc/tomcat6/tomcat6.conf
/etc/tomcat6/web.xml
/usr/bin/tomcat6-digest
/usr/bin/tomcat6-tool-wrapper
/usr/sbin/dtomcat6
/usr/sbin/tomcat6
/usr/share/doc/tomcat6-6.0.24
/usr/share/doc/tomcat6-6.0.24/LICENSE
/usr/share/doc/tomcat6-6.0.24/NOTICE
/usr/share/doc/tomcat6-6.0.24/RELEASE-NOTES
/usr/share/doc/tomcat6-6.0.24/RELEASE-PLAN-6.0.txt
/usr/share/tomcat6
/usr/share/tomcat6/bin/bootstrap-6.0.24.jar
/usr/share/tomcat6/bin/bootstrap.jar
/usr/share/tomcat6/bin/catalina-tasks.xml
/usr/share/tomcat6/bin/tomcat-juli-6.0.24.jar
/usr/share/tomcat6/bin/tomcat-juli.jar
/usr/share/tomcat6/conf
/usr/share/tomcat6/lib
/usr/share/tomcat6/logs
/usr/share/tomcat6/temp
/usr/share/tomcat6/webapps
/usr/share/tomcat6/work
/var/cache/tomcat6
/var/cache/tomcat6/temp
/var/cache/tomcat6/work
/var/lib/tomcat6
/var/lib/tomcat6/webapps
/var/log/tomcat6
/var/log/tomcat6/catalina.out
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.