0

It can be so easy. But I can not it.

I run a http server on my EC2 server. And I can access it through localhost.

enter image description here

My Inbound rules:

enter image description here

And my http request with Public DNS (IPv4):

enter image description here

What is the missing?

Qwer Sense
  • 101
  • 1
  • May be 80 is not opened on ubuntu firewall? https://askubuntu.com/questions/646293/open-port-80-on-ubuntu-server –  Jun 19 '18 at 21:52
  • firewall is inactive `ubuntu@ip-172:~$ sudo ufw status => Status: inactive` – Qwer Sense Jun 19 '18 at 21:59
  • 1
    Is the instance in a Public Subnet? (When you SSH to it, do you connect directly from a computer on the Internet?) Could you network be blocking traffic to certain IP address ranges? (Have you tried it from different locations, eg work and home?) – John Rotenstein Jun 19 '18 at 23:30
  • 1
    Your question is already answered here https://serverfault.com/questions/725262/what-causes-the-connection-refused-message – user474743 Jun 20 '18 at 05:21

1 Answers1

0

At a guess the webserver isn't listening to port 80, as you're getting Connection Refused in Chrome.

You can quickly test this with python:

 sudo python -m BaseHTTPServer 80

You should then be able to connect and get a 501 error back from python

NB: Don't use SimpleHTTPServer, you'll expose your server's filesystem to the internet

damolp
  • 331
  • 1
  • 6
  • Already I have a http server that listening on 80 port. I show in the first screenshot. – Qwer Sense Jun 20 '18 at 19:46
  • Its not listening on ethernet though (as evidenced by the conn refused from chrome), its probably listening on the loopback interface. – damolp Jun 21 '18 at 02:36
  • Yes you are right. I have installed another web server and it works. But my simple server is not work. What do I need to do? – Qwer Sense Jun 21 '18 at 19:00