Cannot launch website in EC2 Instance.


When I launch a simple EC2 instance and open the IP address, I get an Error as "Your connection was interrupted". It used to work before, but I don't know what might have caused all of a sudden. I even checked the security group and it's correct as far I know, as I have given HTTP & SSH for inbound and All Traffic for outbound. Is there anything else to check or configure? I'm still learning the basics in AWS.

2 Answers

In addition to @Bard Lan's excellent answer, ensure the httpd service is running on the EC2 instance - if you're running Linux, you could try a systemctl status httpd or even ps -ef | grep httpd.

If you've rebooted the instance recently, it's possible the httpd service isn't configured to restart when the server does, in which case you can restart with a systemctl start httpd and then systemctl enable httpd to ensure the httpd service restarts on a reboot.

(The above assumes you're using the Apache web server, if not replace httpd with your preferred web server service.)

profile picture
answered 17 days ago

It's might caused by many reasons, you can check following configurations:

  1. Check the IP you used is "Public IP": if the Public IP is not assigned by default, you can allocate an Elastic IP and then attach it to your EC2 instance
  2. Confirm your EC2 instance is running at Public Subnet: you can verify it by checking route table related to the Subnet which EC2 running on, and make sure the route rule " to IGW (Internet Gateway)" is existed.
  3. Verify Security Group and Network ACL configurations: confirm the required ports are opened and check your Client IP is included in the Range of Source CIDR.
  4. Clarify if there any firewalls (such as AWS Network Firewall) are provisioned to block the traffic between EC2 instance and your Client environment.
  5. Check the application you deployed on EC2 instance is workable (or you can try the network availability by ICMP - ping [EC2 Instance IP])
  6. Check your Client Network, does it behind a VPN? Sometimes the VPN will block some traffics, or please eliminate any hinders possibilities for client side network.
answered 17 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.

Guidelines for Answering Questions