Document root must be a directory
这是系统起了SELinux的策略。把目录或文件设成了user_home_t类型,因此apache的进程没有权限,无法访问。针对Apache的进程所使用的SELinux target policy规定了apache的进程只能访问httpd_sys_content_t类型的目录或文件。
解决办法:
把目录或文件的策略类型改成 httpd_sys_content_t 就可以了。
# chcon -R -h -t httpd_sys_content_t /www/web/
然后可以用 ls -laZ 命令查看文件目录的策略类型。
本文介绍了解决Apache因SELinux策略导致无法访问特定目录的问题。通过将目录的SELinux类型更改为httpd_sys_content_t,使得Apache能够正常运行。文章提供了具体的命令示例。

640

被折叠的 条评论
为什么被折叠?



