• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Configure Multiple Tomcat Instances

 
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.









 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why?
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so that testing application runs on http:\\localhost:9090\ and the main application linking to production environment works on http:\localhost:8080.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Saloon Keeper
Posts: 28469
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ruquia tabassum wrote:
but still the instances are not working....



http://faq.javaranch.com/java/TellTheDetails
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....
reply
    Bookmark Topic Watch Topic
  • New Topic