Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe you have 2 questions here:</p> <ol> <li>How to run multiple tomcat instances in the same server and should you? </li> <li>How to configure apache httpd to do virtual host and front tomcat?</li> </ol> <p>For 1. The following is a very good tutorial on how to run multiple tomcat instances in the same server: <a href="http://java.dzone.com/articles/running-multiple-tomcat">http://java.dzone.com/articles/running-multiple-tomcat</a>, but should you? the answer is "it depends". If you have a super powerful box and it is under utilized, you should. It also depends on what type of application you runs for each individual sites. It will definitely help you "bring down sites one at a time without influencing each other". With apache httpd configuration which I will explain in the next section, you can also run the each site on separate machines (physical or vm).</p> <p>For 2. In you case, you just need to configure apache httpd to do virtual host and use ajp to connect to tomcat.</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName www.oursite.com ProxyPass / ajp://tomcat.oursite.com:8009/www retry=5 ProxyPassReverse / ajp://tomcat.oursite.com:8009/www &lt;/VirtualHost&gt; &lt;VirtualHost *:80&gt; ServerName test.oursite.com ProxyPass / ajp://tomcat.oursite.com:8010/test retry=5 ProxyPassReverse / ajp://tomcat.oursite:8010/test &lt;/VirtualHost&gt; </code></pre> <p>In the above configuration, you need to configure DNS entries of both www.yoursite.com and test.yoursite.com to point to the same host. It also assume you run both your <em>www</em> and <em>test</em> webapps on different tomcat instances on the same host tomcat.oursite.com, one on ajp port 8009 and the other one on ajp port 8010. You can also change it to a different server of its own. It's very flexible. FYI, following is how to configure ajp in tomcat: <a href="http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html">http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload