1- # Step-by-Step Setup Instructions for Let's Encrypt
1+ ![ letsencrypt-760x320 ] ( https://cloud.githubusercontent.com/assets/194400/23311312/8c4cc85a-faad-11e6-912c-9cc96ec21da6.png )
22
3- > Note: These instructions are only applicable to web apps
4- with a custom domain name.
3+ # Step-by-Step Setup Instructions for Let's Encrypt _ Free_ SSL
4+
5+ > _ Note: These instructions are only applicable to web apps
6+ with a ** custom domain** name_ .
57
68
79## Why?
@@ -12,12 +14,33 @@ to Secure/Encrypt all communications between users and your app.
1214
1315## What?
1416
15- Let's Encrypt offers a *** Free*** Automated SLL Certificate Service
16-
17+ Let's Encrypt offers a *** Free*** Automated SSL Certificate Service brought to you by the non-profit Internet Security Research Group (ISRG). <br />
1718see: https://letsencrypt.org/about/
1819
20+ ### Works for apps written in _ Any_ Language/Framework!
21+
22+ The instructions in this tutorial/guide are applicable
23+ to an app written in *** any language or framework*** .
24+ You will _ temporarily_ deploy a Node.js ` http-server ` to your Heroku app
25+ which will allow Let's Encrypt to _ verify_ that you "_ own_ " the app/domain.
26+
27+ > _ ** Note** : No Node.js knowledge is assumed or required. You won't be
28+ writing a single line of JS code._
29+
30+ Once you have set up SSL you can deploy what ever kind of app you like.
31+ (_ in our case the app is written in [ Elixir/Phoenix!] ( https://github.com/dwyl/technology-stack/#the-pete-stack )
32+ node.js is just an easy way to get this working in a ** generic** way._ )
33+
1934## How?
2035
36+ ### Step 0: Clone this Repository to get the Setup Code
37+
38+ ```
39+ git clone https://github.com/dwyl/learn-heroku.git
40+ cd learn-heroku
41+
42+ ````
43+
2144### Step 1: Install `certbot`
2245
2346> `certbot` installation instructions for various platforms:
@@ -38,20 +61,26 @@ Once you've installed `certbot` run the following command:
3861sudo certbot certonly --manual
3962```
4063
41- Top-tip you will want to use both the domain an ` www ` subdomain:
64+ Remember to use both the domain a ` www ` subdomain. ( _ separated by a space _ ) e.g :
4265
66+ ```
67+ example.com www.example.com
68+ ```
69+
70+ Our app was:
4371```
4472healthlocker.uk www.healthlocker.uk
4573```
4674
4775Follow the steps and ** pay _ close_ attention** !
4876
49- Enter the
50-
5177When you reach the screen that looks like this:
78+
5279![ certbot-instructions] ( https://cloud.githubusercontent.com/assets/194400/23255249/c7d2b250-f9b2-11e6-9d45-d2cdb965defa.png )
5380
54- Instructions: (_ for reference ONLY see below for modified instructions_ )
81+ _ ** DON'T** ` continue ` until you have completed
82+
83+ Instructions: (_ for reference ONLY see below for sub-set of instructions_ )
5584```
5685mkdir -p /tmp/certbot/public_html/.well-known/acme-challenge
5786cd /tmp/certbot/public_html
@@ -64,7 +93,7 @@ s = BaseHTTPServer.HTTPServer(('', 80), SimpleHTTPServer.SimpleHTTPRequestHandle
6493s.serve_forever()"
6594```
6695
67- You _ wont_ be _ able_ to run shell commands on the Heroku instance
96+ You _ wont_ be _ able_ to run shell commands on a Heroku instance
6897so we need to use a _ temporary_ node.js server to achieve our objective.
6998
7099In your ` current working directory ` (_ on your localhost_ )
@@ -82,6 +111,7 @@ printf "%s" WgFpodyij_PDzkU0MZ3CzKCI05hjLOcq2tP-1rs6ko0.kURQ5HbILtRXEwJA2QI4W5Td
82111```
83112The tokens will be _ specific_ to you so make sure you get the correct tokens.
84113
114+
85115### Step 3: Set Git Remote
86116
87117Check what your _ current_ ` origin ` remote is:
@@ -114,12 +144,16 @@ It should look something like this:
114144remember to (_ temporarily_ ) _ dissable_ the checkbox `Wait for CI to
115145pass before deploy` (_ we have no tests for this temporary server!_ ).
116146
117- make a commit on your local branch so you can push to github ( _ and trigger the heroku build _ )
147+ ### Step 4.1: Commit Your Changes ( _ the token file _ ) and Push to GitHub
118148
149+ Make a commit on your local branch so you can push to github (_ and trigger the heroku build_ )
119150
120151### Step 5: Visit the Endpoint in your Browser to confirm it worked:
121152
122- our is: http://healthlocker.uk/.well-known/acme-challenge/
153+ Visit your app in a browser to confirm the deploy worked.
154+ e.g: http://example.com/.well-known/acme-challenge/
155+
156+ The url for _ our_ app was: http://healthlocker.uk/.well-known/acme-challenge/
123157
124158![ click-on-filename-to-test] ( https://cloud.githubusercontent.com/assets/194400/23293421/eda79e68-fa5d-11e6-95d4-a8c57fe4a8fd.png )
125159
@@ -222,9 +256,15 @@ Restore the `default` branch for deployment on Heroku:
222256<br /> <br /><br /> <br />
223257
224258
225- ## Trouble-Shooting
259+ # Trouble-Shooting (_ if it doesn't work!_ )
260+
261+ The _ first_ time I tried to run the ` certbot ` command, _ nothing_ worked!
262+ E.g: the Build failed on Heroku, the cert process failed (_ see below_ ).
263+ This is a catalog of the Trouble-Shooting we did.
226264
227- The _ first_ time I tried this the build *** failed*** :
265+ > _ As always, if you get stuck,
266+ [ ** ask a question** ] ( https://github.com/dwyl/learn-heroku/issues )
267+ we will try our best to help!_
228268
229269![ heroku-activity-log-fail] ( https://cloud.githubusercontent.com/assets/194400/23256822/026ec3a8-f9b9-11e6-9c4b-c26af4276426.png )
230270
@@ -272,7 +312,11 @@ I deleted all the files created in the process and started from scratch ...
272312Failed again: <br />
273313![ fail again] ( https://cloud.githubusercontent.com/assets/194400/23263831/4c5070d4-f9d7-11e6-8559-57b2aa714b26.png )
274314
275- Just keep trying ...
315+ Re-trace your steps and make sure you followed the instructions _ exactly_ .
316+ Also, timing matters. if you take a break between steps
317+ you will get a "Time Out Error"...
318+ We initially got it wrong,
319+ but after re-running the command it works as expected.
276320
277321
278322#### If you get a _ Certificate Warning_ in Step 7.8
0 commit comments