linux - apache 无法读取文档根目录中的 755 文件夹

标签 linux apache

故事:我从文档根目录中删除了一个可浏览且运行良好的目录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 目录是可浏览的并且可以工作。

enter image description here

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/

相关文章:

linux - 无法在 Ubuntu 中登录或更改密码,传播用户,由 Vertica 安装脚本创建

linux - 如何仅在文件更改时自动增加 RPM 版本

apache2 和 <LocationMatch> 带有负正则表达式

apache - mod_jk 不适用于 apache2.2 和 tomcat7

python - 如何在 Ubuntu 上设置本地 Django 开发环境?

linux - 如何使 bash 脚本从关键字生成日志文件

linux - 在 CentOS 7.0 上安装 dia 时 yum 看不到 libEMF

php - 为什么 Apache 在没有扩展名的调用文件上执行 php 文件

php - 内容编码错误

linux - ./configure for libtorrent 在 Linux 上的问题