window服务器Apache解决forbidden错误

 
标签: window服务器Apacheforbidden错误You dont have permis
 分类:

在window服务器上用wamp搭建完环境后,输入IP地址,出现Forbidden

You don't have permission to access / onthis server.

Apache/2.4.23 (Win64) PHP/5.6.25 Server at123.207.226.239 Port 80

错误。

在网上查询后,定位到Apache配置文件httpd-vhosts.conf虚拟机配置文件。发现配置文件里有AllowOverridenone,Require local。

AllowOverride参数就是指明Apache服务器是否去找.htacess文件作为配置文件,如果设置为none,那么服务器将忽略.htacess文件,如果设置为All,那么所有在.htaccess文件里有的指令都将被重写。

Require local大致意思就是只允许本地服务器访问。

解决方法:

把AllowOverride none 改为AllowOverrideall。

把Require local删掉或用#注释掉

添加Require all granted这条语句,意思是允许所有请求访问资源。

posted @ 2017-07-07 16:42  qxm9423  阅读(276)  评论(0编辑  收藏  举报