2016-08-23 164 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的高級設置。

相關問題