<commit_before>---
title: Zero to HTTP/2 with AWS and Hugo
author: <NAME>
date: 2017-02-10T16:41:53+08:00
modified: 2017-02-05
excerpt: A step-by-step guide to building your own hacker blog.
categories: [tutorials]
tags: [aws, hugo, http2, webperf, web, ssl, https]
header:
  overlay_image: 4fqamznaguo-reginar_1280.jpg
  overlay_filter: 0.5
  teaser: 4fqamznaguo-reginar_512.jpg
featured: true
---

Those who subscribe to [Node Weekly](http://nodeweekly.com/) may have seen a post in early 2017 from <NAME> titled [Running Express, Koa And Hapi On HTTP/2](http://ivanjov.com/running-express-koa-and-hapi-on-http-2/). In his post Ivan gives a brief overview of the new HTTP protocol and describes some of the HTTP/2 key advantages, such as speed.

Ivan goes on to share code snippets for implementing HTTP/2 in several popular Node-based web servers, something JS developers (especially fans of [JSPM](http://jspm.io/)) might enjoy, but entirely unnecessary if you're using CloudFront---which [announced HTTP/2 support](https://aws.amazon.com/about-aws/whats-new/2016/09/amazon-cloudfront-now-supports-http2/) in September 2016---to serve static websites like those generated with Hugo.

**In this post you will learn how to go from Zero to HTTP/2 with AWS and Hugo, the [fastest static site generator](/choose-hugo-over-jekyll/) in existence.**

<aside class="notice--success">
  <h4>Why spend time doing this?</h4>
  <p>Here are some carrots, assuming you even like vegetables. When finished you will have:</p>
  <ul>
    <li>A personal hacker blog with <b>PageSpeed 100</b> for desktop and mobile</li>
    <li>Mobile <b>interactive pages in 0.767 seconds</b>, worldwide</li>
    <li>Ability to generate 400 blog posts in a half-second</li>
    <li><b>HTTPS by default</b>, with full transference of link juice</li>
    <li>A way to <b>receive emails</b> at your own domain <i>without Google</i></li>
    <li>Best of all, <b>no more Let's Encrypt</b> cert renewals (hooray!)</li>
  </ul>
  <p><small>See <a href="#benchmarks">Benchmarks</a> for how these numbers were determined</small></p>
</aside>

Sound good? I thought so too. Let's get started.

## Get started with AWS and Hugo

First, [create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/). If this is your first time using AWS you will benefit from a free year of service (after that it's cheaper than [Digital Ocean](https://m.do.co/c/9d5c1c681fd0)). If you already have an AWS account, proceed to the next step.

Next, install [After Dark](https://github.com/comfusion/after-dark), a hacker theme I created for Hugo. The instructions assume you're using macOS, though other platforms are supported as well.

## Install s3_website

`s3_website` is a RubyGem utilizing the AWS-CLI that can be used to automatically configure your website on AWS, and deploy it to CloudFront in a matter of seconds from your local machine. See [the README](https://github.com/laurilehmijoki/s3_website) for installation and usage instructions.

**Note:** Be sure you install version 3.0.0 or better to take advantage of the HTTP/2 configuration settings for CloudFront distributions.<commit_msg>Period<commit_after>---
title: Zero to HTTP/2 with AWS and Hugo
author: <NAME>
date: 2017-02-10T16:41:53+08:00
modified: 2017-02-05
excerpt: A step-by-step guide to building your own hacker blog.
categories: [tutorials]
tags: [aws, hugo, http2, webperf, web, ssl, https]
header:
  overlay_image: 4fqamznaguo-reginar_1280.jpg
  overlay_filter: 0.5
  teaser: 4fqamznaguo-reginar_512.jpg
featured: true
---

Those who subscribe to [Node Weekly](http://nodeweekly.com/) may have seen a post in early 2017 from <NAME> titled [Running Express, Koa And Hapi On HTTP/2](http://ivanjov.com/running-express-koa-and-hapi-on-http-2/). In his post Ivan gives a brief overview of the new HTTP protocol and describes some of the HTTP/2 key advantages, such as speed.

Ivan goes on to share code snippets for implementing HTTP/2 in several popular Node-based web servers, something JS developers (especially fans of [JSPM](http://jspm.io/)) might enjoy, but entirely unnecessary if you're using CloudFront---which [announced HTTP/2 support](https://aws.amazon.com/about-aws/whats-new/2016/09/amazon-cloudfront-now-supports-http2/) in September 2016---to serve static websites like those generated with Hugo.

**In this post you will learn how to go from Zero to HTTP/2 with AWS and Hugo, the [fastest static site generator](/choose-hugo-over-jekyll/) in existence.**

<aside class="notice--success">
  <h4>Why spend time doing this?</h4>
  <p>Here are some carrots, assuming you even like vegetables. When finished you will have:</p>
  <ul>
    <li>A personal hacker blog with <b>PageSpeed 100</b> for desktop and mobile</li>
    <li>Mobile <b>interactive pages in 0.767 seconds</b>, worldwide</li>
    <li>Ability to generate 400 blog posts in a half-second</li>
    <li><b>HTTPS by default</b>, with full transference of link juice</li>
    <li>A way to <b>receive emails</b> at your own domain <i>without Google</i></li>
    <li>Best of all, <b>no more Let's Encrypt</b> cert renewals (hooray!)</li>
  </ul>
  <p><small>See <a href="#benchmarks">Benchmarks</a> for how these numbers were determined.</small></p>
</aside>

Sound good? I thought so too. Let's get started.

## Get started with AWS and Hugo

First, [create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/). If this is your first time using AWS you will benefit from a free year of service (after that it's cheaper than [Digital Ocean](https://m.do.co/c/9d5c1c681fd0)). If you already have an AWS account, proceed to the next step.

Next, install [After Dark](https://github.com/comfusion/after-dark), a hacker theme I created for Hugo. The instructions assume you're using macOS, though other platforms are supported as well.

## Install s3_website

`s3_website` is a RubyGem utilizing the AWS-CLI that can be used to automatically configure your website on AWS, and deploy it to CloudFront in a matter of seconds from your local machine. See [the README](https://github.com/laurilehmijoki/s3_website) for installation and usage instructions.

**Note:** Be sure you install version 3.0.0 or better to take advantage of the HTTP/2 configuration settings for CloudFront distributions.
{'fraction_non_alphanumeric': 0.109478672985782, 'fraction_numerical': 0.027172195892575038, 'mean_word_length': 4.374363327674024, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4257820', 'n_tokens_mistral': 2058, 'n_tokens_neox': 1905, 'n_words': 787}