2

I can install them to different directories, and I think I can make them use different ports, as well.

I'm going to add 10000 to each port number for the second installation, and 20000 to the third installation, if I have to do three. <<< NOTE: As @DopeGhoti commented, it's better to have them bind to different IP addresses, rather than different ports.

I found this as a way to run them with separate ports by editing /conf/server.xml, but it seems to be for TomCat 6 on Windows, which are both pretty outdated:

http://crunchify.com/how-to-run-multiple-tomcat-instances-on-one-server/

Do I need a separate init script, though?

Say, /etc/init.d/tomcat_2.sh, or something like that?

Maybe this is too general, but seems like the sort of thing that one could easily screw up without the right concepts in mind.

6
  • // , I'd also be more than interested in another approach to getting two differently configured TomCats or different versions of TomCat on the same server without them yowling each other to death, of course. May 27, 2016 at 22:04
  • Have them use the same port, but bind to separate IPs. Instance one binds to 127.1.0.1, instance two binds to 127.2.0.1, and so on.
    – DopeGhoti
    May 27, 2016 at 22:20
  • // , Worth a try. As to the installation, do you have any ideas for specific tests I could run to tell whether I need a separate init script? I can't just do /etc/init.d/tomcat.sh start again, I'd imagine. May 27, 2016 at 22:57
  • The easiest way is to simply have multiple <Host> stanzae in each Tomcat versions' server.xml files (i. e. one for tomcat6; one for tomcat7, et cetera). Then all tomcat6 instances would be controlled by e. g. /etc/init.d/tomcat6 start|stopor service tomcat6 start|stop.
    – DopeGhoti
    May 27, 2016 at 23:16
  • 1
    Stop prepending everything you type with //, : this isn't failbook...
    – jasonwryan
    Jun 1, 2016 at 2:40

0

You must log in to answer this question.

Browse other questions tagged .