HOW TO HOST A STATIC WEBSITE ON S3?

SAFI-ULLAH SAFEER - Feb 22 - - Dev Community

-STEPS TO HOST A STATIC WEBSITE ON S3:
1.OPEN S3 BUCKET FROM THE SERIVES OF AWS ON LOGIN CONSOLE.THE FOLLOWING SCREEN WILL APPEAR:
Image description!

  • Now Before creating a Bucket you must remember rules for naming a bucket. click the link below to see the rules for naming a variable . https://docs.aws.amazon.com/console/s3/bucket-naming
  • Now after that click on Create Bucket the following screen will appear.

Image description
3.Now select the Region where you want to create a Bucket.Like in this case "US East (N. Virginia) us-east-1".

  1. After that Enter the name of the bucket that must be "Unique Globally". Like in this case "safi1234" and create a default bucket witout more changing.

Image description
5.Now after that click on Bucket and upload the object on Bucket on the following screen.

Image description
6.Now after uploading your static website files the following screen will appear

Image description
7.Now after that go back to the bucket and you can see on the picture "Bucket and object is not public" below there is

Image description
Now the first step is to make it public go the "Permission" option on bucket and uncheck the box "Block public access and click on "save changes".
Image description"

  1. Now after that the next point is go to "Object Properties" and enable "Static Website Hosting".The following screen will appear

Image description
9.Now after that we have to create a bucket policy for this go to "Edit Bucket Policy" inside the permission option the following screen will appear

Image description
10.after that click on edit and copy the "Amazon Resource name(ARN)".The following screen will appear.

Image description
11.Now the next step is to write a policy for bucket or generate policy for bucket by default. In this case we generate the policy of bucket by default.click on "Generate Policy" The following screen will appear. In this we have paste the "ARN(Amazon Resource name)".And action selected "Get Object".

Image description
12.After that click on generate policy and copy the policy and paste it here and add "/*"at the end "Resource" the following screen will appear

Image description
And click on "Save changes."

13.Now at the end copy the link from here and open new tab and paste the link like in this case "http://safi1234.s3-website-us-east-1.amazonaws.com/" the following screen will appear.

Image description

Image description

Image description

Image description

SO finally "we have host our static Website on S3."

. . . . . .