Skip to content

Website completely blank after EC2 reboot - multiple services down

0

Website completely blank after EC2 reboot - multiple services down

Instance details:

  • Region: us-west-2
  • Status: Running, 2/2 checks passed 2.compute.amazonaws.com
  • Cannot SSH in (EC2 Instance Connect fails with "Error establishing SSH connection")

Website progression:

  1. Was working fine before reboot
  2. After first reboot: "Unable to connect to database" error
  3. After second reboot: Completely blank page (no content at all)

I need help restarting web server and database services without SSH access. I have a basic AWS account so no direct support access.

Any guidance would be greatly appreciated!

asked 16 days ago34 views
2 Answers
1

Hello.

Please try setting up an IAM role for your EC2 instance and connecting via Systems Manager Session Manager.
If you are not using CentOS or similar on EC2, the SSM Agent should be installed, so you should be able to connect by setting up an IAM role.(The EC2 instance must be placed in a public subnet or be able to communicate with Systems Manager via a VPC endpoint.)
https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/access-a-bastion-host-by-using-session-manager-and-amazon-ec2-instance-connect.html

EXPERT
answered 16 days ago
0

The blank page and SSH connection failure suggest your web server and database services didn't restart after the reboot. Here's how to troubleshoot without SSH access:

Regain Console Access:

Use AWS Systems Manager Session Manager as an alternative to SSH:

Navigate to Systems Manager → Session Manager → Start Session Select your instance and connect This works if your instance has the SSM agent (pre-installed on Amazon Linux 2/2023 and recent Ubuntu AMIs) and an IAM role with AmazonSSMManagedInstanceCore policy attached.

Restart Your Services:

Once connected via Session Manager, check service status:

sudo systemctl status apache2   # or httpd/nginx sudo systemctl status mysql     # or mariadb/postgresql Start the services and enable them for automatic startup:

sudo systemctl start apache2 sudo systemctl start mysql sudo systemctl enable apache2 sudo systemctl enable mysql If Session Manager Isn't Available:

If your instance doesn't have SSM agent/role configured, you'll need to:

Stop the instance (not terminate) Detach the root EBS volume Attach it to another EC2 instance as /dev/sdf (In any public subnet to ssh properly for testing ) Mount the volume and check logs in /var/log/ or modify systemd configs to enable services on boot Reattach to original instance and start it Prevent This Issue:

Ensure services start on boot:

sudo systemctl enable apache2 sudo systemctl enable mysql Relevant Documentation:

AWS Systems Manager Session Manager: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html Troubleshoot EC2 Instance Connect: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-troubleshooting.html

answered 15 days ago
EXPERT
reviewed 15 days ago

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.