aspose file tools*
The moose likes Tomcat and the fly likes Creating Multiple Tomcat Instances on a Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Creating Multiple Tomcat Instances on a Server" Watch "Creating Multiple Tomcat Instances on a Server" New topic
Author

Creating Multiple Tomcat Instances on a Server

Arnold Angel
Greenhorn

Joined: Dec 06, 2001
Posts: 9
I know everyone very busy. I need some help and was wondering if a guru could send me instructions or explain how to create multiple instances of Tomcat on one server.
Each Tomcat would have Dedicated Ports for Tomcat01 DEV 8080, Tomcat 02 QA 8083, and BETA. 8089
When I attempted to start two Tomcats I get the following:
Catalina.start: LifecycleException: Error creating server socket: java.net.Bin dException: Address in use: JVM_Bind LifecycleException: Error creating server socket: java.net.BindException: Addr ess in use: JVM_Bind at org.apache.catalina.connector.warp.WarpConnector.initialize(WarpConne ctor.java:483) at org.apache.catalina.core.StandardService.initialize(StandardService.j ava:454) at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav a:552) at org.apache.catalina.startup.Catalina.start(Catalina.java:775) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) ----- Root Cause ----- java.net.BindException: Address in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.(Unknown Source) at java.net.ServerSocket.(Unknown Source) at org.apache.catalina.net.DefaultServerSocketFactory.createSocket(Defau ltServerSocketFactory.java:118) at org.apache.catalina.connector.warp.WarpConnector.initialize(WarpConne ctor.java:477) at org.apache.catalina.core.StandardService.initialize(StandardService.j ava:454) at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav a:552) at org.apache.catalina.startup.Catalina.start(Catalina.java:775) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) and many others.
Thanks in advance. I just need simple step-by-step checklist of how to do this. It must be a simple configuration file setting
Arnold Angel
Bhagvan Kommadi
Ranch Hand

Joined: Oct 15, 2001
Posts: 36

There is something close to what you are trying:
check this out:
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/Tomcat-Workers-HowTo.html
Bhagvan K
SCJP, SCJA part I , IBM 483
Arnold Angel
Greenhorn

Joined: Dec 06, 2001
Posts: 9
Thanks for the great reply!

I need separate environments using multiple Tomcat Instances for Tomcat01 DEVELOPMENT Port 7080, Tomcat02 QA 8080, and Tomcat03 BETA. 9080 on a single appl
I don't need to cluster or share between Instances.
Any more ideas would be appreciated.
Originally posted by Bhagvan Kommadi:

There is something close to what you are trying:
check this out:
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/Tomcat-Workers-HowTo.html
Bhagvan K
SCJP, SCJA part I , IBM 483

Joe Gilvary
Ranch Hand

Joined: May 11, 2001
Posts: 152
Tomcat configuration documents are available
online at http://jakarta.apache.org/tomcat/tomcat-4.0-doc/
From the RUNNING.txt file that comes with
the Tomcat 4 distribution (the version I'm
running):
(4) Advanced Configuration - Multiple
Tomcat 4 Instances
In many circumstances, it is desirable to have
a single copy of a Tomcat 4 binary distribution
shared among multiple users on the same server.
To make this possible, you must configure a
CATALINA_BASE environment variable (in addition
to CATALINA_HOME as described above) that points
to a directory that is unique to your instance.
When you do this, Tomcat 4 will calculate all
relative references for files in the following
directories based on the value for CATALINA_BASE
instead of CATALINA_HOME:
* conf - Server configuration files
(including server.xml)
* logs - Log and output files
* webapps - Automatically loaded web
applications
* work - Temporary working directories for
web applications
If you do not set CATALINA_BASE to an explicit
value, it will be initialized to the same value
as is set for CATALINA_HOME (which means that
the same directory is used for all relative
path resolutions).
Arnold Angel
Greenhorn

Joined: Dec 06, 2001
Posts: 9
Another excellent reply!
Are these environmental variables similar to JAVA_HOME or are they in a configuration file?
JAVA_HOME = C:\JDK1.3...
C:\Tomcat01DEV
C:\Tomcat02QA
C:\Tomcat03BETA
If environmenatl variables, TOMCAT_HOME = ?
CATALINA_BASE = C:\Tomcat01DEV; C:\Tomcat02QA ??
instead of CATALINA_HOME:

Originally posted by Joe Gilvary:
Tomcat configuration documents are available
online at http://jakarta.apache.org/tomcat/tomcat-4.0-doc/
From the RUNNING.txt file that comes with
the Tomcat 4 distribution (the version I'm
running):
(4) Advanced Configuration - Multiple
Tomcat 4 Instances
In many circumstances, it is desirable to have
a single copy of a Tomcat 4 binary distribution
shared among multiple users on the same server.
To make this possible, you must configure a
CATALINA_BASE environment variable (in addition
to CATALINA_HOME as described above) that points
to a directory that is unique to your instance.
When you do this, Tomcat 4 will calculate all
relative references for files in the following
directories based on the value for CATALINA_BASE
instead of CATALINA_HOME:
* conf - Server configuration files
(including server.xml)
* logs - Log and output files
* webapps - Automatically loaded web
applications
* work - Temporary working directories for
web applications
If you do not set CATALINA_BASE to an explicit
value, it will be initialized to the same value
as is set for CATALINA_HOME (which means that
the same directory is used for all relative
path resolutions).

Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
I'm moving this to the Tomcat forum.
------------------
Tom
Sun Certified Programmer for the Java� 2 Platform
Moderator of the forums:
J2EE and EJB
Other Java APIs


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Arnold Angel
Greenhorn

Joined: Dec 06, 2001
Posts: 9
I solved the problem by monitoring netstat -a -n and changing all ports in Tomcat01 to 6xxx, Tomcat02 to 7xxx, and Tomcat03 to 8xxx.
My next challenge shall be Multiple Instances of JBoss for DEV, QA, and BETA on same server.
Originally posted by Thomas Paul:
I'm moving this to the Tomcat forum.

 
 
subject: Creating Multiple Tomcat Instances on a Server