【发布时间】:2014-07-15 15:26:29
【问题描述】:
我的/srv/http/ 文件夹中有一个符号链接mysite 指向/home/some-user/somefolder。
在我的/etc/httpd/conf/httpd.conf,根据这个网站和互联网上其他论坛的许多帖子,我设置了以下内容:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
DocumentRoot "/srv/http"
<Directory "/srv/http">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
然后我将权限以递归方式更改为 777 到我的符号链接目标文件夹,如下所示:
chmod 777 -R /home/some-user/some-folder
但如果我打开我的网络浏览器并输入http://localhost/mysite/mypage.php,我会收到以下错误:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.9 (Unix) PHP/5.5.14
我已经阅读了很多文章说这样做,但我仍然可以让它工作......
【问题讨论】:
-
Apache 访问和错误日志中对应的行是什么?
-
好的,发现了!我还需要 chmod o+x /home/some-user (我的站点文件夹的父文件夹)
标签: php apache symlink http-status-code-403