How to troubleshoot the issue where your public website that is hosted on your Amazon Elastic Cloud compute instance is unresponsive.
Image Credit: AWS

How to troubleshoot the issue where your public website that is hosted on your Amazon Elastic Cloud compute instance is unresponsive.

A website hosted on EC2 instance can be unreachable for several reasons. Following are some of the common steps to troubleshoot this scenario.?


  1. Log into the EC2 console and check?systems and instance level health checks?of EC2 instance, make sure that both the health checks are passing. Confirm under that the monitoring tabs that all metrics (kernel panics, boot errors, out-of-memory errors, CPU usage Network statistics, network out, network in, storage, etc.) are within the limit.?
  2. Make sure that the instance-associated security groups and network ACLs allowed traffic on port 80 and 443. We can also check the network ACLs. Under the Networking tab.
  3. Make sure that the route table in the instance subnet has default route to the internet.?
  4. Make sure that the instance has an elastic IP address assigned to it. If you stop and start your instance, the elastic IP address remains associated with the instance. Make sure to map your elastic IP address to the domain name.
  5. To verify the httpd service and OS level firewall, connect to the instance and then use the following SSH command. So click on Connect. Copy the SSH command. Go to your terminal window.?

??????sudo systemctl status httpd

??????if the HTTP service is inactive or stop state and restart the service using the following command.?

??????sudo systemctl restart httpd

When the HTTP service is restarted, confirm its status using the following command.

sudo systemctl status httpd

6. Confirm that traffic is received on port 80 and 443 by running the following command:?

netstat -tunlp | grep -i http

7. Verify the status of OS-level firewall. If the firewall is active, either stop it or allow port 80 and 443. You can review the status of firewall using following command:?

sudo firewall-cmd --state

If the firewall service is running allow HTTP and HTTPS using the following commands:

sudo firewall-cmd --add-service=http --permanent

sudo firewall-cmd --add-service=https --permanent

sudo firewall-cmd --reload

on Ubuntu or Debian system, use the following command:

sudo ufw status verbose

If UFW (Uncomplicated firewall) is running on Ubuntu instance, then allow HTTP and HTTPS using the following command.

sudo ufw allow in 80/tcp

sudo ufw allow 443/tcp

sudo ufw status verbose

Finally, review the error and access log under \var\log\httpd. Then relaunch public website address to confirm if issue has been resolved.

Opeyemi ADEYEMI

Cloud Infrastructure Engineer || DevOps Engineer || Technical Support Engineer

2 年

??

Moh Shujath

Shift-Left Advocate | Driving Zero-Defect Quality from Requirements to Release | Automation | Agile | API | Cloud | Data | ETL | AI | Digital Payments | Healthcare | Cloud | CI/CD pipelines

2 年

??

要查看或添加评论,请登录

Taiwo Amao的更多文章

社区洞察

其他会员也浏览了