[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
-
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”.
-
Upload Your Website Files:
- Select your newly created bucket.
- Click on “Upload” and add your website files (e.g.,
index.html
,error.html
).
-
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”.
-
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”.
-
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.
-
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
.
- Your website will be available at the endpoint URL provided in the “Static website hosting” section. It will look something like
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?
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
2016-08-27 【223】◀▶ IDL HDF 文件操作说明