File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Configure Multiple Tomcat Instances Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Configure Multiple Tomcat Instances" Watch "Configure Multiple Tomcat Instances" New topic
Author

Configure Multiple Tomcat Instances

carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

Hi, I am trying to configure multiple instances of tomcat5.5 for this i have installed the Tomcat 5.5 at D:\Tomcat 5.5 now i created two folders server1 and server2 at D:\server1 and D:\server2 and copied the folders conf,webapps,logs,temp,work from D:\Tomcat 5.5 into D:\server1 and D:\server2 and modified the server.xml file in each of the catalina base as

D:\server1\conf\server.xml

Connector port=9090 and shutdown port=8205 and AJP connector port 9009

D:\server2\conf\server.xml

Connector port=8090 and shutdown port=8105 and AJP connector port 8109

I have also set the CATALINA_HOME as D:\Tomcat 5.5

and CATALINA_BASE as D:\server1 and CATALINA_BASE as D:\server2

When i restart the tomcat from D:\Tomcat 5.5

The link http:\\localhost:8080\ works fine

where as links http:\\localhost:8090\ and http:\\localhost:9090\ do not work


Please suggest me how do i configure multiple instances to work.









Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

Why?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

so that testing application runs on http:\\localhost:9090\ and the main application linking to production environment works on http:\localhost:8080.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
where as links http:\\localhost:8090\ and http:\\localhost:9090\ do not work


Exactly what error message are you getting? Why are you sure that Tomcat instance is actually running?

Bill

Java Resources at www.wbrogden.com
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

Its saying Page cannot be displayed.

Can anybody verify whether the steps followed by me are sufficeint enough to run multiple instances of Tomcat or am i missing something..
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

http:\\localhost:8080 and http:\\localhost:9090 shouldn't work.

These are URLs, not DOS filenames. They are properly coded using forward (a/k/a "real") slashes, not backslashes. In other words:

http://localhost:8080

If you'll note, the JavaRanch message formatter can tell the difference, and it presents the legitimate URL as a hyperlink (colored and underlined) in this message, even though it's not smart enough to know that that link isn't useful to anyone else on the Internet, since my localhost isn't your localhost, and neither is William's.

Beyond that, check the logfiles for your various Tomcat servers. One thing to be aware of is that Tomcat can use up to about 5 ports per instance, and all 5 of them have to be ports that are not used by any other server application on that machine, whether the application is another Tomcat or something totally unrelated.

Customer surveys are for companies who didn't pay proper attention to begin with.
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

The links http://localhost:8090/ and http://localhost:9090/ ar not working even, and the ports i used are not in use by any other server application not even by another Tomcat.

I want to confirm that the steps followed above are sufficient enough to configure multiple instances.

Any suggestions appreciated.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
It is not clear how do install Tomcat on Windows as service or as the binary distribution

Try this for binary distribution installation http://stackoverflow.com/questions/1794444/use-multiple-catalinabase-to-setup-tomcat-6-instances-on-windows , in case Windows Service Installer you have to create a new windows service for this new tomcat instance.
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

I have Tomcat 5.5 installed in my machine and accroding to the link above i created a startup.bat file at D:\server1\bin and the file contents are

set CATALINA_BASE=D:\server1

but still the instances are not working....







Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
ruquia tabassum wrote:
but still the instances are not working....


http://faq.javaranch.com/java/TellTheDetails
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
ruquia tabassum wrote:I Described the steps followed in the first message of this post.. also i created the startup.bat file . when i click the startup.bat command prompt opens and closes and the content of startup.bat is




I need to confirm that the steps are sufficent or am i missing out something.


Your steps are not sufficient. I would suggest to forget the step described in the starting message, uninstall everything and just follow the step described in http://stackoverflow.com/questions/1794444/use-multiple-catalinabase-to-setup-tomcat-6-instances-on-windows
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

I cannot uninstall my tomcat as it contains applications.

And i have followed exactly the same steps, what is specified in link. but i dont no wats going wrong...
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
Exactly what error message are you getting? Why are you sure that Tomcat instance is actually running?


It seems likely that the Tomcat instance you are trying to reach failed to start - could be something as simple as a format error in one of the XML files. Executing startup.bat by clicking discards the information you need.

Try executing startup.bat from a command window to see errors.

If another window opens and then closes before you can see the errors, change the last executable line in startup.bat to



(run instead of start will continue in the same open command prompt window)

Bill

Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
William Brogden wrote:Try executing startup.bat from a command window to see error


I guarantee there will be no errors for startup.bat with



It just set environment variable

Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
ruquia tabassum wrote:I cannot uninstall my tomcat as it contains applications.

And i have followed exactly the same steps, what is specified in link. but i dont no wats going wrong...


You definitely not following exact steps, because startup.bat created by you is missing something. By the way if your machine would crash how would you reinstall applications?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
It just set environment variable


Now .... where do you suppose that environment variable is used?

Why not look in catalina.bat and see.......

Have you tried what I suggested to preserve potential error messages?

Bill

Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
William Brogden wrote:
It just set environment variable


Now .... where do you suppose that environment variable is used?

Why not look in catalina.bat and see.......

Have you tried what I suggested to preserve potential error messages?

Bill



Bill, I'm not ruquia tabassum
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

My startup.bat file conatins just one line that is




when i run it from command prompt the content of file is displayed thats it




Also i have installed Tomcat 5.5 and in the bin directory of the tomcat installed does not conatin any startup.bat file neither it conatins catalina.bat file thats the reason the startup.bat file contain only one line of setting catalina base.

Regarding the error what i get is..... The application at instance server1 do not run the browser just diplays "The Page cannot be displayed ......."

The main Tomcat installed at D:\Tomcat 5.5 which is at port 8080 is running where as the instance server1 which is at port 9090 is not running.....
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
Also i have installed Tomcat 5.5 and in the bin directory of the tomcat installed does not contain any startup.bat file


Ah - I should have asked the "how did you install Tomcat" question before.

Apparently we are dealing with Tomcat installed as a service - Tomcat will have to be started and stopped from the services control panel.

Experimenting with Tomcat when installed as a service is a real pain.

Bill
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

Yes i have installed Tomcat as windows service.... Is it that difficult to run multiple instances if installed as windows service... i find no clear steps on how to run multiple instances....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configure Multiple Tomcat Instances
 
Similar Threads
Load Balancing in Tomcat 5.5
Apache 2.0.53 + Tomcat 5.5.7 integration on Windows using mod_jk
Multiple Instances of Tomcat
multiple tomcat 5 setting???
How to create a multiple tomcat instances in windows?