내용으로 건너뛰기

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!

질문됨 10달 전127회 조회

2개 답변
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

전문가

답변함 10달 전

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

답변함 10달 전

전문가

검토됨 10달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠