windows下
均为修改tomcat/bin/server.xml
在最后
替换 注意 docBase /
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/> <!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="www.haoshuju.cn" appBase="D:\tools\apache-tomcat-6.0.36\haoshuju" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/" reloadable="true"/>
</Host>
<Host name="app.haoshuju.cn" appBase="D:\tools\apache-tomcat-6.0.36\app" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/" reloadable="true"/>
</Host>
</Engine>
</Service>
</Server>
linux下 注意docBase=""
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/> <Host name="www.haoshuju.cn" appBase="/usr/local/java/tomcat6/haoshuju" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="" reloadable="true"/>
</Host>
<Host name="app.haoshuju.cn" appBase="/usr/local/java/tomcat6/haoshuju/app" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="" reloadable="true"/>
</Host> </Engine>
</Service>
</Server>