alex_bn_lee

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

[1048] Hosting a static website using Amazon S3

ref: Hosting a static website using Amazon S3

ref: Tutorial: Configuring a static website on Amazon S3


To host a static website on an Amazon S3 bucket, follow these steps:

Step-by-Step Guide

  1. Create an S3 Bucket:

    • Open the Amazon S3 console.
    • Click on “Create bucket”.
    • Enter a unique bucket name and choose a region.
    • Click “Create bucket”.
  2. Upload Your Website Files:

    • Select your newly created bucket.
    • Click on “Upload” and add your website files (e.g., index.html, error.html).
  3. Enable Static Website Hosting:

    • Go to the “Properties” tab of your bucket.
    • Scroll down to “Static website hosting” and click “Edit”.
    • Select “Use this bucket to host a website”.
    • Specify the index document (e.g., index.html) and error document (e.g., error.html).
    • Click “Save changes”.
  4. Set Bucket Policy for Public Access:

    • Go to the “Permissions” tab.
    • Scroll down to “Bucket policy” and click “Edit”.
    • Add a policy to allow public read access:
      {
      "Version": "2012-10-17",
      "Statement": [
      {
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*"
      }
      ]
      }
    • Replace your-bucket-name with the name of your bucket.
    • Click “Save changes”.
  5. Disable Block Public Access:

    • In the “Permissions” tab, click “Edit” under “Block public access (bucket settings)”.
    • Uncheck “Block all public access” and confirm the changes.
  6. Access Your Website:

    • Your website will be available at the endpoint URL provided in the “Static website hosting” section. It will look something like http://your-bucket-name.s3-website-region.amazonaws.com.

Example

If your bucket is named example-bucket and is in the us-east-1 region, your website URL will be:

http://example-bucket.s3-website-us-east-1.amazonaws.com

For more detailed instructions, you can refer to the AWS documentation12.

Would you like help with anything else?

 

posted on   McDelfino  阅读(4)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2016-08-27 【223】◀▶ IDL HDF 文件操作说明
点击右上角即可分享
微信分享提示