2016-12-22 65 views
1

我在Microsoft Azure中創建了Red Hat VM,並且能夠通過ssh進行連接。無法在Microsoft Azure中連接端口Vm

我已經在端口8081的VM中啓動了Java服務器,並且它已成功啓動。但我無法在瀏覽器中查看它。它不會被加載。

我曾嘗試以下和但都沒有得到加載: -

host:80 
host:8080 
host:8081 

我已經在網絡安全組添加入站安全規則和相關的子網它。但我仍然無法在瀏覽器中查看我的服務器。

我跟了這document爲入站安全規則

這是我入站規則enter image description here

netstat的-tuplen

(Not all processes could be identified, non-owned process info 
will not be shown, you would have to be root to see it all.) 
Active Internet connections (only servers) 
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name 
tcp 0 0 127.0.0.1:29131 0.0.0.0:* LISTEN 0 20864 - 
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 13894 - 
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 18132 - 
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 994 19499 - 
tcp6 0 0 :::111 :::* LISTEN 0 13893 - 
tcp6 0 0 :::8081 :::* LISTEN 1000 28721 3212/java 
tcp6 0 0 :::22 :::* LISTEN 0 18143 - 
tcp6 0 0 :::9080 :::* LISTEN 1000 28547 3212/java 
udp 0 0 0.0.0.0:68 0.0.0.0:* 0 16585 - 
udp 0 0 0.0.0.0:111 0.0.0.0:* 0 23825 - 
udp 0 0 127.0.0.1:323 0.0.0.0:* 995 15601 - 
udp 0 0 0.0.0.0:45876 0.0.0.0:* 0 16574 - 
udp 0 0 0.0.0.0:893 0.0.0.0:* 0 23826 - 
udp6 0 0 :::57126 :::* 0 16575 - 
udp6 0 0 :::111 :::* 0 23827 - 
udp6 0 0 ::1:323 :::* 995 15602 - 
udp6 0 0 :::893 :::* 0 23828 - 

SS -tln

State Recv-Q Send-Q Local Address:Port Peer Address:Port 
LISTEN 0 10 127.0.0.1:29131 *:* 
LISTEN 0 128 *:111 *:* 
LISTEN 0 128 *:22 *:* 
LISTEN 0 128 127.0.0.1:27017 *:* 
LISTEN 0 128 :::111 :::* 
LISTEN 0 50 :::8081 :::* 
LISTEN 0 128 :::22 :::* 
LISTEN 0 50 :::9080 :::* 

回答

2

根據您的截圖,我注意到你的ser副總監正在聽tcp6。據我所知,如果端口只提供ipv6服務,則不能使用IPv4地址進行訪問。

我注意到你使用的是jetty容器,默認情況下jetty使用IPv6。您可以允許碼頭部隊使用IPv4。關於此,有一個很好的answer

+0

我已經將NSG關聯到網絡接口。 – karan

+0

嗨,也許你可以嘗試使用本地主機進行測試。 telnet 127.0.0.1 8081' –

+0

當我在我的虛擬機中打開curl http:// localhost:8081時,我能夠得到響應。我相信開放端口是問題。 – karan