Unable to access EC2 Instance via public IP after reboot

Viewed 363

Unable to reach EC2 Ubuntu 18.04 server via Public IP

  1. Rebooted working EC2 instance
  2. Restarted normally, no errors
  3. Security Groups, check inbound OK on 80,443 & 22
  4. Able to ssh to server
  5. Can ping server from another EC2
  6. instance on same VPC/subnet
  7. Curl to private IP works from another
  8. EC2 instance on the same VPC/subnet
  9. Netcat shows server listening on port 80
  10. Other instances in VPC are fine, they are using the same security group

What else can I check?

1 Answers

I don't have enough reputation to add a comment, but another thing to check would be whether your web server (apache/nginx) is actually running. If not, then try

sudo systemctl start apache2

OR

sudo systemctl start nginx

Note: If you're not using a static IP on your EC2, your instance has changed IP address. You probably already know this since you can still ssh into your instance. But a consequence of this is that you will need to update your apache conf file to point to your new public IP.

Check all .conf files under /etc/apache2/sites-available and see if they contain the right IP address in ServerName field. Then reload apache.

sudo systemctl reload apache2

OR disable then enable conf files

sudo a2dissite your_conf_filename
sudo a2ensite your_conf_filename
Related