old-techblog/_posts/2017-12-29-jekyll-setup.md

3.1 KiB

layout title slug date categories
post Notes from setting up a Jekyll blog on AWS S3 and CloudFront jekyll-aws-s3-cloudfront 2017-12-29 15:00:00 +0000 jekyll setup

Here are my notes from today's task of setting up this blog.

  • Using Jekyll
    • Easy to setup
    • Built-in syntax highlighting
    • write/commit/push workflow
    • easy to deploy as static website
    • Compatible with GitHub and GitLab pages
  • Theme
  • Hosting
    • Considered GitHub pages, GitLab pages and static hosting using AWS S3
    • Requirements:
      • free (gratis)
      • easy-to-maintain, preferably static/serverless
      • Basic HTTPS support, with redirect from HTTP
    • GitLab Pages
      • Free static site hosting comparable to GitHub Pages
      • Pros:
        • Powerful containerized CI/build system
        • HTTPS support for static site, even on custom domains
      • Cons:
        • No option to force HTTPS
        • Tricky to get LetsEncrypt TLS certs to work with CI/build system - official tutorial is slightly out-of-date
    • GitHub pages
      • Pros:
        • Popular and well-documented
        • HTTPS support, including option to force HTTPS
      • Cons:
        • No HTTPS support for custom domains
    • AWS S3
      • Pros:
        • less managed than GitLab/GitHub - so a bit more setup, but also more flexibility
        • HTTPS support, as well as supporting "redirect objects" which effectively allow us to set up arbitrary 301 redirects on our site programatically.
        • supports multiple subdomains
      • Cons:
        • Not quite free, but very low cost for low usage
    • Ended up choosing S3
      • Created bucket, enabled static website hosting option
      • Added Cloudfront web distribution
        • Follow approach here to avoid 403 errors from S3 when serving paths without an explicit index.html, like /about
      • Added simple deploy script making use of AWS CLI
  • DNS
    • Registered domain
    • Added hosted zone to AWS Route 53
    • Updated nameserver records in Namecheap control panel to point at AWS
    • Added alias record to point at Cloudfront distribution
    • Added MX record to point at pre-existing Mailinabox setup