I had so much fun moving my Coping Mechanism blog to Ghost that I thought I'd try it with this one, too.

For copingmechanism.com, I used the pre-built Ghost Droplet and it worked swimmingly. But how to add a second Ghost install? Turned out to be easy enough. Here's a quick summary of what I did (from memory, I should have written more of it down.)

Created a directory to house the files and run setup from it.

$ sudo mkdir -p /var/www/blog
$ sudo chown ghost-mgr:ghost-mgr /var/www/blog
$ chmod 775 /var/www/blog
$ cd /var/www/blog
$ sudo -i -u ghost-mgr
$ ghost install
$ ghost setup

Answered the prompts. I got the mysql password info from here...

$ cat /root/.digitalocean_password

I had trouble here. Ghost wouldn't start due to a database error. It turned out that the "ghost" Mysql user wasn't allowed to create databases so I manually connected to mysql as root and added one and granted "ghost" the appropriate privileges.

grant all privileges on blog_production.* to 'ghost'@'localhost';

Maybe I should have run setup as root?

After running ghost setup again, the blog, database, and SSL were set up and ready to go.

I had configured ghost with the URL "https://baty.blog", but I also needed to handle "https://www.baty.blog". To do that I had to temporarily change the URL configuration in Ghost so that Let's Encrypt could do its thing, and then immediately changed it back. Something like this...

$ ghost config url https://www.baty.blog
$ ghost setup nginx ssl
$ ghost config url https://baty.blog

I wanted the www version to redirect everything to the non-www version, so I replaced the "location" block in each of the www nginx configuration files with this...

return 301 https://baty.blog$request_uri;

Restarted nginx and everything worked. I now have 2 Ghost blogs running on a small Digital Ocean droplet.