«

Sep
06

Host a static website on the cheap with Amazon S3.

I recently made a simple website for my father’s law practice www.wayzatacollectionlaw.com.  Amazon S3 now allows you to define a bucket as a static website.  S3 charges about .14 cents per gigabyte of storage and transfer.  The first 1gb of bandwidth out is free, and they charge 1 cent per 10,000 get requests, so you could theoretically host your site for 2-3 cents per month.

To set up your site, name your bucket the same name as your subdomain.  Ex: the bucket name I used was www.wayzatacollectionlaw.com.  This step is important because it will say your bucket is missing later if it doesn’t have the same name as the subdomain.  In the amazon s3 console, right click on the properties of the bucket and enable the bucket as a website.  I typed in index.html as my index file. They will generate an endpoint url for your site Ex: http://www.wayzatacollectionlaw.com.s3-website-us-east-1.amazonaws.com/  Upload your files to the bucket and make them public.

I then setup a cname dns entry to point to the endpoint.  I’ll explain how I did it with godaddy.  Under “My Account” click on the domain name.  Launch the dns manager.  Under the www entry, add the endpoint domain Ex: www.wayzatacollectionlaw.com.s3-website-us-east-1.amazonaws.com.  Then save.

Then go back and click on the domain name again.  Under forwarding, click the manage link.  Change it so that the site is forwarded to www.yourdomainname.com.  Then when people type your url without the www it will be forwarded to the correct place.

Besides being cheap, files stored in s3 are stored redundantly and are unlikely to be lost.  S3 also handles heavy traffic loads well.

© 2011-2017 HDCRT.com All Rights Reserved