First read this

If you want tomcat to accept requests for different hosts e.g., then you must

0. create ${catalina.base}/www/appBase , ${catalina.base}/www/deploy, and ${catalina.base}/conf/Catalina/

  1. add a host entry in the server.xml file
  <Host appBase="www/appBase" name=""/>

2. Create the the following file under conf/Catalina/

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="${catalina.base}/www/deploy/mywebapp.war">

Add any parameters specific to this hosts webapp to this context file

3. put your war file in ${catalina.base}/www/deploy

When tomcat starts, it finds the host entry, then looks for any context files and will start any apps with a context.

To add more sites just repeat and rinse, all webapps can share the same war file location and appbase. 

  • No labels