- I created a new
Ubuntu T2 Micro
instance onEC2
, created a newElastic IP
and selectedEIP used in: VPC
, associated the address to my new EC2 Ubuntu instance.
I now have a Private IP and a Public/Elastic IP
. No Public DNS. My security group has SSH port 22
and HTTP port 80
and HTTPS 443 open
. I use Terraform to create server
user_data = <<-EOF
#!/bin/bash
sudo apt update -y
sudo apt install apache2 -y
sudo systemctl start apache2
sudo bash -c "echo your very first web server > /var/www/html/index.html"
EOF
I can connect to the instance just fine through SSH using AWS console, but when I try to browse to the Public IP through the browser it says connection refused. I can’t ping it either.
I use systemctl status to check the server, it’s saying
├─apache2.service
│ ├─2108 /usr/sbin/apache2 -k start
│ ├─2111 /usr/sbin/apache2 -k start
│ └─2112 /usr/sbin/apache2 -k start
I can ping google.com
form the Server.
I’m out of ideas.
Get website connected from public IP
2
Answers
This issue is fixed automatically when I tried to get in the web by public IP the second day. I am not sure if this issue is due to AWS cloud infra need time to consume new public IP? Like noticing routing table or forwarding table, but luckily it passed.
I think AWS supporter should troubleshoot this kind of issue, I believe not only me met it.
Some things to be aware of:
Some things to try:
curl -v http://localhost
or evencurl -v http://PUBLIC_IP_OF_INSTANCE