Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we have two tomcat's running on the same machine with 2 different port numbers

 
Pavan Kashyap
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Well i know that we can change the port number of the tomcat.
But my doubt is that can we have two tomcat's running on the same machine with 2 different port numbers.
If yes can u explain me how to do.
[ July 21, 2006: Message edited by: Pavan Kashyap ]
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course you can, but you need either two complete installations, or at least two completely different conf and webapps directories and two different startup scripts (or modify the original to accept an argument).
 
Harish Tiruvile
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Martin Simons ,
(or modify the original to accept an argument).


you mean we have to change the tag which takes one port number as an attribut to TWO attribute by making changes in XML file(in DTD or Schema),to take one more argument?

I hope we dont have that previlage....Do we?

.....correct me if i am wrong
[ July 21, 2006: Message edited by: harish thrivile ]
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean to modify catalina.sh to take an argument as to which of the conf/webapps directories to use. (Better would be to duplicate the setenv.sh and place these as variables in there and then the argument can specify which of the environment scripts to use.)
 
Murad Iqbal
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better to have two complete different tomcat installations mate. You can change the default port by editing catalina.bat/sh
 
Harish Tiruvile
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Simons

I mean to modify catalina.sh to take an argument as to which of the conf/webapps directories to use.


Hey i read somewhere in tomcat document that if i want to change port(reassign different port ) then i have to change Tomcat 5.0\conf\server.xml file......

i am hearing for the first time that we can change the port number by modify catalina.sh\bat(i am using WINDOWS 2000).....please explain it more.......i mean where & what i have to modify if i want to assign different port number(I saw only environment variable ...and some commands,did not got where to modify)

Otherwise...if u have link which explain that ,please post that link here Martin Simons..it will be very helpful for me to
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you do have to. That is why I say you need an additional conf and webapps directory. But, the catalina.sh will start the process using the info in the normal conf directory. If you want to use the same distribution to start a second tomcat process on a different port, then you need to tell catalina.sh to use a different conf directory. In which, the modified server.xml (and other files) will exist.

The simplest solution is simply to install a second tomcat server to a new directory and start your second process (using a different port) from there. Then you do not need to do anything special. All the other things mentioned, only need to be done if you want to use the same tomcat installation to run two Tomcat processes.
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not telling you to change the port number by changing catalina.sh. I am telling you, make a copy of your entire conf directory and then start catalina.sh using the original conf directory, than start it again using the new conf directory. If you do not understand this, then do the simplest solution of installing a second server.
 
Harish Tiruvile
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u Martin Simons ...now i got it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic