Hosting a Static Website on Amazon Web Services

You can easily and inexpensively use AWS to host a website that uses
client-side technologies (such as HTML, CSS, and JavaScript) and does not require
server-side technologies (such as PHP and ASP.NET). This type of site is called a
static website, and is used to display content that does not change
frequently.

After you complete this tutorial, you'll know how to do the following:

Deploy a static website – Host your static website using the
Amazon Simple Storage Service (Amazon S3) so that it is
secure, fast, protected against data loss, and can scale to support enterprise-level
traffic. You'll store your website files in Amazon S3 and use Amazon S3 to deliver your
content to visitors to your website.

Associate your domain name with your website – Use
Amazon Route 53 to tell the Domain Name System (DNS)
where to find the resources for your domain, such as your website content in Amazon S3.

Speed up your website – Use Amazon CloudFront to create a content
delivery network (CDN) that makes your website content available from data centers
around the world, called edge locations. Using edge locations
improves the speed of your website. This is especially important if your website
displays large media files such as high-resolution images, audio, or video.

Static Website Hosting Architectures

Before you create and deploy a static website, you must plan your architecture to ensure
that it meets your requirements. The following table shows how Amazon S3, Amazon Route 53, and
Amazon CloudFront work together to provide a seamless and cost-effective solution.

Requirement

Solution

Low-cost, reliable, online storage to host your static website

Amazon S3 is a low-cost, highly reliable web service for hosting static
websites.

A way to deliver content with low latency and high data transfer
speeds so that visitors to your website don't experience unnecessary
delays

CloudFront speeds up the loading of streaming or downloaded static
content by caching the content in edge locations. When your customer
visits your site, CloudFront delivers the content from the location that is
geographically closest to your customer, ensuring the lowest possible
latency.

To start hosting a static website on AWS, you'll do the following:

Create a location, that is, an Amazon S3 bucket, where you will store
the files, such as HTML, CSS, JavaScript, and images, for your website.

Upload the files to this bucket.

Make the files publicly viewable.

Configure the bucket to act as a website.

After you complete these first steps, visitors can access your website with a URL in the form
http://example.com.s3-website-us-east-1.amazonaws.com or
http://wwwexample.com.s3-website-us-east-1.amazonaws.com.

Next, you can add a custom domain to your static website by registering a domain name and
configuring AWS as your DNS service provider. Visitors can now access your website with
a URL in the form http://example.com or
http://www.example.com.

Finally, you can improve performance of your website by distributing it through a CDN. Visitors
can still access your website with a URL in the form
http://example.com or
http://www.example.com, but now they'll download the
files from the edge location closest to them.

Tutorial

This tutorial walks you through the process of hosting a static website on AWS. We'll use the
AWS Management Console to access AWS.