Apache访问localhost页面403Forbidden

来源:互联网 发布:淘宝原单男包店铺推荐 编辑:程序博客网 时间:2024/05/21 19:42

运行环境是windows下WAMP集成环境,本地访问localhost出现403Forbidden错误。原因是开启了虚拟主机配置,即在httpd.conf下删除了#Include conf/extra/httpd-vhosts.conf前面的#号。

解决:

在apache\conf\extra找到httpd-vhosts.conf,添加一个虚拟主机,路径为www的根目录,serverName为localhost

<VirtualHost *:80>    ServerAdmin yourEmail@163.com    DocumentRoot "D:\WAMP\wamp\www"    ServerName localhost    ErrorLog "logs/dummy-host2.example.com-error.log"    CustomLog "logs/dummy-host2.example.com-access.log" common</VirtualHost>
保存,重启wamp,问题解决

0 0
原创粉丝点击