2016-08-23 162 views
2

我按照以下步骤设置了Wamp,但无法从网络中的其他计算机访问服务器。我究竟做错了什么?Wamp服务器Put Online无法正常工作

  1. 安装WAMP的64位版本3.0.4这个带有Apache的版本2.4.18
  2. 开始WAMP的服务器,右键点击系统托盘图标,选择Menu item : Online/OfflineWamp settings
  3. 点击(左点击)系统托盘图标,并选择Put Online
  4. 当我尝试从另一台计算机访问该服务器的网络中,服务器返回一个错误页面显示错误消息You don't have permission to access/on this server

我直接编辑了httpd-vhosts.conf文件并重新启动了所有服务,仍然收到相同的错误。下面是的httpd-vhosts.conf文件的内容和我的系统IP

的httpd-vhosts.conf

# 
# Virtual Hosts 
# 

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot C:/Users/dinesh/Softwares/Wamp64/www 
    <Directory "C:/Users/dinesh/Softwares/Wamp64/www/"> 
     Options +Indexes +FollowSymLinks +MultiViews 
     AllowOverride All 
     Require local 
     Require ip 100.97.67 
    </Directory> 
</VirtualHost> 

系统IP

mintty> ipconfig | grep IPv4 
    IPv4 Address. . . . . . . . . . . : 100.97.67.11 
mintty> 

回答

5

# 
 
# Virtual Hosts 
 
# 
 

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

替代由

# 
 
# Virtual Hosts 
 
# 
 

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

0

Put Online/ Offline菜单项目已经取得了可选的,默认情况下是不可见的,因为它在WAMPServer 3中基本上没有功能了。

在WAMPServer 3中,现在有一个虚拟主机定义为localhost d需要主持httpd.conf文件中定义的本地主机。

如果你看看新的菜单结构有在Apache菜单中调用httpd-vhosts.conf新的菜单项见下文

enter image description here

这将加载Apache虚拟主机定义文件到您的defautl编辑器。它应该是这样的:

# 
# Virtual Hosts 
# 

<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 local 
     Require ip 192.168.1.100 
     Require ip 192.168.1.101 
    </Directory> 
</VirtualHost> 

,或让所有的PC在您的网络访问添加只是第3 4四分位数的require任何IP将子网

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

内被允许如果您没有看到这个菜单那么你就需要从这里https://sourceforge.net/projects/wampserver/files/WampServer%203/WampServer%203.0.0/Updates/wampserver3_x86_x64_update3.0.5.exe/download 升级到3.0.5 WAMPServer是在WAMPServer 3.0.4

或者一个简单的升级,只需直接编辑0​​文件。

不要忘记在更改此文件后重新启动Apache。

+0

没有的httpd-vhosts.conf在我的菜单 – Dinesh

+0

我加了一些更多的信息,以我的答案 – RiggsFolly

+0

我所做的更改的httpd-vhosts.conf并重新启动所有服务,仍然得到同样的错误 – Dinesh

0

如果你所做的一切都是由其他答案建议,但它仍然不能正常工作,那么要确保你的端口80不被其他应用程序使用阳离子。

要快速检查,请在命令提示符下运行netstat -a -b命令。

在我的情况下,Skype使用的是端口80,我可以停止进入Skype的高级设置。

相关问题