GeeCON Prague 2014*
The moose likes Tomcat and the fly likes How to run multiple web applications on different  port of a single tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to run multiple web applications on different  port of a single tomcat" Watch "How to run multiple web applications on different  port of a single tomcat" New topic
Author

How to run multiple web applications on different port of a single tomcat

naveen jain
Greenhorn

Joined: Oct 02, 2008
Posts: 16
I have a single instance of apache tomcat server. I want to deploy more than one application on it but each should be run on different port.means each application should be independent to each other.

is there any way for it without creating more tomcat instances??
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
Hi,

In that case you crate multiple services , each service runs on its own port and (if required) its on application base directory. Some thing like this



But be careful, i have seen performance dips in such a scenario, worst if CPU or memery consumption is high you cant nail down on exactly which app is the culprit then.


Anadi Mishra.
naveen jain
Greenhorn

Joined: Oct 02, 2008
Posts: 16
Thank you very much for your reply.I have found my solution.

But as you said some performance issue is there,so is there any solution for that ?
and also give me suggestion whether i should use more than one service or not?

Thanks again
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
Hi,

Not really, it depends on how well your apps have been written, but yes you can ensure that every thing from the server configuration perspective is ok and hope for the best. For example, make sure JVM is in server mode


keep a high low and maximum memory allocation ( we had to keep the low to 1GB and high to 4GB for our poor tomcat to breathe easily); and hope the the developers have not made lousy mistakes ;)

From time to time fine tuning is requiered for which I did not find any rule of thumb, so I can make a fairly accurate guess that it depends on the apps running in server.
naveen jain
Greenhorn

Joined: Oct 02, 2008
Posts: 16
thanks for your suggestion.
i will try to avoid such type of mistake from developers end.

thanks a lot.
 
GeeCON Prague 2014
 
subject: How to run multiple web applications on different port of a single tomcat