Apache2 Customization Guide with Multiple Separate Instances of Tomcat 7

I understand that this question was probably asked many times, but I could not find a good, relevant answer. The only guide I could find was from 2005 and was on tomcat 5. It seems that many OS paths have changed.

Our situation is as follows:

We want to run multiple instances of tomcat 7 on the same server. Each tomcat performs a different address. For example, www.oursite.comshould be served from a separate tomcat than test.oursite.com. So, for example, the basic installation of tomcat will be located in /opt/tomcat/, and directories of specific instances (this is what I can make from this old tutorial) will be in /home/user1/some/path/and /home/user2/some/pathso that everything will be pleasant.

Can someone point to a good tutorial or maybe explain here the steps to set it up? I'm a little new to apache settings.

Are there any advantages / disadvantages to this? Would a single tomcat instance be better? We need to be able to bring down sites one at a time, without affecting each other. In addition, our DNS provider does not allow us to configure hidden redirects, so we need to go through apache in order to have nice URLs, and not redirect directly to tomcats.

thank

+5
source share
2 answers

I believe that you have 2 questions:

  • How to run multiple instances of tomcat on the same server and you?
  • How to configure apache httpd for virtual host and foreground cat?

1. tomcat : http://java.dzone.com/articles/running-multiple-tomcat, ? " ". , , . , . " , ". apache httpd, , ( ).

2. apache httpd ajp tomcat.

<VirtualHost *:80>
    ServerName www.oursite.com

    ProxyPass / ajp://tomcat.oursite.com:8009/www retry=5
    ProxyPassReverse / ajp://tomcat.oursite.com:8009/www
</VirtualHost>

<VirtualHost *:80>
    ServerName test.oursite.com

    ProxyPass / ajp://tomcat.oursite.com:8010/test retry=5
    ProxyPassReverse / ajp://tomcat.oursite:8010/test
 </VirtualHost>

DNS www.yoursite.com, test.yoursite.com, . , www, test webapps tomcat tomcat.oursite.com, ajp- 8009, ajp- 8010. . . FYI, ajp tomcat: http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html

+8

apache mod_proxy_ajp , tomcat.

, , tomcat, , , ProxyPass ProxyPassReverse , , 8009.

, , mod_jk, , mod_proxy_ajp, , URL-, tomcat , tomcat . Mod_Jk

0

All Articles