0
votes

I have a root domain like example.com. It's now hosted on Amazon S3. For that I followed this tutorial:

http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

What would I have to do to have a subdomain like client.example.com to point to a EC2 instance?

client.example.com => ec2-XXX.us-west-2.compute.amazonaws.com

Is there like a tutorial out there explaining the steps?

2

2 Answers

1
votes

Two simple steps:

  1. You would just need to add a new 'A' record to assign the ec2 ip address to that subdomain in your amazon route 53 dns (or whatever dns provider you are using) - very simple to do. Step one will have requests for that sub-domain routed to the ec2 instance.

  2. Step 2 is to tell the web server you are running, when it receives a requests for that sub-domaain, what website should it serve up to the user - you do this by 'binding' the name to the directory/location thast has the website on your ec2 instance.

0
votes

You may also want to read over the following from AWS

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-ec2-instance.html

It would also be better practice to assign your EC2 instance an Elastic IP address then forward requests to that IP.

We recommend that you also create an Elastic IP address and associate it with your Amazon EC2 instance. An Elastic IP address ensures that the IP address of your Amazon EC2 instance will never change.