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
2247 1
解决 windows:An attempt was made to access a socket in a way forbidden by its access permissions
|
6月前
|
安全 Unix 网络安全
Permission Denied原因及解决方法
Permission Denied原因及解决方法
2030 0
|
PHP
【laravel】访问时You don‘t have permission to access on this server.
【laravel】访问时You don‘t have permission to access on this server.
331 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
721 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>的报错。
5478 0
|
Docker 容器
Docker上传镜像报错:denied: requested access to the resource is denied
Docker上传镜像报错:denied: requested access to the resource is denied
371 0
Docker上传镜像报错:denied: requested access to the resource is denied
SVN:Unreadable path encountered; access denied
SVN:Unreadable path encountered; access denied
230 0
SVN:Unreadable path encountered; access denied
wamp You don't have permission to access / on this server等问题的解决.
原文: wamp You don't have permission to access / on this server等问题的解决. 安装完wamp之后,安装网上的教程设置虚拟路径,出现了问题,同样的问题由不同的原因导致。
1151 0
|
开发工具
You need permission to perform this action access denied解决
这个界面,都遇到过吧。 解决办法一般是重获文件夹的OWNER权利。 但如何N多子文件夹,一个一个设置就头大了。 还有好有小工具。 http://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vista/ 注册表之后,就可以右键得到子文件夹下的所有OWNER了。
1965 0
You need permission to perform this action access denied解决
|
应用服务中间件 nginx Perl
解决Nginx出现403 forbidden (13: Permission denied)报错的四种方法
解决Nginx出现403 forbidden (13: Permission denied)报错的四种方法 我是在在本地用虚拟机中通过yum安装nginx的,安装一切正常,但是访问时报403, 于是查看nginx日志,路径为/var/log/nginx/error.log。
4261 0