August 22, 2020

How to setup alantsui.hk website with DigitalOcean Ghost 1-Click App?

Why not Ghost (Pro)?

Starcraft: We Require More Minerals.

Service Provider Min Charge (Monthly)
Ghost (Pro) USD 29
DigitalOcean Droplet + Weekly backup
= USD 5 + USD 1
= USD 6

DigitalOcean Ghost 1-Click App

Symptom 1

Press enter when you're ready to get started!

...

✔ Starting Ghost
One or more errors occurred.

1) SystemError

Message: Your domain name is not pointing to the correct IP address of your server, check your DNS has propagated and run `ghost setup ssl` again

Reason 1

Misconfigured or missing DNS A record

Solution 1

digitalocean-dns-a-record
And then continue with ghost setup command as ghost user.


Symptom 2

# Run as ghost user
$ ghost setup ssl
? Enter your email (For SSL Certificate) 
+ sudo .../acme.sh ...
✖ Setting up SSL
One or more errors occurred.

1) ProcessError

Message: Command failed: /bin/sh -c sudo -S -p '...'  .../acme.sh ...
[Fri Aug 21 13:07:18 UTC 2020] alantsui.hk:Verify error:Invalid response from ...
[Fri Aug 21 13:07:18 UTC 2020] Please add '--debug' or '--log' to check more details.
[Fri Aug 21 13:07:18 UTC 2020] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh

[Fri Aug 21 13:07:12 UTC 2020] Single domain='alantsui.hk'
[Fri Aug 21 13:07:12 UTC 2020] Getting domain auth token for each domain
[Fri Aug 21 13:07:14 UTC 2020] Getting webroot for domain='alantsui.hk'
[Fri Aug 21 13:07:14 UTC 2020] Verifying: alantsui.hk

Exit code: 1

Reason 2

DigitalOcean Ghost 1-Click App does not automate Let's encrypt configuration thoroughly.

Solution 2

# Run as root
sudo apt-get install python-certbot-nginx -y
sudo certbot --nginx -d alantsui.hk -d www.alantsui.hk

CloudFlare

TBA

HTTPS

Let's encrypt

certbot instructions for wildcard SSL certs

Google Analytics

Google Analytics + Ghost

AMP

How to find your Google Analytics Tracking ID

Discourse

Follow [discourse/docs/INSTALL-cloud.md]
(https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)
and discourse_docker

As default port is used by Ghost, I need to use another port for Discourse.

Alright, it's not trivial...
How To Install Discourse on Ubuntu 18.04
Advanced Setup Only: Allowing SSL / HTTPS for your Discourse Docker setup