tomcat多域名配置

修改server.xml
<Engine name="Catalina" defaultHost="www.hsyz.net.cn">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

    <Host name="www.hsyz.net.cn"  appBase="/root/webapps/www_hsyz_net_cn" unpackWARs="true" xmlValidation="false" xmlNamespaceAware="false">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="hsyz_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
    </Host>

    <Host name="2012.hsyz.net.cn"  appBase="/root/webapps/2012_hsyz_net_cn" unpackWARs="true" xmlValidation="false" xmlNamespaceAware="false">
    </Host>

    <Host name="hsms.hsyz.net.cn"  appBase="/root/webapps/hsms_hsyz_net_cn" unpackWARs="true" xmlValidation="false" xmlNamespaceAware="false">
    </Host>
    </Engine>

你可能感兴趣的:(tomcat)