Host Static Website on AWS

Published on . Written by

Host Static Website on AWS

Having an individual website for your business will give you a worldwide reach and also helps you to expand your market. A separate website for your business will build trust among your customers which will boost your sales. You can also reduce the cost by advertising online which is more effective than the print advertisement. In this cloud computing project, we will discuss the advantages of having a website and how to host a static website on AWS.

Read more..

SLNOTE

Skyfi Labs Projects
Static Website - These websites are developed using frontend languages like HTML, CSS, Javascript, etc. It doesn’t have any dynamic content, static websites are simple HTML pages that are stored in the server it displays the page over HTTP when a user requests for.

Examples of the static website - Blog pages and documentation pages.

A dynamic website will have dynamic content which will change or generate the site based on the user request some examples of dynamics websites are quora, Facebook, youtube, etc.

Advantages of the static website:

  • Easy to host
  • Ideal for small businesses and websites
  • Can be developed quickly with less cost

SLLATEST
Disadvantages of the static website:

  • Developers need a strong knowledge of HTML/CSS to keep the website updated.
  • Functionality is limited in static websites
  • Not much interactive for the users
Project Implementation:

We are going to use Amazon S3 to host the static website. S3 (Simple Storage Service) is a simple web-based cloud storage service offered by Amazon to store data which can be retrieved at any time from anywhere over the internet.

First, start with naming your S3 bucket. Use your domain name itself for the bucket also. Buckets are storage containers where you can able to store files without any hierarchy

Using AWS console you can easily configure the S3 bucket to host your static website. Now, goto S3 in the AWS console. Select your bucket and click on properties > static website hosting> Use this website to host a website. Name index.html as the index document.

If you are a command liner who prefer CLI rather than GUI, you can use AWS CLI which gives you a command-line interface to host your website.

After configuring your bucket for website hosting you have an S3 URL. Now you need to give public access to your website so that your website will be accessible for everyone in the world. To do that click into your bucket and select permissions tab > Public Access Settings > Edit. Now, change the following to false and click save:

- Block new public ACLs and uploading public objects

- Block new public bucket policies

- Block public and cross-account access if bucket has public policies

Update the bucket policy to give access to everyone on the internet.

Note: “Principal”: {“AWS”: “*”} this part of the bucket will unlock your bucket to everyone in the world. If you are not willing to share some file with the internet do not put those files in this bucket.

Map your domain name to your S3 URL using the CNAME. Refer to the below example:

www.firstsite.com CNAME www.firstsite.com.s3-website-us-east-1.amazonaws.com

Now we will upload your static website go to your S3 bucket and click upload and add your static website directory leave the default permissions and click upload. Now your website is uploaded to S3 bucket you can check it using the URL which will load your static website from your S3 bucket.


SLDYK
Kit required to develop Host Static Website on AWS:
Technologies you will learn by working on Host Static Website on AWS:


Any Questions?


Subscribe for more project ideas