Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Amazon Web Services Bootcamp

You're reading from  Amazon Web Services Bootcamp

Product type Book
Published in Mar 2018
Publisher Packt
ISBN-13 9781788294454
Pages 338 pages
Edition 1st Edition
Languages
Toc

Static Website Hosting


Amazon S3 allows us to host a static website. Static HTML pages can be deployed on S3 and using the scripting language (such as JavaScript) we can make it a dynamic website. For hosting, we need to configure the bucket website configuration and map our domain name to redirect the request to the Amazon S3 bucket.

Let's see how we can host a static website on Amazon S3.

AWS Management Console

Let's see how to host a static website on Amazon S3:

  1. Create the S3 bucket and grant public access: Create a bucket with the name www.blog.tweakings3.com and grant Public permissions so that anonymous users can access the HTML files:

Figure 4.18: Create Bucket (www.blog.tweakings3.com)

  1. Upload the HTML file: Upload index.html file to bucket www.blog.tweakings3.com.
  2. Edit the Bucket permission: Go to the Bucket's Permissiontab and click on Bucket Policy.

Figure 4.19: Bucket Policy

Add the following policy and click on Save:

{ 
   "Version": "2012-10-17", 
   "Statement": [{ 
      "Sid": "AddPerm...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime