600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 安装apache遇到You don’t have permission to access this resource. 原因与解决方法

安装apache遇到You don’t have permission to access this resource. 原因与解决方法

时间:2024-07-18 01:58:56

相关推荐

安装apache遇到You don’t have permission to access this resource. 原因与解决方法

给公司配置PHP服务器,用apache进行操作,遇到如标题那个问题,无法进行远程HTTP请求,解决办法如下

apach/conf/httpd.conf文件修改如下:

<Directory />

Options FollowSymLinks

AllowOverride all

Require local

</Directory>

修改为:

<Directory />

Options FollowSymLinks

AllowOverride none

Require all granted

</Directory>

以及下方的

DocumentRoot "${INSTALL_DIR}/www"

<Directory "${INSTALL_DIR}/www/">

Options FollowSymLinks

AllowOverride all

Require local

</Directory>

修改为:

DocumentRoot "${INSTALL_DIR}/www"

<Directory "${INSTALL_DIR}/www/">

Options Indexes FollowSymLinks

AllowOverride all

Require all granted

</Directory>

此时还是不行,被干的稀碎,参考大佬原帖:/topics/390904273?list=23494857

但是他可能没提醒用户httpd-vhosts.conf也要改,路径在apach/conf/extra/httpd-vhosts.conf里面

# Virtual Hosts

#

<VirtualHost *:80>

ServerName localhost

ServerAlias localhost

DocumentRoot "${INSTALL_DIR}/www"

<Directory "${INSTALL_DIR}/www/">

Options +Indexes +Includes +FollowSymLinks +MultiViews

AllowOverride all

Require local

</Directory>

</VirtualHost>

修改为:

# Virtual Hosts

#

<VirtualHost *:80>

#ServerName localhost

ServerAlias localhost

DocumentRoot "${INSTALL_DIR}/www"

<Directory "${INSTALL_DIR}/www/">

Options +Indexes +Includes +FollowSymLinks +MultiViews

AllowOverride None

Require all granted

</Directory>

</VirtualHost>

然后重启apache,成功。

希望文章对你有帮助

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。