apache - 禁止 : You don't have permission to access/on this server, WAMP 错误

标签 apache windows-8 phpmyadmin wamp wampserver

我已安装 wamp 视窗 8 每当我转到 localhost 或 phpmyadmin 时都会收到上述错误。经过大量搜索,我找到了很多答案,其中包括将 httpd.conf 修改为 Allow from AllThis链接显示了这样一个带有更多信息的常见答案。

我的问题是,许多人认为它允许所有用户访问 phpMyAdmin 并且它不安全且易受攻击等。我想创建完全安全的 WAMP 服务器,如果我这样做可以吗?

有人可以为我提供一些引用或信息吗?

最佳答案

1.
首先
端口 80(或您使用的任何端口)和 443 必须允许 TCP 和 UDP 数据包。为此,请在 Windows 防火墙上为端口 80 和 443 创建 2 个用于 TPC 和 UDP 的入站规则。
(或者您可以禁用整个防火墙进行测试,但如果允许入站规则,则为永久解决方案)
2.
如果您使用的是 WAMPServer 3 请参阅答案底部
对于 WAMPServer 版本 <= 2.5
您需要更改 Apache 上的安全设置以允许从其他任何地方访问,因此请编辑您的 httpd.conf文件。
将此部分更改为:

#   onlineoffline tag - don't remove
     Order Deny,Allow
     Deny from all
     Allow from 127.0.0.1
     Allow from ::1
     Allow from localhost
到 :
#   onlineoffline tag - don't remove
    Order Allow,Deny
      Allow from all
如果“全部允许”行对您不起作用,则使用“要求全部授予”
那么它会为你工作。
WAMPServer 3 有不同的方法
在 WAMPServer 的版本 3 和 > 中,为 localhost 预定义了一个虚拟主机。所以不要修改httpd.conf文件,保留原样。
使用菜单编辑 httpd-vhosts.conf文件。
enter image description here
它应该是这样的:
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>
修改为
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
注意:如果您为端口 80 以外的其他端口运行 wamp,那么 VirtualHost 将类似于 VirtualHost *:86.(86 或您使用的任何端口)而不是 VirtualHost *:80
3.
进行此更改后不要忘记重新启动 Wamp 或 Apache 的所有服务

关于apache - 禁止 : You don't have permission to access/on this server, WAMP 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19377476/

相关文章:

apache - 如何让 Tomcat 在 WIndows 7 上运行?

apache - 使用docker bridge网络IP访问apache容器中的vhost

php 未通过 ssl 解析

R:安装失败 Slidify - 错误:命令失败 (1) 未被识别为 i/e 命令

Php从mysql数据库中删除项目

linux - bash脚本: Apache Server is running or not

c# - 在运行时设置应用栏按钮的图像

windows-8 - Windows 8 应用程序 list : Image Assets Error

mysql - SQL REPLACE 在 phpmyadmin 中给出错误

mysql - 如何在SQL查询中添加固定位置列?