idea为tomcat设置虚拟地址

1.设置tomcat的server.xml

<Host name="localhost"  appBase="webapps"
            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="/file" docBase="D:\File\file"></Context>
        <Context path="/image" docBase="D:\File\image"></Context>
      </Host>

增加<Context>的配置

2.但是有可能并不起作用,使用idea启动tomcat并不工作

还需要设置

运行服务器:

 

posted on 2017-11-16 11:11  张小泽的小号  阅读(457)  评论(0编辑  收藏  举报

导航