apache无法访问CIFS上的public_html

时间:2011-12-22 17:20:52

标签: apache samba cifs public-html

我的计算机在网络上,整个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

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

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

  1. 要查看您是否遇到此问题:

    getsebool -a | grep httpd

  2. 你应该看到httpd_use_cifs - >的 即可。如果没有,你好运 - 这是你的问题。

    1. 要修复:

      setsebool httpd_use_cifs

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