wampserver安装后访问localhost出现 Forbidden问题

Forbidden

You don‘t have permission to access / on this server.

修改php的配置文件httpd.conf。

在原有的位置文件中找到配置节

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Satisfy all
</Directory>

修改成

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
#    Deny from all
    Allow from all

#允许所有访问
    Satisfy all
</Directory>

还有

<Directory "D:/Wamp5/www">

#
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn‘t give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

#
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

#
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don‘t remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1

</Directory>

修改成

<Directory "D:/Wamp5/www">

#
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn‘t give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

#
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

#
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don‘t remove
    Order Deny,Allow
#    Deny from all

#  Allow from 127.0.0.1
    Allow from all

</Directory>

然后保存,重启服务,就OK了

时间: 2024-08-01 17:42:54

wampserver安装后访问localhost出现 Forbidden问题的相关文章

解决 IDEA搭建web项目后访问localhost:8080直接进到项目首页问题

问题描述: 在配置好tomcat后访问localhost:8080直接进入项目首页而不是tomcat首页 解决方法: 1,点击server configurations 2 ,在图中Application context:处添加项目名即可 原文地址:https://www.cnblogs.com/purpleone/p/11980489.html

解决WampServer安装后无法打开localhost

今天装完wampserver之后,打开localhost,一直出现IIS7的标志,刚开始还笨笨的以为没有装好,准备重装的时候,发现服务里面本该打开的两个服务: 其中apache服务器貌似没有启动,但是手动打开的时候一直也起不来,联想之前IIS7,感觉可能是端口占用问题,OMG,当初按照IIS服务的时候就有过这个问题,讨厌~ 打开Wamp按照路径:D:\php\wamp\bin\apache\Apache2.2.21\conf,修改其中的 httpd.conf ,发现listen的端口果然是80,

Wampserver或者帝国CMS安装后, 打开localhost显示IIS欢迎界面图片

我们在安装集成环境Wampserver或者帝国CMS之后,有时会遇到一个问题, 打开localhost显示一张IIS欢迎界面图片,这个问题该如何解决呢,我在这里简单整理了一下解决方法 电脑win10系统,左下角点  开始>运行   输入cmd,进入如下图界面   然后输入以下命令:net stop iisadminnet stop w3svc   回到桌面,鼠标放到"计算机",左击,点"管理">"服务"   在服务里边找到以下项:Wo

wampserver安装后常用设置

1.新版WampServer项目路径前面没有localhost 方法:www目录下找到index.php 然后修改里面查找$projectContents 或直接查看338行代码 修改'http://'为'http://localhost/'即可. 一.修改Apache端口 1.在界面中选Apache,弹出隐藏菜单选项,打开配置文件httpd.conf: 2.找到 Listen 80: 3.将 80 改成 8080(当然自己也可以设定别的不使用的端口); 4.保存,待重启Wamp服务后即可. 二

WampServer 局域网手机访问(403 Forbidden错误解决方法)

修改文件 \wamp\bin\apache\apache2.4.9\conf\httpd.conf 几种常用格式,自己可以灵活配置: Require local 仅允许本地访问: Require all denied 拒绝所有访问: Require all granted 允许所有访问: Require ip 192.168.0.1 仅允许IP:192.168.0.1 访问: Require not ip 192.168.0.1 仅禁止IP:192.168.0.1访问:

elcipse中启动tomcat,不能访问localhost解决办法

错误详情:在eclipse中启动tomcat,然后网页中输入127.0.0.1:8080之后显示404的错误 在tomcat根目录的bin文件夹下启动startup.bat后访问localhost没有错误,问题原因:eclipse把tomcat的配置文件都复制到自己的一个文件夹下,找到项目位置进入文件夹目录.metadata\.plugins\org.eclipse.wst.server.core,复制的配置文件存放在该文件夹下,,当eclipse中启动tomcat时,启动的是复制之后的配置文件

安装wamp后,localhost访问报错“You don&#39;t have permission to access / on this server.”

今天装了一个wamp,在本地测试了一下,发现使用http://localhost/报错403,提示内容如下:"You don't have permission to access / on this server.".用127.0.0.1访问正常,phpMyAdmin也是同样的问题. 在网上搜索了一下有很多都是出现这个问题,但是不是不详细就是没找到解决办法.在此做一下记录,我是安装一路下一步所以安装目录都是默认的. 首先修改Apache,在wampserver下左键,Apache下有

Navicat安装后出现错误:1045 - Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: YES)

安装完MySQL和N之后,打开Navicat后出现如下错误: **********1045 - Access denied for user 'root'@'localhost' (using password: YES)********** (小插曲:记得不知道这是多少次安装MySQL了,以前用的是SQLyog,突然安装了一个Navicat,尽然出现错误,让自己小小的汗颜了一把!!!经过上网查资料,解决方法陈述下文) [问题所在]:未给root用户分配所有权限. [解决步骤]:例如:用户名:a

Wampserver安装好后如何更改默认根目录www呢?

Wampserver安装好后,“www目录”默认为X:/wamp/www,(这里的X是盘符)也就是wampserver安装目录下的www文件夹.实际使用中,默认设置往往不是我们想要的,可能改成其他文件夹更适合我们. 比如e:/xx 或者 d:/php等等. 下面以原来的默认目录为d:/wamp/www改为e:/xx为例. 1. 打开wamp/scripts/config.inc.php 第47行,$wwwDir = $c_installDir.’/www’; 修改为:$wwwDir = ‘e:/