httpd_read_user_content 和 httpd_enable_homedirs 有什么区别?

Tsu*_*omu 8 selinux apache-2.2

SELinux 的 apache 模块有两个类似的布尔参数:httpd_read_user_contenthttpd_enable_homedirs

手册页说前者允许 httpd 读取用户内容,后者允许 httpd 读取主目录

它们之间有什么区别?

如果我想让 httpd 读取目录上的文件,我应该设置哪个参数为 true /home/foo

Mic*_*ton 11

httpd_read_user_content允许任何受限的 Web 服务器读取/home.

httpd_enable_homedirs允许 Apache 使用其UserDir指令(即​​看起来像 的 URL http://www.example.com/~username/)。

如果您只是将域名映射到用户目录,启用第一个应该就足够了httpd_read_user_content,但是如果您想使用 Apache 用户目录,则应该同时启用两者。