2016-05-17 56 views
0

我设置了wamp可以在内部网上访问。WAMP内联网 - 仅禁止端口80

# onlineoffline tag - don't remove 
Require local 
Require ip 192.168.1 

但是,当我尝试访问它时,我得到401 Forbidden。 在机器上本身没有问题(本地主机),只有内部网上的其他计算机。

当我改变了WAMP访问使用端口8080,它是所有伟大的工作,但我需要它在80

没有的Skype或其他程序安装端口,正如我所说的80端口工作在本地主机内。

+0

你使用什么版本的WAMPServer? – RiggsFolly

+0

WAMP版本3.0.4 – gil

回答

0

如果WAMPServer 3使用的是再有就是对localhost默认的虚拟主机设置,这是你应该做的无障碍环境变化

编辑\wamp\bin\apache\apache{version}\conf\extra\httpd-vhost.conf

在那里你会发现这一点: -

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot c:/wamp/www 
    <Directory "c:/wamp/www/"> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 

添加您的Intranet访问到这里这样

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot c:/wamp/www 
    <Directory "c:/wamp/www/"> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Require local 
     Require ip 192.168.1 
    </Directory> 
</VirtualHost> 
+0

它是版本3. Vhost是唯一的选择吗? – gil

+0

VHost已经默认设置,你只需要编辑它。并且因为它被设置,所以'httpd.conf'中的配置被忽略 – RiggsFolly

0

编辑的httpd-vhosts.config

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot c:/wamp/www 
    <Directory "c:/wamp/www/"> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 

变化要求当地要求所有授予。 当它需要本地时只能通过本地主机访问来自其他主机的请求被拒绝。 最后它看起来像下面

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot c:/wamp/www 
    <Directory "c:/wamp/www/"> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost>