2011-12-22 35 views
1

我的網絡上有我的電腦,整個homedir在CIFS登錄時被掛載。當我訪問http://localhost一切正常,但當我訪問http://localhost/~user它失敗。apache無法訪問CIFS上的public_html

# 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. 

和Apache說

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 

任何想法?

回答

2

有同樣的問題,它變成了一個SELinux的事情:SELinux有一個防止httpd(apache)遵循CIFS鏈接的設置。

  1. 要看到,如果你有這樣的問題:

    getsebool -a | grep的httpd的

你應該看到httpd_use_cifs - >。如果不是,你的運氣 - 這是你的問題。

  1. 要解決:

    setsebool httpd_use_cifs上

您還可以決定完全禁用SELinux(假設你知道的風險) - 這裏是one relevant page

鏈接