Mobile app version of vmapp.org
Login or Join
Dunderdale272

: How to host 2 domains in 1 tomcat instance I have 2 domains which point to my virtual server. The domains are accessible using different context paths like below: domain1.com:8080/1stapp domain1.com:8080/2ndapp

@Dunderdale272

Posted in: #Tomcat

I have 2 domains which point to my virtual server. The domains are accessible using different context paths like below:


domain1.com:8080/1stapp
domain1.com:8080/2ndapp


How should I configure Tomcat so that I can access my domains like below:


domain1:com:8080
domain2:com:8080

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Dunderdale272

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

What you are looking for is called "virtual hosting". Tomcat does support virtual hosting.

Since you already have your domains pointed at your virtual server, you can follow the Tomcat configuration instructions here: tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
Basically, you will need to edit your server.xml file something like this:

<Engine name="Catalina" defaultHost="domain1.com">
<Host name="domain1.com" appBase="1stapp"/>
<Host name="domain2.com" appBase="2ndapp"/>
</Engine>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme