I have a site hosted on AWS EC2 instance. I stopped the instance and started it up again and noticed the IP address had changed. Due to complications with this happening posts I read online suggested using an elastic IP. I allocated one and associated it with my EC2 instance. I also made sure that my hosted zone is pointing to my elastic IP. Now when I try to go to my domain I get the error "[site] refused to connect". I am able to ssh into my instance via terminal using the elastic IP. I am lost on where to go next. Any advice would be greatly appreciated. Thank you in advance!
Thanks to #strongjz I have the answer to the question. Hopefully this will help someone else in the future. Once you stop an amazon EC2 instance, not only do you need to check your IP address as it will change but also make sure to ssh into your instance and run sudo service httpd start to make sure that your web server is running. This was the problem for me. Took me days to figure it out. Big thanks to #strongjz for helping me with this!
Related
I could not connect again my EC2 instance from VScode .Yestedy I connected with my remote computer but today , I get error.Cannot connect with host.Can anybody help me please?
Check the IP addresses.
This is common because new AWS users don't realize the IP can change after stopping the EC2 and restarting, unless you assign an Elastic IP address.
So if you did not use an Elastic IP, and you have stopped and started the server, the IP would have changed.
However to properly assist you you will need to post more details like the error you saw and the settings of the EC2 instance.
please advise me.
I am no developer and very new to this. Our website is down and it keeps showing the following error:
This site can’t be reached
The connection was reset.
We are using AWS.
It keeps happening every few weeks. I tried redirecting it on AWS to a different website, for the time being, that didn't work either.
Any help is appreciated
If the website is hosted in EC2 instance
Check if your EC2 instance is having the same ip as earlier if it doesn't have a elastic ip associated with it chances are any restart of that ec2 instance might have changed the public ip address.
If above is same as earlier check the security group if it allows traffic on port 80 and 443 ( if using ssl )
And most importantly check if your website is indeed running i.e check with IP address in web browser i.e http://<ip_address>:<port>/ or https://<ip_address>:<port>/
I have followed what the guideline(https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html) has told me to do, and my instance have an Elastic IP. However, when I paste the Elastic IP into my browsers(Google Chrome/ Microsoft Edge) none of them worked. Here is a screenshot of the Security groups.
Any help is appreciated!
update 1: Sorry I am new to stackoverflow and forgot to post the screenshot last time. Now you can view the picture.
update 2: I think I've connected my instance with the Elastic IP. See here
update 3: Thanks everyone who offered help. I think I've made it. It is actually something about the firewall :-)
I have an weird issue with EC2 instance:
I start a new Ubuntu instance (or any other).
It initialize the instance and I can ping and connect via SSH, fine...
Suddenly, I can't ping anymore! :(
I have enabled all TCP, UDP and ICMP (inbound and outbound) connections in the instance's Security Group. But no luck.
I also have tried connecting via SSH using Putty. No luck too.
I have searched a lot, but everyone says about the Security Group, which I already had configured to allow all traffic.
Any help will be appreciated! Thanks!
Prints :
http://i.stack.imgur.com/7UtE6.jpg
http://i.stack.imgur.com/E3Ou8.jpg
PS: I don't have reputation to post the images directly... :(
I've just waited and now it seems to be ok.
Maybe it was just a matter of time, wait for AWS to apply the configuration to the EC2 instance (I am using the South America region, São Paulo). But it drove me crazy because I took almost a entire day to try to connect to the instance.
i've registered a .com domain name. At the Amazon Web Services account i own, I have already set up the DNS zone,i've changed the nameservers at my registrar's panel and i've created an A-record in my AWS DNS zone,too. I think i've done all the preparation needed. But my website is not opening!
This is not a DNS propagation time-requiring issue,by the time i did all the above stuff about 5 days ago (DNS had enough time to be refreshed globally in any ISP). Also via ipduh.com i can see that all the nameservers are correctly configured and recognised, as well as the *.mydomain.com A record which points at my AWS instance's IP.
What possibly would be wrong guys? :/ i've done anything i know and i've followed also the directions i've found in SO and i had no luck till now :/
Any suggestion and help would be highly appreciated :D
Thank you in advance guys!
I'm going to assume that the DNS is set up properly, and that the A record is pointing at the IP address assigned to your instance.
If this is a new AWS account, you're probably running in a VPC. Did you make sure that you allocated a public IP address to the instance? If your IP is 10.something, that's the internal, private IP address and you won't be able to use that. You'll need to allocate an Elastic IP and associate it with your instance, then update your DNS settings.
Next, make sure that the web server is up & running? If you log into the instance, what happens if you wget localhost? You might not get the page you're expecting if you're running multiple name-based virtualhosts, but you should get the index page for the default web site.
OK, so how you're sure the web server is running. Next thing to do is check the security rules. When you created your instance, you had give it the name of a security group. The default is, strangely enough, called "defaut". Take a look and see if port 80 is open. If not, open it up to the world (0.0.0.0) and see if you can access the web site now.
None of this helps? Reboot your instance and see if it starts working when it comes back up - it's possible that you're on a bad host, and rebooting will bring it up on different hardware.