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?

  • May be 80 is not opened on ubuntu firewall? askubuntu.com/questions/646293/open-port-80-on-ubuntu-server – INVOKE Cloud 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 serverfault.com/questions/725262/… – user474743 Jun 20 '18 at 5:21

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

| improve this answer | |
  • 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 2: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

Not the answer you're looking for? Browse other questions tagged or ask your own question.