tomcat配置外部静态资源映射路径
修改apache-tomcat-7.0.56\conf文件夹下的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 "%r" %s %b" />
<!-- 增加的静态资源映射配置 -->
<Context path="/RecordFile" docBase="/home/lings/recordings" reloadable="true" crossContext="true"></Context>
</Host>
红色那一行就是增加的静态资源映射配置。