Friday, February 4, 2022

[SOLVED] EC2 Instance with 'This site can’t be reached' error

Issue

I am always getting 'This site can’t be reached' error when trying to access the ip address of my EC2 instance.

This is happening for all ip addresses (Public IPv4 address, Public IPv4 DNS, Private IPv4 addresses, Private IPv4 DNS) and for all EC2 instances I create. Particularly, I am trying to run WordPress from my EC2 following this guide. All the installation runs fine but still the ip is unavailable.

Here are some proposed solutions I tried but didn't solve the issue:

  • My inbound and outbound security rules are already allowing ssh (port 22), http (port 80) and https (port 443) from all origins (0.0.0.0/0, ::/0).
  • I disactivated my Windows firewall. Anyway, I can't access from other computers or from my mobile either.
  • The ec2 created is the basic Linux 2 t2.micro (exactly as in the guide) and I have tried reaching the ip from a brand new ec2 instance without WordPress or anything and the same happens. Am I expected to get anything from the ip of a brand new ec2 at all?
  • I can connect with ssh without issues.

I am a root user under the free tier, is there any impact?

Would really appreciate if someone could tell where else to look as most solutions on internet point to the list above and none of them solved my case.


Solution

I tried that guide for myself.

There are a few typos around wp --info (it should be two dashes, no space).

Also, in the WordPress Installation, it says:

Navigate to /var/www/html and run:

$ wp core download.

It isn't too clear that you should first type cd /var/www/html so that WordPress installs in that directory.

Also, there should not be a period at the end of: wp core download

With those fixes, it installed WordPress and I was able to connect to the configuration page where it was asking for database details.



Answered By - John Rotenstein
Answer Checked By - Willingham (WPSolving Volunteer)