安全性:将 Web 应用程序外部的目录映射到 TOMCAT 中的 URL

发布于 2025-01-07 09:11:05 字数 391 浏览 3 评论 0原文

我指的是这个问题: 将 Web 应用程序外部的目录映射到 URL在 TOMCAT 中,

<Context path="/images" docBase="/usr/images/" />

我想知道如何以最安全的方式实现这一点。所以我的问题是:

  1. 将上传文件夹放在哪里,为
  2. 文件夹和文件提供哪些文件权限以及谁应该是所有者
  3. 如何确保文件只能通过 tomcat 访问而不能直接由用户访问

I am referring to this question:
Mapping a directory outside the web-app to URL in TOMCAT

<Context path="/images" docBase="/usr/images/" />

I wonder how to achive this in the most secure way. So my questions are:

  1. where to put the folder for uploads
  2. which file permissions to give the folder and the files and who should be the owner
  3. how to make sure files can only be accessed via tomcat and not directly by users

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

つ低調成傷 2025-01-14 09:11:05
  1. 取决于您的设置。通常 /var/tomcat...
  2. Tomcat 有自己的 usr 和组 tomcat:tomcat
  3. tomcat 进程使用 umask 027。
  1. Depends on your setup. Usually /var/tomcat...
  2. Tomcat has his own usr and group tomcat:tomcat
  3. Use the umask 027 for the tomcat process.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文