【问题标题】:WampServer Apache not working anymoreWampServer Apache 不再工作
【发布时间】:2016-05-10 23:44:39
【问题描述】:

WampServer 图标是黄色的,我的带有数据库连接和使用的应用程序运行良好,但 Apache 无法启动,我需要它在不同计算机之间共享同一个数据库

当我启动 localhost 或 localhost/phpmyadmin 时,浏览器会给我一个“ERROR:CONNEXION_REFUSED”。 Apache 之前工作得非常好,但是我将 httpd.conf 更改为“要求所有被拒绝”到“要求所有被授予”以允许其他计算机连接数据库。 但它应该做与它实际做的完全相反的事情。 (我没用Skype,80端口是免费的,我测试了一下,发现auth.form_module、cache.socache_module在apache模块中有一个警告图标)

感谢您对我的问题的关注,祝您有美好的一天

【问题讨论】:

  • 你使用的是什么版本的 WAMPServer?

标签: apache wamp wampserver


【解决方案1】:

WAMPServer 的httpd.conf 文件中只有两个地方存在Require all denied 语法,它们是:-

<Files ".ht*">
    Require all denied
</Files>

这会阻止人们访问和.htaccess 文件,应该继续使用Require all denied

<Directory />
    AllowOverride none
    Require all denied
</Directory>

这将为安装 Apache 的驱动器设置基本安全性。 正确地说,NOTHING AND NOBODY 可以访问驱动器根目录或其任何子文件夹上的任何内容。 使用 Apache,您总是从拒绝所有访问开始,然后对于包含您网站的特定文件夹,您允许 Apache 访问。

假设您尚未为您的站点创建虚拟主机,You should and here is how to do it

但是假设你没有,那么你需要做的就是允许远程访问你的站点,就是告诉 Apache 任何人都可以访问你的站点。这只需使用 wampmanager 菜单即可完成:-

wampmanager -> Put Online

这将编辑 httpd.conf 文件的这一部分

来自

#   onlineoffline tag - don't remove
    Require local

#   onlineoffline tag - don't remove
    Require all granted

这将允许任何人访问,但只能访问包含 &lt;Directory "c:/wamp/www/"&gt; 块中提到的文件夹。哦,它还会自动重新启动 Apache,以便它接受更改

但是,有更安全的方法来执行此操作,如果您在 Intranet 中工作,听起来像,请使用 wampmanager 菜单再次手动编辑 httpd.conf 文件

wampmanager -> Apache -> httpd.conf

找到这个部分

<Directory "c:/wamp/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.4/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:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Require local
</Directory>

然后像这样在Require local 之后添加这个

#   onlineoffline tag - don't remove
    Require local

# to allow anyone on your subnet to access note only 3 of the 4 quartiles used
    Require ip 192.168.1

# or to be more specific
    Require ip 192.168.1.100
    Require ip 192.168.1.101
    Require ip 192.168.1.102
</Directory>

最后,如果您确实为这个项目创建了一个虚拟主机,请给我留言,我将添加一些描述如何执行此操作的内容,但仅针对一个虚拟主机。

【讨论】:

  • 首先,我要感谢您的快速回复,帮助我更好地理解配置文件但实际上我无法在线设置 wampserver,当我尝试时他向我发送了一条错误消息: “无法执行菜单项(内部错误)[异常] 无法执行服务操作:Le service n'a pas démarré”(服务未启动,我是法国人)我想尝试重新安装 WampServer 但我的同事已经开始填充数据库,我无法再访问以导出和保存数据...
  • 我会回到这个网络问题,因为他们要求我添加一个功能(一如既往:p)所以我还没有花时间完全阅读虚拟主机
  • could not execute menu item 要么是您在 PC 上没有所有必需的 MSVC 运行时 See this for help there 第 20 点。要么是因为单击菜单项时 Apache 没有启动
猜你喜欢
  • 2014-09-09
  • 1970-01-01
  • 2015-12-08
  • 2012-01-26
  • 2011-03-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-11
相关资源
最近更新 更多