tomcat多域名设置

XML code

<Engine name="Catalina" defaultHost="jsxymgh.3322.org"><Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/><!--域名1--><Host name="jsxymgh.3322.org" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"><!--默认访问--><Context path ="" debug="0" docBase ="/test1" reloadable="true" privileged="true"></Context></Host><!--域名2--><Host name="chinamgh.3322.org" appBase="D:/1" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"><!--默认访问--><Context path ="" debug="0" docBase ="/test2" reloadable="true" privileged="true"></Context></Host><Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"></Host></Engine>
原文地址:https://www.cnblogs.com/zhouwenwu/p/2303835.html