AWS hosted website not working, what would be the problem? - amazon-web-services

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>/

Related

Can't reach to an AWS EC2 instance website

I just launched a instance on AWS and I'm trying to open the website. So I copy the Public IPv4 address and paste it on my page. But it always returns This site can’t be reached 35.78.183.239 took too long to respond.
I've changed my firewall setting to access google chrome and set security groups HTTP, HTTPS. I can't figure out where the problem is. Any suggestions?
You didn't specify what webserver or AMI is on your EC2 instance.
You need to setup an AMI or manually install and setup a webserver for anything to show, otherwise the EC2 instance, while reachable, will not respond.
Make sure that ssh access is enabled and try ssh into the machine. If you can successfully login, then you know the instance is reachable and the problem is with your webserver software. This will help you debug.
What port is your application running on? When you enable HTTP and HTTPS it only allows ports 80 and 443 on the security group. This won't help if your application runs on a different port, so you'll need to add that to your security group to allow inbound traffic.

Request to an Ec2 instance return 403 after configure an elastic IP

I'm facing an issue with my ec2 instance. Until now, I had an ec2 instance working with an IP like this: ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com.
Now I configured an elastic IP to make that instead of use the default domain uses one of my own.
Something goes wrong because now a receive a 403 if I make a request pointing to my new domain.
I'm check that I'm still able to connect to my Ubuntu server 20.04 LTS through SSH. Only have to change the host name to my new domain.(I'm using PuTTy)
Searching on internet if found that the problem can be that my machine still have the old domain in some config files. I don't have experience with Ubuntu servers. I try to find the http.conf file or the apache2 directory in etc., but no one is present.....
I don't know what to do next.
I have to change some configuration file? In that case, which one?
I leave you some images from my machine:
Root
etc folder
For further information, the security group of my ec2 instance have these rules:
Any help will be appreciated. Thanks
-EDIT
I'm trying to access the server, making a request, with Postman like this.
And that is the error:
For more information. I implemented my ec2 using this video:ec2 video
And I changed the domain with that video:link ec2 with namecheap domain
I'm afraid it is a propagation issue, that takes more time than the 48 hours, because now it starts to works without changing absolutely nothing. Sorry
It appears that your requirement is to point bochogame.com to an Elastic IP address.
You can do this by using a DNS Service, such as Amazon Route 53. You would create a A-Record record that points that domain name to the IP address.
If you are unfamiliar with these concepts, I recommend watching some YouTube videos such as DNS with AWS Route 53 - YouTube.

Connect AWS EC2 instance to a domain on GoDaddy

I have an AWS EC2 instance. I created on the AWS console an elastic IP address ec2-XX-XX-XX-XXX.yy-yyyy-X.compute.amazonaws.com, and I got a domain name "my-domain.com" from GoDaddy.com
I used this tutorial and others which were very similar to "link" my-domain.com to the EC2 instance elastic address. I went through all the steps, in the DNS manager, on GoDaddy, and I waited more than 72h now. When I try to connect to my-domain.com I am however redirected to a GoDaddy page saying that my-domain.com is parked free. Is there something that I am missing? Is the tutorial I followed outdated?
I am not sure how relevant it is to the above but I have an API set up on that AWS EC2 instance which is correctly responding when I go to http://ec2-XX-XX-XX-XXX.yy-yyyy-X.compute.amazonaws.com/api/my-endpoint. I am using Nginx and Gunicorn to deploy the api and it works like a charm. I however get redirected to "my-domain.com is parked free" when I try http://my-domain.com/api/my-endpoint.
And I am using indeed "http", in lieu of "https", to make connections to the api for now, I am looking to get a proper domain name attached to the EC2 instance before I go through the procedure of getting a proper SSL certificate. Could that be an issue too?
Thank you in advance
Cheers
[EDIT]
This is my config on GoDaddy.com
Where the black box is the copied / pasted "Public IPv4 address" (which corresponds to the elastic IP address I set up for the EC2 instance). Should I use the Public IPv4 DNS instead? (ecX-XX-XX-XX-XXX.yy-yyyy-X.compute.amazonaws.com). When I try the function "Dig" on https://toolbox.googleapps.com/apps/main/, it returns the wrong IP address for "my-domain.com". I am assuming it is returning one of GoDaddy.com IP with the "my-domain.com is parked free", but it is definitely not the elastic IP that I selected for my AWS EC2 instance.
I solved my problem and I can now correctly access my API on "my-domain.com"
As it turns out, the tutorial I shared initially as part of my question is incomplete and partly outdated I think: there is some configuration required on AWS using the service "Route 53". There is an excellent tutorial on Youtube to guide you through the steps. I followed it and it solved my issue.
In a nutshell: when you open "Manage DNS" on GoDaddy.com, you have to enter custom name servers which are given to you by the AWS console after a bit of configuring.

Whitelist AWS self in inbound connection

I am deploying a laravel installation in AWS, everything runs perfectly when I allow it to recieve all inbound traffic (EC2>Network&Security>Security Groups>Edit inbound rules.), if I turn off inbound traffic and limit it to an IP it doesnt load the webpage it gives me this error:
PDO Exception SQLSTATE[HY000] [2002] Connection timed out
However for security reasons I dont want this setup like this, I dont want anyone being able to even try to reach my webapp. Everything is being hosted in AWS, I dont have any external entities, its running in RDS and EC2. I added en elastic IP address and whitelisted it, but that didnt work either. I followed every step in this tutorial : http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-laravel-tutorial.html#php-laravel-tutorial-generate
Environmental variables are working as well as dependencies, well.. pretty much everything unless I restrict inbound traffic as I mentioned.
How do I whitelist AWS own instance then to make this work with better security?
Thank you!
I think part of this answer is what you may be looking for.
You should enable inbound access from the EC2 security group associated with your EC2 instance, instead of the EC2 IP address.
More than just adding an elastic IP address to your AWS instance you need to do two more things.
Assign the elastic IP to your AWS instance ( yes is not the same as just adding it to the instance, you must specify )
White list the internal IP that it generates once you link it to your app.
?????
Profit

website hosted in AWS does not show up

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.