禁用OpenCPU中的目录列表 [英] Disable directory listing in OpenCPU
问题描述
我一直试图在OpenCPU中禁用目录列表,因此我们的用户无法在http://server/ocpu/tmp/
目录中看到生成的目录和文件.
I have been trying to disable directory listing in OpenCPU so our users cannot see the resulting directories and files in the http://server/ocpu/tmp/
directory.
我已遵循 Apache的目录列表配置,并删除了/etc/apache2/
中的conf
个文件,并将Options -Indexes
包含在sites-enabled/opencpu.conf
文件中(在位置标记中)没有成功.
I have followed Apache's Directory Listing Configuration and deleted every mention of Indexes
in the conf
files in /etc/apache2/
and included Options -Indexes
in the sites-enabled/opencpu.conf
file (in the Location tags) without success.
我还查看了rApache文档,但未找到任何相关条目.
I also looked at the rApache documention without finding any pertinent entry.
有人知道实现此目标的任何文档或配置吗?
Does anyone know any documentation or configuration to achieve this?
推荐答案
目录列表是由R代码动态完成的,因此Apache配置在这里无济于事.
The directory listing is done dynamically by R code so Apache configs won't help here.
如果在Ubuntu目录下运行OpenCPU云服务器,/ocpu/tmp
的列表默认情况下会通过apparmor配置禁用.试试吧:
If you run the OpenCPU cloud server under Ubuntu directory listing of /ocpu/tmp
is disabled by default via the apparmor configurations. Try it:
https://cloud.opencpu.org/ocpu/tmp/
这仅在您的平台支持AppArmor时才有效,因此不适用于CentOS或Docker.因此,建议将Ubuntu部署用于生产.
This only works if your platform supports AppArmor, so it doesn't work for CentOS or Docker. Therefore Ubuntu deployment is recommended for production.
这篇关于禁用OpenCPU中的目录列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!