【问题标题】:apache cannot access public_html on CIFSapache 无法访问 CIFS 上的 public_html
【发布时间】:2012-01-26 07:29:54
【问题描述】:

我的计算机在网络上,并且整个 homedir 都在使用 CIFS 登录时挂载。当我访问http://localhost 时一切正常,但是当我访问http://localhost/~user 时它失败了。

# cat /etc/mtab
.....
//192.168.1.5/user/ /home/user cifs rw,mand 0 0


ls -l
...
drwxrwxrwx  37 user domain users         0 2011-12-22 09:12 public_html

浏览器说:

Forbidden
You don't have permission to access /~lluisforns on this server.

阿帕奇说

 cat /var/log/apache2/error.log
 [Thu Dec 22 18:19:09 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /~lluisforns denied

有什么想法吗?

【问题讨论】:

    标签: apache samba cifs public-html


    【解决方案1】:

    有同样的问题,结果证明是 SELinux 的问题:SELinux 有一个设置阻止 httpd (apache) 跟随 CIFS 链接。

    1. 查看您是否有此问题:

      getsebool -a | grep httpd

    你应该看到 httpd_use_cifs --> on。如果没有,那你很幸运——这是你的问题。

    1. 修复:

      setsebool httpd_use_cifs on

    您也可以决定完全禁用 SELinux(假设您知道风险) - 这是一个指向 one relevant page 的链接

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-02
      • 1970-01-01
      • 2016-10-04
      • 1970-01-01
      • 2017-09-08
      • 1970-01-01
      相关资源
      最近更新 更多