WampServer 3 访问403 Forbidden You don't have permission to access this resource 解决

简介: WampServer 3 访问403 Forbidden You don't have permission to access this resource 解决

大多数百度到的答案仅适用于WampServer3以下的版本,这里我介绍一种适用于WampServer3版本解决方案


问题:安装好WampServer3后无法通过公网IP进行访问,出现403 Forbidden错误


解决方案:


首先左键单击右下角WampServer3的图标(绿色的),然后依次找到httpd-vhosts.conf,注意不是httpd.conf,因为WampServer3中预定义了虚拟主机,所以要修改虚拟主机的配置才会起作用。


0a2653c851af460fa595bd959398a8f1.png


打开httpd-vhosts.conf后,内容大概是这样的


<VirtualHost *:80>
    ServerName localhost
    DocumentRoot C:/wamp/www
    <Directory  "C:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>


修改倒数第3行Require local为Require all granted即可,修改后的配置文件如下


<VirtualHost *:80>
    ServerName localhost
    DocumentRoot C:/wamp/www
    <Directory  "C:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>


然后重新启动WampServer即可。


需要注意的是,403 Forbidden也有可能是因为端口配置错误引起的,如果上述的方法无效,那么有两种方法可以参考。


1、考虑修改httpd-vhosts.conf文件的第一行<VirtualHost *:80>后面的"80"为其他端口号,如<VirtualHost *:8080>。


2、重新安装Apache,选择如图所示选项即可(需要先点击上面的"停止服务")


2d65d23f6d4748949b924e4057485923.png


重新安装完成之后重新启动WampServer即可,此时Apache的访问端口会被重置为80。


相关文章
|
Docker Windows 容器
解决 windows:An attempt was made to access a socket in a way forbidden by its access permissions
解决 windows:An attempt was made to access a socket in a way forbidden by its access permissions
2135 1
解决 windows:An attempt was made to access a socket in a way forbidden by its access permissions
|
PHP
【laravel】访问时You don‘t have permission to access on this server.
【laravel】访问时You don‘t have permission to access on this server.
312 0
【laravel】访问时You don‘t have permission to access on this server.
|
存储 NoSQL Redis
docker: denied: requested access to the resource is deniedunauthorized: authentication required
docker: denied: requested access to the resource is deniedunauthorized: authentication required
678 0
docker: denied: requested access to the resource is deniedunauthorized: authentication required
|
存储 安全 Linux
Docker——denied: requested access to the resource is denied问题以及解决方法
使用<font color=red>docker push</font>推送镜像时,出现<font color=red>denied: requested access to the resource is denied</font>的报错。
5309 0
Docker——denied: requested access to the resource is denied问题以及解决方法
wamp You don't have permission to access / on this server等问题的解决.
原文: wamp You don't have permission to access / on this server等问题的解决. 安装完wamp之后,安装网上的教程设置虚拟路径,出现了问题,同样的问题由不同的原因导致。
1139 0