Redirect own domain to Amazon EC2 Windows Server 2012 Instance - amazon-web-services

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

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.

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.

Resolve URL to AWS Server

I have a domain that I own. I will say is example.com. I added SSO.example.com as a Type A record on GoDaddy with a value of 37.89.245.2(example).
The IP address is a elastic IP on a Windows AWS server.
I can ping the IP address but I can't ping the URL. Do I need to do something with the IP address on the AWS Windows server to be able to ping the URL?
This is pretty much one of my first web based projects so any help would be appreciated!
Ping is not a reliable test method in AWS because most security groups do not permit inbound ICMP protocol, which is used by Ping. So, if you really want to test connectivity, do it on a port that you actually need your application to support, such as HTTP (80) or trying an SSH/RDP connection.
Another common use for a Ping is to resolve the domain name to an IP address, since it displays the result on-screen. This can be a good way to check that your Amazon Route 53 configuration is correct. (Same as a dnslookup.)
I was jumping the gun a bit and the new NameServers I was using had not replicated completely yet. After replication completed everything was able to be pinged successfully.

how to add a website to aws ec2 instance, no target

I've a nice little ec2 instance, I've logged in the console, updated the YUM, started the httpd, but the IP doesn't work in the browser.
my httpd is up on chkconfig: httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Thought it would be as listed on my connect from public DNS, same as I connect to console through. I've used the S3 server into the properties on the instance and enabled static website hosting, just to test it before using PHP. Even created a like bucket, trying to use my domain name from the Route 53, but the Route 53 also shows "No Targets Available" in the S3 (or any other).
Alrighty, found it. Was a security issue, but here is the process, in two quick url's.
Tutorial: Installing a LAMP Web Server on Amazon Linux
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html?shortFooter=true
But it says if it doesn't work, check the security groups, and a couple of clicks later you're looking at this.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html?shortFooter=true
Go into the security group settings and add http from pull down and it's done.
Also, the second part where there isn't a target, be sure and associate the elasticIP (created in the AWS services console) and sure enough a web server is up and running. Once you've the elasticIP address simply add it to the route 53 rule set(s).

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.