ipyanthony

tomcat7默认的程序发布路径为tomcat/webapps/ROOT/下面

修改Tomcat配置文件server.xml

 <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t "%r" %s %b" />

 </Host>

在host标签中间加入如下标签(  docBase:填写自定义项目路径   )

<Context path="" docBase="example" debug="0" reloadable="true" />

结果如下:

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t "%r" %s %b" />
      <Context path="" docBase="example" debug="0" reloadable="true" />
</Host>

 

此刻example目录和ROOT目录的作用是一样了

 

分类:

技术点:

相关文章:

  • 2021-09-17
  • 2021-08-13
  • 2022-01-22
  • 2021-04-19
  • 2021-12-14
  • 2021-12-12
  • 2021-09-24
猜你喜欢
  • 2021-08-13
  • 2021-10-09
  • 2021-08-11
  • 2021-08-13
  • 2021-08-07
  • 2021-09-05
相关资源
相似解决方案