Tomcat配置虚拟路径,使上传文件与服务器及工程文件分离开

  • 解决方法


    image.png

在conf/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" />

<Context path="/manage/upload/actity/" docBase="/home/upload/actity/" reloadable="true" debug="0"></Context>

<Context path="/manage/upload/article/" docBase="/home/upload/article/" reloadable="true" debug="0"></Context>

<Context path="/manage/upload/user/" docBase="/home/upload/user/" reloadable="true" debug="0"></Context>
   </Host>

还有一个必要的:


image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。