Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up a custom domain with Amazon S3

I bought a domain name through iwantmyname.com and got stuck setting up the static website hosting though S3 when following this guide: http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html What I want is to set everything up so that when someone goes to mydomain.com they see my index.html file hosted on S3 and the URL should not change to something else like mydomain.com.s3-website-us-west-2.amazonaws.com I just want it to be mydomain.com I got stuck on everything past Step 3.2 where it has me configure the Route 53 stuff. Does anyone have a better step by step guide for this? Amazon didn't do a very good job, possibly on purpose to entice people to buy their support.

like image 614
ahetman Avatar asked Feb 09 '14 16:02

ahetman


1 Answers

Figured this out on my own. Here is what needs to be done:

  1. buy your domain, example.com
  2. go to the Amazon S3 console and create a bucket named example.com
  3. add your index.html file to it and provide read permissions
  4. enable static website hosting for the bucket, using example.com in the field
  5. go to the R5 routing part of the console and add a Type A record set (IPV4)
  6. Select Yes for Alias and choose the endpoint from the drop down, it will be something like

    example.com..s3-website-us-west-2.amazonaws.com
    
  7. Hit 'Create'

  8. Go back to Hosted Zones and click the example.com zone, on the right you will see 4 namespaces that look something like this:

    ns-XXXX.awsdns-54.org
    ns-XXX.awsdns-15.com
    ns-XXXX.awsdns-45.co.uk
    ns-XXX.awsdns-27.net
    
  9. Copy these namespaces to a notepad or something

  10. The Amazon side is now configured, we just need to do the domain side, so in my case I went to iwantmyname.com
  11. Go to edit namespaces, and change them to the ones you copied from step 8
  12. We're done! Just be patient as it does take some time to configure all of this. In my case it took about 15 minutes. You can ping the website or use nslookup to check up on the progress through your console:

    ping example.com
    nslookup example.com
    

pinging is inferior to nslookup with S3 since Amazon blocks them

like image 81
ahetman Avatar answered Oct 13 '22 00:10

ahetman