Tomcat下面配置二级域名

(1)开通二级域名支持,即house.map512.cn,plan.map512.cn,map512.cn都指向同一IP,如218.4.157.245
(2)修改tomcat目录下的conf/server.xml,在engine里面添加
<Host name="localhost" debug="0" appBase="E:\\Tomcat5.0\\webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
       <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="localhost_log." suffix=".txt"
            timestamp="true"/>
        <Context path="" docBase="E:\\Tomcat5.0\\webapps\\szmap"  reloadable="true" caseSensitive="false" debug="0"></Context>
</Host>
<Host name="house.map512.cn" debug="0" appBase="E:\\Tomcat5.0\\suzhou"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
       <Alias>house.map512.cn</Alias>
       <Context path="" docBase="E:\\Tomcat5.0\\suzhou\\szhouse"  reloadable="true" caseSensitive="false" debug="0"></Context>
</Host>
<Host name="plan.map512.cn" debug="0" appBase="E:\\Tomcat5.0\\suzhou"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
       <Alias>plan.map512.cn</Alias>
       <Context path="" docBase="E:\\Tomcat5.0\\suzhou\\szghgs"  reloadable="true" caseSensitive="false" debug="0"></Context>
</Host>

你可能感兴趣的:(apache,tomcat,xml,IP,二级域名)