edponce wrote:
I know this question has been asked a lot but I've read different
solutions
depending on the needs of the problem. I need to have 2 instances
of tomcat
on the same server for the same application. One would be for
production and
the other for development (which can be start and stopped whenever
without
affecting the production one).
From my understanding i need to have each instance on different
ports and
modifying some other files but what I am missing is the technical
things.
Can any one please guide me on the correct direction so that i
don't mess up
anything! I've never worked with Tomcat that is why i have no idea
on how to
do it.
André Warnier wrote:
You do not necessarily need two separate instances of Tomcat. [...]
There also exists the possibility to run one Tomcat with different
"Virtual Hosts", on the same port 80.
Each one of these virtual hosts would have a different "DNS
name" (like "realserver.mycompany.com" and
"testserver.mycompany.com") and could have a different directory
where the applications reside, but the application itself would be
named the same way.
The difference between the above solutions and two really separate
Tomcat instances would be if the test application could really crash
the whole server, in which case you may not like one of the above
solutions.
Comments anyone ?
When I was new to tomcat (arguably when compared with some members of
this list, I could still be considered new), I found it conceptually
easier to work with two instances, as you don't need to switch context
names etc when you want to deploy live. Whilst a little cumbersome,
and inefficient from a resource usage standpoint, when you're
learning, being able to restart tomcat as you shop and change the
server.xml file etc can be useful, without fear of breaking the
production service. It can also be useful for evaluating a new
version before you unleash it to production.
edponce: If you want to run two instances, the easiest way, to my
mind, is to duplicate the tomcat directory. On the duplicated tomcat
directory, you need to edit the server.xml file so that the second
server.xml as unique ports for the shutdown port, the interface port
(eg 8080 could become 8081 etc). Once you have made these changes,
you should be able to start each of them up by running their
respective startup scripts.
You could achieve the same using links and a few other sharing
techniques, but for simplicity's sake, I think this approach to two
instances using duplicated directories is the most robust.
Tom