Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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


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

  • domain1:com:8080
  • domain2:com:8080
share|improve this question

1 Answer 1

up vote 0 down vote accepted

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:

Basically, you will need to edit your server.xml file something like this:

<Engine name="Catalina" defaultHost="">
    <Host name="" appBase="1stapp"/>
    <Host name="" appBase="2ndapp"/>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.