同一Tomcat下不一樣項目訪問相關問題

1、不一樣ip訪問對應的項目,只須要配置tomcat下的server.xml,以下配置:
<Host name="192.168.1.72" debug="0" appBase="E:\apache-tomcat-5.5.27\webapps"
         unpackWARs="true" autoDeploy="true"
         xmlValidation="false" xmlNamespaceAware="false">
         <Context path="" docBase="E:\apache-tomcat-5.5.27\webapps\項目名1" reloadable="true"   caseSensitive="false"   debug="0"></Context>
 </Host>
<Host name="192.168.1.73" debug="0" appBase="E:\apache-tomcat-5.5.27\webapps"
         unpackWARs="true" autoDeploy="true"
         xmlValidation="false" xmlNamespaceAware="false">
         <Context path="" docBase="E:\apache-tomcat-5.5.27\webapps\項目名2" reloadable="true"   caseSensitive="false"   debug="0"></Context>
 </Host>
 
2、不一樣域名訪問對應的項目,只須要配置tomcat下的server.xml,以下配置:
<Host name="域名1" debug="0" appBase="E:\apache-tomcat-5.5.27\webapps"
         unpackWARs="true" autoDeploy="true"
         xmlValidation="false" xmlNamespaceAware="false">
         <Context path="" docBase="E:\apache-tomcat-5.5.27\webapps\項目名1" reloadable="true"   caseSensitive="false"   debug="0"></Context>
 </Host>
<Host name="域名2" debug="0" appBase="E:\apache-tomcat-5.5.27\webapps"
         unpackWARs="true" autoDeploy="true"
         xmlValidation="false" xmlNamespaceAware="false">
         <Context path="" docBase="E:\apache-tomcat-5.5.27\webapps\項目名2" reloadable="true"   caseSensitive="false"   debug="0"></Context>
 </Host>
相關文章
相關標籤/搜索