Mapping different domains to different webapps in TOMCAT

Posted on 2006-04-10
Last Modified: 2010-08-05
How do you setup a single tomcat instance so that, for example, goes to webapp A, and goes to webapp B ?

Thanks in advance.
Question by:Captain-Fantastic
    1 Comment
    LVL 10

    Accepted Solution

    Use multiple Host elements with the Engine element in server.xml

    Note:  One of the Hosts listed must match the defaultHost

    For example:

        <Engine name="Standalone" defaultHost="localhost" debug="0">
          <Host name="localhost" debug="0" appBase="webapps"
                unpackWARs="true" autoDeploy="true">
            <Context path="" docBase="ROOT" debug="0"/>

          <Host name="" appBase="/home/app1/webapp">
            <Context path="" docBase="."/>

          <Host name="" appBase="/home/app2/webapp">
            <Context path="" docBase="."/>


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting ( to http…
    In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now