2016-05-17 73 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>