故事:我从文档根目录中删除了一个可浏览且运行良好的目录LogViewer
。后来我决定将其添加回来,但现在 apache 不会显示它。
drwxr-xr-x. 12 user group 4096 Jun 19 15:16 272
drwxr-xr-x. 12 user group 4096 Jun 19 15:17 273
drwxr-xr-x. 3 user group 4096 Jun 20 08:06 LogViewer
272 和 273 目录是可浏览的并且可以工作。
ls -lZ 的输出:
drwxr-xr-x. user group system_u:object_r:httpd_sys_content_t:s0 272
drwxr-xr-x. user group system_u:object_r:httpd_sys_content_t:s0 273
drwxr-xr-x. user group unconfined_u:object_r:user_home_t:s0 LogViewer
我尝试过的: 我已经多次重启apache了。我已经停止了,又开始了。我刷新了浏览器,清除了 cookie 和所有临时文件。
我的问题:什么?
最佳答案
根据:SELinux doc
To make a folder viewable from a special user public HTML folder, it needs to have a type that httpd has permissions to read, presuming the Apache HTTP Server is configured for UserDir and the Boolean value httpd_enable_homedirs is enabled.
尝试这个命令:
chcon -R -t httpd_user_content_t LogViewer
关于linux - apache 无法读取文档根目录中的 755 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17220753/