Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I struggled with this a while back and managed to get something that works ok. It doesn't use mod_jk though, I opted for mod_proxy. I also had a slightly different set up in Tomcat (mine is version 6 btw), where I added multiple connectors as well as the Host declarations you have.</p> <p>Try the following -</p> <p>In tomcat server.xml:</p> <pre><code>&lt;!-- I opted for a shared thread pool so both apps share same resources - optional --&gt; &lt;Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="250" minSpareThreads="40"/&gt; &lt;Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8444" executor="tomcatThreadPool" proxyName="www.domain1.com" proxyPort="80"/&gt; &lt;Connector port="8082" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8445" executor="tomcatThreadPool" proxyName="www.domain2.com" proxyPort="80"/&gt; &lt;Host name="www.domain1.com" appBase="vhosts/domain1" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"&gt; &lt;Alias&gt;domain1.com&lt;/Alias&gt; &lt;/Host&gt; &lt;Host name="www.domain2.com" appBase="vhosts/domain2" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"&gt; &lt;Alias&gt;domain2.com&lt;/Alias&gt; &lt;/Host&gt; </code></pre> <p>In Apache:</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName www.domain1.com ServerAlias www.domain1.com ProxyRequests Off ErrorLog /var/log/apache2/error-domain1.log &lt;Directory proxy:http://www.domain1.com:80&gt; Order Allow,Deny Allow from all &lt;/Directory&gt; &lt;Proxy www.domain1.com:80&gt; Order deny,allow Allow from all &lt;/Proxy&gt; ProxyPass / http://localhost:8081/ ProxyPassReverse / http://localhost:8081/ ProxyPreserveHost On &lt;/VirtualHost&gt; &lt;VirtualHost *:80&gt; ServerName www.domain2.com ServerAlias www.domain2.com ProxyRequests Off ErrorLog /var/log/apache2/error-domain2.log &lt;Directory proxy:http://www.domain2.com:80&gt; Order Allow,Deny Allow from all &lt;/Directory&gt; &lt;Proxy www.domain2.com:80&gt; Order deny,allow Allow from all &lt;/Proxy&gt; ProxyPass / http://localhost:8082/ ProxyPassReverse / http://localhost:8082/ ProxyPreserveHost On &lt;/VirtualHost&gt; </code></pre> <p>Make sure mod_proxy is enable for your Apache server. It was a while ago when I got this working, so I'm sure if everything is needed in that config - once I get it working I tend to forget stuff :)</p> <p>Hope that helps, Chris.</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. 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