Home > Apache > Running Multiple Apache Tomcat on same Machine

Running Multiple Apache Tomcat on same Machine

Sometimes we want to run multiple instance of Apache TOMCAT on same machine may be for load balancing, separating web application etc. This article describes on how we can run multiple instance of Apache TOMCAT on same machine.

Running multiple Apache TOMCAT instance does not require any change in the server code, we just need to change the port no assigned to the Apache TOMCAT.

NOTE:

  • In this article i will be referring to Apache TOMCAT 6 configuration. But the same is applicable for 5.5 also.
  • Also to change the port configuration you need to edit server.xml, this file resides inside apache-tomcat-/conf/ folder.

Ports Used in Apache TOMCAT:

  • Shutdown Port
  • Tomcat Connector Port
  • AJP Connector Port
  • Redirect Port

Your email:

 


Shutdown Port:
This port is used when we try to shutdown the Apache TOMCAT Server. We can identify this Port inside server.xml by checking the following tag.

<server port="8005" shutdown="SHUTDOWN">
</server>

Connector Port:
This port is used to connect to Apache TOMCAT server. By default 8080 is set. We can identify this Port inside server.xml by checking the following tag.

     <connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

AJP Connector Port:
This port is used AJP port, AJP is used to redirect the request to Apache Web Server from Apache TOMCAT Server. We can identify this Port inside server.xml by checking the following tag.

      <connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Redirect Port:
Any redirection happening inside Apache TOMCAT will happen through this port. In Apache TOMCAT there are two instance where redirectPort is mentioned. First one is for the Apache TOMCAT server and other one is for the AJP port. We can identify this Port inside server.xml by checking the following tag.

      <connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
 
     <connector port="8100" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

You need to only change the port no only, rest is taken care by the tomcat server. Ensure that redirectPort should be same for AJP and HTTP protocol.


Custom Search

Popular Articles:

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • IndianPad
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • RSS
  • Technorati
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • Reddit
  • Add to favorites
  • PDF
  • Twitter
Categories: Apache Tags:
  1. Ronak
    May 29th, 2009 at 08:21 | #1

    Very nice information.

  2. Matt
    August 6th, 2009 at 07:13 | #2

    I have my multiple Tomcat Apps running on same server on different ports as described here. It works great. My issue is setting it up not for the Apache Web Server to assign a internal URL to the ports. I may be off on my terms but I have the server:port working, but now I need to get dev.something.com working and I am having hard time. So is it Apache Web Server that is my issue or Tomcat, I don’t know. I think it is Apache Web Server but not sure how to correct. Any suggestions?

  1. No trackbacks yet.