Hosting a static website on AWS S3
Hosting a static website on AWS S3
Hosting a static website on AWS S3 is a straightforward process. Here are the general steps:
4. Upload Folder:
5. Configure Properties: Enable static website hosting by going to the "Properties" tab and
selecting "Static website hosting." Choose an index document (e.g., index.html) and an
optional error document.
6. Set Permissions: Configure bucket permissions by adding a bucket policy that allows
public read access. This is necessary for users to view your website.
"Version": "2012-10-17",
"Id": "Policy1706857670574",
"Statement": [
{
"Sid": "Stmt1706857668899",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::camphelpinfo/*"
Download the file from S3 to your local machine. You can use the AWS S3 console, AWS
CLI . eg: aws s3 cp s3://your-bucket/path/to/your-file.html .
OR,
Simply you can download particular file from aws s3 .
2. Edit the File:
1. mkdocs build
2. mkdocs serve.
Or,
Or
aws s3 sync site/ s3://camphelp.info/
How to transferring the objects from the old bucket to the new one on
AWS S3?
1. Create a New Bucket: Make All changes like we do for new bucket
creation.
2. Transfer Objects: Use AWS CLI
• Created hosted zone- Route 53- to point to domain: Note: For this process your domain
name must be same as bucket name.
a) Give domain name same as your domain name and type should be “public hosted
zone”
b) Now create record See Screenshort
c) Now copy paste NS record from aws rote 53 to domain provider website :
See Screenshot:
It will reflect after sometime, you can check on cmd use command : ping
domain name , if it return reply means your domain is linked with your aws s3
website successfully.
https://www.youtube.com/watch?v=aWjCKHn27r8
View this video for SSL CERTICATE OR CLOUDFRONT. In fact for all whole process.