tomcat配置虚拟主机

1.C:\Windows\System32\drivers\etc\hosts
配置ip以及映射的主机127.0.0.1www.estore.com
2.在conf/server.xml文件中配置 
<!--设置主机与访问的路径-->
<Host name="www.estore.com"  appBase="D:\workspace\Estore"
            unpackWARs="true" autoDeploy="true"> 


        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->


        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
       <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />  
<!--设置虚拟目录-->
<Context path="/" docBase="D:\application\webapps\Estore" />
     </Host>

你可能感兴趣的:(tomcat配置虚拟主机)