gpt4 book ai didi

php - Apache 的符号链接(symbolic link)错误 403

转载 作者:行者123 更新时间:2023-12-05 06:45:20 26 4
gpt4 key购买 nike

我的 /srv/http/ 文件夹中有一个符号链接(symbolic link) 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 到我的符号链接(symbolic link)目标文件夹,如下所示:

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

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

最佳答案

您应该 chmod o+x apache 通过的整个路径。所以在你的情况下:

sudo chmod o+x /home/

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

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

关于php - Apache 的符号链接(symbolic link)错误 403,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24762181/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com