Can't view EC2 instance publicly

0

Hi,

I've just set up my first AWS instance, running on AL2. I've currentl unable to view the instance through the public DNS or IP (site can't be reached screen).

I've followed the AWS guide for setting up a web server;

  • Instance and RDS created and linked.
  • Security group allowing HTTP and HTTPS traffic on both IP4/IP6.
  • ACL has default allow all traffic rules on inbound/outbound traffic.
  • Apache, MySQL, MariaDB and PHP installed.
  • Apache is running.
  • Netstat shows server is listening on port 80
  • Curl localhost returns the Apache test page

SG Inbound Rules (https://pasteboard.co/g7L6vxu4yN35.jpg) NACL Inbound Rules (https://pasteboard.co/0v8NKJ7wejOo.jpg)

Any help would be much appreciated.

Thank you

profile picture
asked 7 months ago418 views
2 Answers
0

Curl localhost returns the Apache test page

Can you connect into your EC2 and run this command to get its public/internet IP?

curl checkip.amazonaws.com

Then run curl command on the returned IP, e.g. curl 1.2.3.4 Or you can run the command this way

curl `curl checkip.amazonaws.com`

After that, try accessing site from IP returned by curl checkip.amazonaws.com from your desktop browser

AWS
EXPERT
Mike_L
answered 7 months ago
  • Hi Mike. This returns the code of the Apache test page. Thanks

  • Great! I assume the site is now accessible.

  • No, I still have the site can't be reached page. Everything seems to be set up as it should be, yet I can't view it...

  • can you access site via IP returned from curl checkip.amazonaws.com from your desktop?

  • Nope. Neither the public DNS or IP address work.

0

It's hard to tell, but i do sound like you are being blocked by SG Rules. Can you share the exact setting for SG, NACL, EC2 instance, would be easier to help out then.

profile picture
EXPERT
answered 7 months ago
  • I've added image links to the question of those rules. Thank you!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions