Connect AWS EC2 instance to a domain on GoDaddy - amazon-web-services

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.

Related

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.

AWS hosted website not working, what would be the problem?

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

Amazon Route53 domain not linking to Lightsail

I'm a complete newbie to networking so bear with me. FYI I am using the pre-bundled Ubuntu 16.04 instance on Amazon Lightsail. I am building a Django project.
I have a domain registered on Route53 that I am trying to link to my Lightsail project. I created a DNS zone and static IP following the Lightsail docs. Then I created the appropriate A and NS records in the Hosted Zone in Route53.
But when I run the Django server from the command line, using port 0.0.0.0:8000 (after doing sudo ufw allow 8000), I cannot connect to bungol.com:8000. I used this website to check if bungol.com is correctly linked but it seems there is no ip address attached to the domain.
So I have 2 questions:
Firstly, why is this not working?
Secondly, how do I go about troubleshooting such an issue? There are so many things here that could have caused the issue and I'm clueless as to how I should start solving the problem.
Answer, you did everything correctly.
How long did you wait after configuring your DNS records? Your screenshot does not show the TTL values, but you would have to wait at least that long usually.
I just went to your site www.bungol.com and it works. The IP address 19.221.198.143 matches based upon a ping.
There is some conflicting information in the docs (see discussion). The trick is to use Lightsail only to set up a static IP and use that IP for the A record on the Route53 side.
No need to set up a DNS zone in Lightsail or deal with its nameservers.

Redirect own domain to Amazon EC2 Windows Server 2012 Instance

We just created an AWS Windows Server 2012 Instance and now want to Redirect our Domain (bought and managed by 3rd Party) to this server.
we followed the two steps at the 1st ranked answer here: How redirect a domain to Amazon EC2 Machine?
While we managed to create and associate the elastic IP, the problem seems to be step 2 now: actually we have setup a A record at our current domain manager but still doesnt work. If we enter our domain at browser it seems to load for something and then stops after some seconds
We are very beginners and wondering where we need to put the lets say "index.html" or so like we did at our previous Webspace hoster. In other words, if the user access our server through the elastic ip, which direction the browser is firstly trying to enter?
The standard pattern is
... in aws route53 create a Hosted Zone
... by default it auto gives you Type NS and SOA copy the set of 4 values under your Type NS (similar to)
ns-125.awsdns-15.com.
ns-642.awsdns-16.net.
ns-1653.awsdns-14.co.uk.
ns-1473.awsdns-56.org.
... now get into your Domain Registrar and edit Nameservers by using above list
... upon deploying your aws cluster it will give you a loadbalancer value similar to
af327bdd34eca101010100a02debd892-11516969089.us-east-1.elb.amazonaws.com
... get into your aws route53 hosted zone console pick your domain
... hit Create Record Set on the right pick Type A
... IMPORTANT pick Alias YES see doc
... click in box Alias Target empty out field ... then choose above mentioned loadbalancer
I think you have security and firewall issues,
Check following items step by step:
Enter your EC2 IP address in your browser; you should see your app home page.
If you can't reach your server response by direct IP address, check your security group, inbound tab, you must open port 80 to source 0.0.0.0/0
Each time you see your home page by direct IP address in the browser you can go to next steps for domain and route53.
I tried to telnet 52.59.50.150 80 to your instance and it timed out so that means your HTTP port 80 is not open. Add below security rule to your security group. And then check your domain it will work.
We are actually wondering how the whole Setup should actually work.
We have dropped the Index.html on c:
Lets say we are trying to request the Microsoft Server EC2 through the elastic IP. How it is even trchnically possible that the server is finding and responding with exactly this Index.html?
Thats completely a blackbox for us besides the question if the security groups/rules/ports are established correctly...
I have solved my problem. Just for people that have the same problem:
Besides the points mentioned above you have to setup IIS (Microsoft Internet Information Service) on your server in order to redirect your domain to specific "folders" / index.htmls

AWS CPANEL WHM - IP Address and DNS Settings on new accounts

I've (hopefully) successfully set up Cpanel on AWS with clustering following the instructions: https://blog.cpanel.com/part-1-how-i-built-a-cpanel-hosting-environment-on-amazon-aws/
I've been using CPanel/WHM on a dedicated server for a few years before I set up this new Cpanel installation on AWS. My issues comes from how new accounts are set up differently on a dedicated server vs the AWS way.
My first issue:
When I created a new account on my dedicated WHM, I was provided IP Addresses from the server farm that I assigned to newly created accounts. Once assigned, I can access the site with either the IP or the domain name. Now with this new AWS way, there's no info in the tutorials about how I obtain new IP Addresses. I tried adding a new local IP like 10.0.0.30 (because it says it's in NAT mode and use local IP) and assigning this as a dedicated IP to the newly created accounts but I don't understand how anybody can access the site through that IP since its a local IP. So how do I access the domain through custom IP and domain like I did before? I must be missing something fundamental.
My second issue:
On my dedicated WHM after I created a new account, I would typically go to DNS Functions -> Edit DNS Zone and edit the zone to customize my nameserver as so:
mynewdomain.com
ns1.mynewdomain.com
ns2.mynewdomain.com
anothersite.com
ns1.anothersite.com
ns2.anothersite.com
thirdsite.com
ns1.thirdsite.com
ns2.thirdsite.com
and then in my register I would add these custom nameservers into the register and point them to the dedicated IPs of each domain. But with the AWS way, the only way I was able to set this up was to use the new cluster nameservers as the nameserver for ALL accounts in this new WHM installation.
Like this:
mynewdomain.com
ns1.awsnameserver.com
ns2.awsnameserver.com
anothersite.com
ns1.awsnameserver.com
ns2.awsnameserver.com
thirdsite.com
ns1.awsnameserver.com
ns2.awsnameserver.com
Is this the correct / the only way I can set up accounts now through this set up?
Is there a way to have custom nameservers names like I did in dedicated WHM?
In my case, I have a DNS server outside of Amazon so I'm not sure it would answer your question but it might lead you somewhere.
First to figure out what your public IP is you can:
Go to the AWS console and look at the instance detail of your server.
Look for the "endpoint". This points to your public address so you can do a PING or NSLOOKUP to find out what your IP is.
However, AWS does not recommend you hard-coding the public address as it could change. So what I did instead was to create a CNAME in my DNS that points to that "endpoint".
I hope that helps.