tomcat 配置项目指定域名

方式一

<Host name="www.xxx.com" appBase="D:/tomcat/webapps/web"> 
     <alias>xxx.com</alias> 
     <alias>xxx</alias> 
     <Context path="" docBase="."/> 
     <Context path="/emc" docBase="D:/tomcat/webapps/emc" debug="0" reloadable="true" crossContext="true"></Context> 
     <Context path="/web" docBase="D:/tomcat/webapps/web" debug="0" reloadable="true" crossContext="true"></Context> 
     <Context path="/eWebEditor" docBase="D:/tomcat/webapps/eWebEditor" debug="0" reloadable="true" crossContext="true"></Context> 
</Host> 
<Host name="192.168.61.61" appBase="D:/tomcat/webapps/emc_test"> 
     <Context path="" docBase="."/> 
     <Context path="/emc_test" docBase="D:/tomcat/webapps/emc_test" debug="0" reloadable="true" crossContext="true"></Context> 
     <Context path="/web_test" docBase="D:/tomcat/webapps/web_test" debug="0" reloadable="true" crossContext="true"></Context> 
     <Context path="/eWebEditor" docBase="D:/tomcat/webapps/eWebEditor" debug="0" reloadable="true" crossContext="true"></Context>  
</Host> 

方式二


      <Host name="m.luoruiyuan.cn"  appBase="webapps" unpackWARs="true" autoDeploy="true">
      	<Context path="" docBase="m"/> 
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>


(1)