conf/server.xml
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="www.host01.com" appBase="/opt/host01"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="www.host02.com" appBase="/opt/host02"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="www.host01.com" appBase="/opt/host01"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="www.host02.com" appBase="/opt/host02"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
conf/Catalina/localhost/ROOT.xml:
<Context path="" reloadable="false" docBase="" workDir="/tmp/tomcat" />
<Context path="" reloadable="false" docBase="" workDir="/tmp/tomcat" />
conf/Catalina/www.host01.com/ROOT.xml
<Context path="" reloadable="false" docBase="" workDir="/tmp/host01" />
conf/Catalina/www.host02.com/ROOT.xml
<Context path="" reloadable="false" docBase="" workDir="/tmp/host02" />
参考:www.ex-parrot.com/~pete/tomcat-vhost.html