-5

I have created a VM on azure from the Ubuntu 14.04 LTS Canonical image. I can ssh to the public IP. I have added an inbound security rule for: http port (80), source: any, action: allow.

I am trying to use psping to ping to the port (since Azure does not allow regular pings):

psing [my ip here]:80

I see a bunch of " The remote computer refused the network connection." prints.

What else do I need to do to make sure port 80 is accessible publicly?

Paul
  • 2,474
  • 7
  • 33
  • 48
  • Possible duplicate of [Trying to ping linux vm hosted on azure does not work](http://stackoverflow.com/questions/34669632/trying-to-ping-linux-vm-hosted-on-azure-does-not-work) – CSharpRocks Jan 29 '17 at 13:34
  • Well, is there anything listening on TCP/80 in that VM? – evilSnobu Jan 29 '17 at 13:46

3 Answers3

2

The remote computer refused the network connection.

According to the error, you need check whether your app is running firstly.Based on my experience, if Azure NSG or Firewall block the port 80, you should get error Request timed out.

You could use netstat -ant|grep 80 Please ensure port 80 is listening like below:

tcp 0 0 :::80 :::* LISTEN

Note: port 80 should listening on tcp not tcp6.

Also, you could use telnet to check whether the port 80 is open on your public IP.

telnet yourip 80

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
1

Generally, there are 2 reasons for this to fail:
- Network Security Group must allow port 80 to be accessible
- Firewall on the VM itself must allow port 80 to be accessible
- Application must be listening on port 80

If anything of those is not in place the attempt to connect to port 80 will fail.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
0

The reason was that the webserver was not allowing connections from anyone else other than localhost.

I used the following tools to check things:

To check if local firewall is working: ufw status To check if webserver is really running: wget localhost:80 To check if the server is generally accessible (psping the ssh port): psping server_ip:22

Paul
  • 2,474
  • 7
  • 33
  • 48