【问题标题】:Enable local network users to access WAMP sites, but except localhost page允许本地网络用户访问 WAMP 站点,但 localhost 页面除外
【发布时间】:2017-02-08 19:24:27
【问题描述】:

我将我的 WAMP 站点放在一个虚拟服务器上,我希望从那里连接到 VPN 的每个人都可以访问它。

如果我的服务器的 IP 地址是 172.13.12.156,在选择在 WAMP 中联机选项后,我可以访问以下站点之一:

http://172.13.12.156/mysite/

问题是当有人键入时我想删除访问权限:

http://172.13.12.156

这样他们就看不到 WAMP 面板了。

这可能吗?

附加信息

此时我已经尝试过:

<Directory "c:/wamp/www/"> 
    Order Deny,Allow 
    Deny from all 
    Allow from 127.0.0.1 
</Directory> 

<Directory "c:/wamp/www/my_site1/"> 
    # There will be comments here and some options like FollowSymLinks and AllowOverride Options Indexes FollowSymLinks Includes ExecCGI 
    AllowOverride All 
    Require all granted 
    Allow from all 
</Directory>

【问题讨论】:

  • 你使用的是什么版本的 WAMPServer?
  • @RiggsFolly:我使用的是 WAMP Server 2.5。
  • 此时我已经试过了:&lt;Directory "c:/wamp/www/"&gt; Order Deny,Allow Deny from all Allow from 127.0.0.1 &lt;/Directory&gt; &lt;Directory "c:/wamp/www/my_site1/"&gt; # There will be comments here and some options like FollowSymLinks and AllowOverride Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted Allow from all &lt;/Directory&gt;
  • 这是您对 Apache 的尝试吗?您是否在 httpd.conf 文件中完成了虚拟主机定义
  • 是的,我想授予对 my_site1 目录的访问权限,但我只能访问其中的索引文件。这是在 httpd.conf 文件中。

标签: server localhost wamp


【解决方案1】:

WAMPServer 2.5 使用 Apache 2.4

所以首先不要在同一节中将 Apache 2.2 语法与 Apache 2.4 语法(它很容易混淆 Apache)混为一谈。无论如何,最好只使用新的 Apache 2.4 语法。

<Directory "c:/wamp/www/"> 
    Require local
</Directory> 

<Directory "c:/wamp/www/my_site1/"> 
    Require all granted 
    # plus any other Options etc that are required by this site
</Directory>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-12-31
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    • 2017-08-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多