Tomcat Connector - How can I configure one Connector's requests to be handled by only one of my webapps?
If you have two or more Connector elements configured, and you want each Connector's requests to be handled by only one of your webapps, you do not need two separate Tomcat instances to accomplish this. In your server.xml file, you'll notice that your HTTPS Connector elements are nested within a Service element. Also nested within the Tomcat Service element is an Engine element that in turn contains your Host(s) and Context(s), like this (simplified):
<Server>
<Service>
<Connector port="8443"/>
<Connector port="8444"/>
<Engine>
<Host name="yourhostname">
<Context path="/webapp1"/>
<Context path="/webapp2"/>
</Host>
</Engine>
</Service>
</Server>
Tomcat matches up the Connectors with the Engine and the Engine's Hosts and Contexts. Tomcat also supports having more than one Service element in server.xml, which means you can change the structure so that only one connector is able to send requests to one webapp, like this:
<Server>
<Service name="Catalina">
<Connector port="8443"/>
<Engine>
<Host name="yourhostname">
<Context path="/webapp1"/>
</Host>
</Engine>
</Service>
<Service name="Catalina8444">
<Connector port="8444"/>
<Engine>
<Host name="yourhostname">
<Context path="/webapp2"/>
</Host>
</Engine>
</Service>
</Server>



