linux_windows下配置tomcat区别 ,不同子域名映射不同 项目

windows下

均为修改tomcat/bin/server.xml

在最后

替换 注意 docBase /

 1  <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

 2              resourceName="UserDatabase"/>

 3 

 4       <!-- Define the default virtual host

 5            Note: XML Schema validation will not work with Xerces 2.2.

 6        -->

 7         <Host name="www.haoshuju.cn" appBase="D:\tools\apache-tomcat-6.0.36\haoshuju" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

 8             <Context path="" docBase="/" reloadable="true"/> 

 9         </Host> 

10         <Host name="app.haoshuju.cn" appBase="D:\tools\apache-tomcat-6.0.36\app"       unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

11             <Context path="" docBase="/" reloadable="true"/>

12         </Host> 

13     </Engine>

14   </Service>

15 </Server>

linux下 注意docBase=""

 1     <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

 2              resourceName="UserDatabase"/>

 3 

 4      

 5      <Host name="www.haoshuju.cn" appBase="/usr/local/java/tomcat6/haoshuju" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

 6             <Context path="" docBase="" reloadable="true"/> 

 7         </Host> 

 8           <Host name="app.haoshuju.cn" appBase="/usr/local/java/tomcat6/haoshuju/app" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

 9             <Context path="" docBase="" reloadable="true"/>

10          </Host> 

11     

12 

13      

14     </Engine>

15   </Service>

16 </Server>

 

你可能感兴趣的:(windows)