I’d like to learn more about CSS Corp

  • THOUGHT LEADERSHIP BLOGS

    Cogent Views on Technological Developments Driving Business Outcomes

  • FEATURED BLOGS

    Narratives on Technology Issues that Count

  • GUEST BLOGS

    Views and Cues from Global Leaders

    Disclaimer: Views and products mentioned by guests are not necessarily endorsed by CSS Corp

Hosting your website on AWS S3 for less than $1 / month

Websites are important for any business. Gone are the days where you need a computer and dial up connection for getting connected to the Internet and browse the ever expanding catalog of all websites/pages/resources that are spread across the globe. Internet, being global and is available in most of our hands today. Thanks to the global network connectivity and mobile computing that made this possible.

People across the globe are searching for services and products online. The ratio of people searching for products and services online to people searching physically is growing exponentially on a daily basis.

Every business needs a website for online presence and everyone is looking to have a website either to create a profile for themselves or write a blog on their area of interest. You can use profile services such as Facebook or blogging services such as Blogger but remember you are hosting your data in 3rd party servers and you have less administration capability at infrastructure level.

If you are a geek and you want to host your own data, you got to sign up for following services and be prepared to spend a few bucks for the luxury of hosting your data yourself. Sign up for Amazon Web Services (AWS), a Domain Name System (DNS) provider like dnsmadeeasy, optionally you can also sign up for cloud flare for securing your website.

S3(Simple Storage Service) hosting will cost you less than $1 a month provided you are not driving too much traffic and not hosting a size heavy website. Pls refer to AWS pricing (is there an online lookup site we can link to) for more details. If you are very specific about the cost factor, go to AWS billing and set up a notification trigger that will send you a notification when you cross a threshold (may be > $1 in this case) so you know when you hit your budget limits.

Here is a step by step procedure for hosting your website on AWS S3

  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/
  2. In S3 console, create a bucket – choose the region that's close to the website consumption
  3. Open the bucket Properties panel, click Static Website Hosting, and do the following:
    • Select the Enable website hosting
    • In the Index Document box, add the name of your index document. This name is typically index.html
    • Click Save to save the website configuration
    • Note down the Endpoint

The bucket name should be same as your URL. For example if your website URL is going to be www.thisismysite.com then your bucket name will be www.thisismysite.com

This is the Amazon S3-provided website endpoint for your bucket. You will use this endpoint in the following steps to test your website.

To add a bucket policy that makes your bucket content publicly available

  1. In bucket Properties panel, click the Permissions
  2. First give list and read permission to everyone so that everyone can access the website
  3. Click Add Bucket Policy

Copy the following bucket policy, and then paste it in the Bucket Policy Editor

{

"Version":"2012-10-17",

"Statement":[{

"Sid":"PublicReadForGetBucketObjects",

"Effect":"Allow",

"Principal": "*",

"Action":["s3:GetObject"],

"Resource":["arn:aws:s3:::www.thisismysite.com/*"

]

}

]

}

  1. In the policy, replace www.thisismysite.com with the name of your bucket
  2. Click Save

All these steps should be followed before you upload the index.html to your bucket or create other subfolders in your bucket. The reason for that is to ensure that all your permissions are synchronized to the index.html and other sub folders under the bucket.

To upload an index document

  1. Create a document. The file name must be same as the name that you provided for the index document earlier
  2. Using the console, upload the index document to your bucket.
For instructions, go to Uploading Objects into Amazon S3 in the Amazon Simple Storage Service Console User Guide

Test your website

  • Click on the endpoint – under properties of the bucket. The endpoint will be something like http://www.thisismysite.com.s3-website-region.amazonaws.com If your browser displays your index.html page, the website was successfully deployed.

Note:

  1. HTTPS access to the website is not supported
  2. You now have a website hosted on Amazon S3. This website is available at the Amazon S3 website endpoint
  3. Next you have to procure your domain and perform DNS cut over for your website
  4. Signup for any DNS service of your convenience like www.godaddy.com or www.dnsmadeeasy.com
  5. Create a CName record in DNS to point the required URL to S3 endpoint

Recap:

  1. Create bucket using the naming standards
  2. Enable static hosting and give the index file name in S3 properties
  3. Give necessary permission for everyone in the S3 bucket
  4. Add S3 bucket policy as appropriate
  5. Upload the index file
  6. Go to the endpoint and check if the website is loading
  7. Add CName record in your DNS so yourdomain.com points to the S3 endpoint
  8. You may have issues with root domain, in that case use redirection service for redirecting www traffic to http://yourdomain.com

CSS Corp Cloud team

Posts by Year

See all

Subscribe Here!

Recent Posts

The CSS Corp Editorial Team - Sep 5, 2022
The CSS Corp Editorial Team - Sep 1, 2022
The CSS Corp Editorial Team - Aug 29, 2022

Posts by Categories

See all

Reach Us

Thank you for reading CSS Corp Blog. The best way to reach us would be to fill the form below and we will get back to you.

reach-us