使本地网络用户能够访问WAMP站点,但localhost页面除外

时间:2016-09-30 09:06:11

标签: server localhost wamp

我把我的WAMP网站放在虚拟服务器上,从那里我希望所有连接到VPN的人都可以访问它。

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

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>

1 个答案:

答案 0 :(得分:2)

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>