I have two domains but only one virtual server which runs a tomcat 7. I have my own ubuntu Linux with full root access running on the virtual server. I setup shorewall firewall which forwards any request on port 80 to port 8080 (where tomcat is listening on).
So I already searched the net but I only find "solution" that do not work in my case. This is what I did so far:
- I copied my websiteA.war as ROOT.war into the $CATALINA_HOME/webapps/ folder
- I also copied my websiteB.war as WebsiteB.war into the $CATALINA_HOME/webapps/ folder
I modified my $CATALINA_HOME/conf/server.xml in the following way:
Host name="www.websiteA.com" appBase="webapps" unpackWARs="true" autoDeploy="true"
Host name="www.websiteB.de" appBase="webapps/websiteB" unpackWARs="true" autoDeploy="true"
Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"
I created the following file ROOT.xml in the folder "$CATALINA_HOME/conf/Catalina/www.websiteB.com" :
?xml version="1.0" encoding="UTF-8"?
Context displayName="www.websiteB.com" docBase="" path=""
/Context
Restarted tomcat. The websiteA.com gets deployed under "/" and websiteB.com gets deployed unter "/websiteB"
- Entering www.websiteB.com arrives at "/" which means that websiteA is actually shown for websiteB.com
What am I doing wrong here?