Tomcat 6.18 Virtual Host

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>
 
 
conf/Catalina/localhost/ROOT.xml:
    <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

你可能感兴趣的:(Tomcat 6.18 Virtual Host)