用tomcat模拟跨域 2个跨子域 1个新域

<Host name="localhost" debug="0" appBase=""
       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:\\tomcat\\webapps\\book"  reloadable="true" caseSensitive="false" debug="0"></Context>
 </Host>

 <Host name="java.book.cn" debug="0" appBase=""
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
       <Alias>java.book.cn</Alias>
       <Context path="" docBase="E:\\tomcat\\webapps\\java"  reloadable="true" caseSensitive="false" debug="0"></Context>
 </Host>

 <Host name="net.book.cn" debug="0" appBase=""
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
       <Alias>net.book.cn</Alias>
       <Context path="" docBase="E:\\tomcat\\webapps\\net"  reloadable="true" caseSensitive="false" debug="0"></Context>
 </Host>
 
 <Host name="www.books.cn" debug="0" appBase=""
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
       <Alias>www.books.cn</Alias>
       <Context path="" docBase="E:\\tomcat\\webapps\\book"  reloadable="true" caseSensitive="false" debug="0"></Context>
 </Host>

 

 

 

 

127.0.0.1 java.book.cn
127.0.0.1 net.book.cn
127.0.0.1 www.books.cn

你可能感兴趣的:(java,apache,tomcat,.net)