Some problems self-hosting ghost, with solutions
This blog is now running Ghost, and so far things are going quite well. Glooging is up in frequency $infinity % over last month!
I ran into some minor deployment issues that initially confused me:
- Image uploads weren't working! This is because I used an upstart script to start ghost, and the current working directory or CWD of upstart scripts is '/'. Ghost assumes that the current working directory is instead the ghost root, so it was merrily uploading everything to /content/... instead of /data/apps/ghost/content/. All I needed to do was make sure the upstart script cd'd to the ghost directory before starting the site up. Here is a link to the now-corrected upstart script.
- Ghost relies on the NODE_ENV variable being set in its environment, and doing this was a little difficult using upstart. You'll notice in the script I set it several times in various ways - that's just me flailing until it works. I need to trouble-shoot a bit more with a dev server to see what the right thing is.
- It took a little hacking around to get a working Nginx proxy configuration that would find images in the right folder, re-map my rss feed, etc. Here's the one I'm using right now.
Fundamentally I'm doing more work and poking around more than I really need to. All you need to do to self-host ghost is sign up for a $5/month Digital Ocean VPS account - they provide a ready-to-go Linux VPS configured to run Ghost right out of the box. ( And yes, that's my referral code on the linked URL :)