I've come across a few posts on how to setup the conf/server.xml to run webapps on different ports, but none that actually detail how to specify which webapp is running on which port. I have 4 apps, only one of which needs to run on its own port. I've added a new Service element to the server config (similar to http://www.coderanch.com/t/513088/Tomcat/configure-two-applications-different-ports#2321484). However when I start up tomcat, it seems to create two instances of each app, one for each port (I've observed my servlets init() being called twice). Is there any way to specify that one app run on one service, and the other three to run on the other service?
The first host's appBase is a subdirectory of the second host's in that example. I'm not very sure how the second host behaves when it finds WAR's under a subdirectory of its appBase. You can try and see if it works ok.
What I do is I specify completely different directories (or peers at the same level) for each virtual host. Like "webapps-mydomain1" and "webapps-mydomain2" (which resolve to the absolute paths /var/lib/tomcat6/webapps-mydomain1 and /var/lib/tomcat6/webapps-mydomain2 on *nix systems).
I will suppress my every urge. But not this shameless plug:
how do I do my own kindle-like thing - without amazon