Host a Website on Amazon S3

Let's host your very own website on Amazon S3!

Project work by Kevin Wandei on NextWork.

Introducing Today's Project!

Project overview

In this project, I will demonstrate the creation of static website. I'm doing this project to learn how to host a website on amazon S3

Tools and concepts

Services I used were Amazon S3. Key concepts I learnt include hosting a website, uploading static websites files ACL and how they control access.

Time, challenges, and wins

This project took me approximately one and a half hour. The most challenging part was resolving the 403 forbbiden error. It was most rewarding to host my static website public for everyone to see.

How I Set Up an S3 Bucket

What I did in this step

In this step, I will be opening an Amazon S3 because i will be using it as storage space for my website.

How long it took to create the bucket

Creating an S3 bucket took me 3 minutes

Region selection

The Region I picked for my S3 bucket was Europe because its nearest to me

Understanding bucket name uniqueness

S3 bucket names are globally unique! This means only one instance of the name can exist globally

Upload Website Files to S3

What I did in this step

In this step, I will upload files in the s3 bucket because without the files, i can not create a website.

Files I uploaded

I uploaded two files to my S3 bucket - they were index.html file and a folder containing resources I will use for my website.

How the files work together

Both files are necessary for this project as the contain resources I will be using to create static website

Static Website Hosting on S3

What I did in this step

In this step, I will configure s3 bucket for static website because website will be public in the internet

Understanding website hosting

Website hosting means what makes your website public on the internet.

How I enabled website hosting

To enable website hosting with my S3 bucket, I click the properties tab, scroll all the way down to the static web hosting panel, choose enable

Access Control Lists (ACLs)

An ACL is a way to configure access permissions for resources in a bucket. I have enabled it.

Bucket Endpoints

Understanding bucket endpoint URLs

Once static website is enabled, S3 produces a bucket endpoint URL, which is a regular website URL. It lets people visit your S3 bucket's files as a website.

What I saw when I tested the endpoint

When I first visited the bucket endpoint URL, I saw an error 403 Forbidden. The reason for this error was that my static website is being hosted by S3, but the actual HTML image files I have uploaded are still private.

Success!

What I did in this step

In this step, I will make my website files publicly accessible, because it will make my website visible and live on the internet

How I resolved the 403 error

To resolve this 403 Forbidden error, I selected the Objects tab, checked the checkboxes next to my index.html file and the folder of website assets.In the Actions dropdown, I chose Make public using ACL then refreshed the 403 Forbidden tab.

Explore this project