Alias a Domain / Sub Domain Name to your S3 Bucket

amazons3

Jump Start our Journey to the Kloud. Amazon clearly provides simple Storage and cheap bandwidth for their S3 services, not mentioning their other features and scalability they offer. There are few requirements before this Journey :

  1. First of all, obviously, you need your own domain name and your own Amazon S3 account
  2. Second, You need a tool to create/manage Amazon S3 buckets, so you might need to install an add- on / 3rd party software on your machine.
    • Bucket Explorer, which is a full-featured and easy-to-use client that runs on Windows and Linux; (a Mac version is in private beta and should be available Oct 2007). A free, less-featured alternative is the S3 Organizer add-on for the Mozilla Firefox web browser.
    • Install your application or and either:
      • Open Bucket Explorer -or-
      • Open Firefox and go to Tools menu -> S3 organizer, and click the Manage Accounts button
    • Enter your AmazonAWS Access Key and Secret Key
      • These are available by going to http://aws.amazon.com, mousing-over the “Your Web Services Account” in the upper right-hand corner, and selecting “AWS Access Identifiers”

Done ? Great Job! Good news is You have completed the prerequisite. So what’s next ?

  1. Identify the EXACT domain name you wish to forward to Amazon S3. S3 is not a web server, so I would not recommend forwarding your entire domain there, but I would prefer a sub-domain. Let’s say the sub domain is: asgard.kloudgate.com
  2. Create a new “S3 bucket”  by clicking the “create folder/bucket” icon. Name the bucket exactly what your sub-domain name is.
    • Example bucket name: asgard.kloudgate.com
    • Note: you MUST use a unique bucket name; you won’t be able to create bucket if the name is already being used by someone else.
  3. Now the exciting part: modifying your DNS server settings. The procedures on how to do this vary by host and software system, below are the general steps:
    • Logon to your web host control panel and select “Manage DNS Server Settings” or similar
    • Create a new CNAME entry for your domain. For my example of asgard.kloudgate.com, the entry was:
      • Name: S3
      • Type: CNAME
      • Value: xxxxx.s3.amazonaws.com. ( Value might be vary – please refer to endpoint of your bucket.
  4. Now the boring part: IDLE – waiting. It took about 2 hours for my subdomain to be recognized by AWS.
  5. Check the subdomain name in your browser. You should now be able to access your files through any of 3 urls:
    1. subdomain.domain.com
    2. your_bucket_name.s3.amazonaws.com
    3. s3.amazonaws.com/your_bucket_name
  6. You need to set permissions on your S3 bucket using your favorite bucket management tool. Recommended settings : “full control by owner, read access for everyone”. Yes! This will prevent unwanted people from being able to modify your bucket.
  7. If you don’t want Google (or Google Images) to index the files in your subdomain, create a file named robots.txt containing the following and copy it into your bucket:

User-agent: *
Disallow: /

“The answers you seek shall be yours, once I claim what is mine.” Please leave a comment and notify me if I miss something.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s