解决问题 “You don't have permission to access /index.html on this server.”

前几天装一个WAMP,打开测试页面的时候出现如下错误:

Forbidden

You don't have permission to access /index.html on this server.

开始我以为我配置出错,花半天时间都没有搞定,今天终于搞定了.

原因:index.html是用root用户建的文件,apache权限不够。

解决方法:更改文件权限;chmod 755 index.html

 

如果是WIN 2003下出现这个问题,请按以下方式解决

打开apache配置文件httpd.conf,找到这么一段:
<Directory />
     Options FollowSymLinks
     AllowOverride None
     Order deny,allow
     deny from all
     Satisfy all
</Directory>
然后试着把deny from all中的deny改成了allow,保存后重起了apache,然后再一测试我的网页,哈哈!居然问题就出在这,访问测试网站完全正常了。

 

 

第二种方法

是Apache  的配置文件httpd-vhosts.conf里,打开了扩展配置

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

前面的#去掉了,就 引入了扩展配置,而扩展配置 文件里又没配好相应 的权限“Allow from all”,所以提示此错误

posted @ 2015-08-29 13:59  fogwu  阅读(363)  评论(0编辑  收藏  举报