简体   繁体   English

Tomcat上下文-server.xml-如何从网络位置文件夹提供静态文件

[英]Tomcat Context - server.xml - how to serve static files from network location folder

I'm Running projects on a localhost Tomcat container, since the resource folder (images) are located on a network location folder (server reachable in my current network), I was wondering if it's possible to include this as a Tomcat docBase on the server.xml configuration file. 我正在本地Tomcat容器上运行项目,因为资源文件夹(图像)位于网络位置文件夹(在我当前网络中可访问服务器)上,我想知道是否可以将其作为Tomcat docBase包含在server.xml配置文件。

As the live environments are mounted under 1 host, I'm seeking a solution for localhost 'quick' testing. 由于实时环境安装在1个主机下,因此我正在寻找一种针对localhost“快速”测试的解决方案。

Till now I have always been serving static content (including web pages) from outside of the 'WAR' using the Apache docBase tag (but these were locations on the same 'drive'): 到目前为止,我一直使用Apache docBase标记从'WAR'之外的位置提供静态内容(包括网页)(但这些位置在同一“驱动器”上):

<Context docBase="[ip]/folder" path="/files" />

Can anybody point me in a direction in serving static content from another host [ip] (network reachable location)? 有人可以指出我从另一个主机[ip](网络可访问的位置)提供静态内容的方向吗?

I know there are other implementations as serving the contents through a servlet, but if possible I want to prevent servlets serving resources. 我知道还有其他实现可以通过servlet服务内容,但是如果可能的话,我想防止servlet服务资源。

Thanks in advance. 提前致谢。

您可以在此处安装该远程位置,并像处理本机上的文件一样处理这些文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM