Hosting a Static Site in Amazon S3 using your Domain

A web server is not always required to host websites! Yeah you read that right. You can host your website just using Amazon S3. But it should be a static site i.e.,. it should serve only static content and client side scripts. This reduces costs and adds the benefit of being hosted in a well architect-ed infrastructure.
NOTE: A dynamic website which requires server power for processing containing scripts such as PHP, JSP or ASP.NET, etc.,. cannot be hosted using S3. A dynamic website can only be hosted in resources such as an EC2 instance.
Registering the domain:
The domain name have to be registered at a registrar if it is not registered already. We will be using the domain yourdomain.com with Amazon Route 53 as the DNS servers.
Configuring the S3 Buckets:
Two S3 buckets have to be created. One with the www sub domain and another without for example, two buckets namely yourdomain.com and www.yourdomain.com. One bucket will be containing the site’s content (bucket named yourdomain.com) and the other will be redirecting the http requests to the S3 bucket containing the site’s content.
You can create a homepage for your website and name it as you want. This file name will be specified as the index document for your website.The buckets have to be configured so that the objects inside the buckets are publicly accessible. The following bucket policy needs to be attached to the bucket yourdomain.com.

Comments

Popular posts from this blog

Introduction to SOLR Search Engine

10 Useful Node JS modules

Firebase Essentials