I have a Tomcat server that that I want to run multiple webapps each with a different domain name. Given the configuration below, I want to be able to connect to http://webapp1
and get to its webapp and http://webapp2
and get to that one.
Currently when I start tomcat with this configuration, it complains about multiple bindings on port 80 (which I thought wouldn't be a problem given different domains) and when I try to access any of them, regardless of the domain I enter, I get the first webapp.
How do I get this to work the way I intend?
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="SERVICE_WEBAPP1">
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443"
compression="on"
address="webapp1" />
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
ciphers="SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA"
keystoreFile="KEYSTOREFILE1"
keystorePass="keypass1"
keystoreType="PKCS12"
useIPVHosts="true"
address="webapp1" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
<Engine name="SERVICE_WEBAPP1" defaultHost="webapp1" >
<Host name="webapp1" appBase="webapp1dir"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
</Service>
<Service name="SERVICE_WEBAPP2">
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443"
compression="on"
address="webapp2" />
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
ciphers="SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA"
keystoreFile="KEYSTOREFILE2"
keystorePass="keypass2"
useIPVHosts="true"
address="webapp2" />
<Engine name="SERVICE_WEBAPP2" defaultHost="webapp2" >
<Host name="webapp2" appBase="webapp2dir"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
</Service>
</Server>