1

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

任何想法?

4

1 回答 1

3

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

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

    getebool -a | grep httpd

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

  1. 修理:

    setsebool httpd_use_cifs on

您也可以决定完全禁用 SELinux(假设您知道风险) - 这是一个相关页面的链接

于 2012-04-07T20:56:57.777 回答