2015-11-26 147 views
1

首先,我想說的是,我已經閱讀了類似問題出現的其他主題,但應用解決方案,沒有人操作過我想要的內容。從另一臺計算機訪問虛擬主機

我在我的電腦裏有1個IP:192.168.1.217配置了一個虛擬主機。

C:\ WAMP \ BIN \ apache的\ Apache2.4.4 \的conf \額外\的httpd-vhosts.conf:

<VirtualHost *: 80> 
    ServerAdmin [email protected] 
    DocumentRoot "c:/wamp/www/sfi" 
    <Directory "c:/wamp/www/sfi"> 
        Options Indexes FollowSymLinks 
        AllowOverride All 
        Allow from all 
    </Directory> 
    ServerName sfi 
    ErrorLog "logs/sfi-error.log" 
    CustomLog "logs/sfi-access.log" common 
</VirtualHost> 

而且我已經添加了以下行:

NameVirtualHost *: 80 

在文件C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf我已經修改下列行:

Include `conf/extra/httpd-vhosts.conf` (remove `#`) 

<Directory /> (Grant permissions) 
    AllowOverride none 
    AllowOverride All 
    Order deny, allow 
    Allow from all 
</Directory> 

<Directory "c:/wamp/www"> (Grant permissions) 
     Order Deny, Allow 
     Deny from all 
     Allow from all 
</Directory> 

最後,我加入C:\Windows\System32\drivers\etc\hosts

127.0.0.1 sfi 

虛擬主機在安裝了wamp服務器的機器上完美工作。

在我要訪問我的項目的機器,我設置爲C:\Windows\System32\ drivers\etc\主機下面一行:

192.168.1.217 sfi 

而不是負載我的項目目錄。

有什麼我做錯了嗎?

謝謝。

+0

當您嘗試訪問服務器時發生了什麼具體情況? error_log說什麼? – covener

+0

不,我的虛擬主機在本地機器上運行良好。儘管在機器B上設置了我的/ etc/hosts文件,但只有我無法從另一臺機器訪問。 – urreta17

+0

對不起,我不明白。您的瀏覽器或命令行客戶端在機器B上說什麼?你的日誌在機器A上說什麼? – covener

回答

0

你只是有一個防火牆問題,完全在你的httpd配置之外。

+0

正如我可以檢查這個? – urreta17

+0

聳聳肩。 Windows防火牆? – covener

+0

嘗試通過其IP地址訪問您的網站。如果你可以使用ip地址訪問它,那麼你可能會遇到其他問題 –

相關問題