带有apache的符号链接错误403

问题描述 投票:2回答:2

我的mysite文件夹中有一个指向/srv/http/的符号链接/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

我读过许多文章说这样做,但我仍然可以让它工作......

php apache symlink http-status-code-403
2个回答
0
投票

好的,发现了!我还需要chmod o+x /home/some-user(父文件夹到我的站点文件夹)


0
投票

你应该chmod o + x apache'd经历的整个路径。所以在你的情况下:

sudo chmod o+x /home/

sudo chmod o+x /home/some-user/

sudo chmod o+x /home/some-user/somefolder
© www.soinside.com 2019 - 2024. All rights reserved.