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
preguntada hace 7 meses432 visualizaciones
2 Respuestas
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
EXPERTO
Mike_L
respondido hace 7 meses
  • 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
EXPERTO
respondido hace 7 meses
  • I've added image links to the question of those rules. Thank you!

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas