Welcome to WithRecovery.com, a site I want to use for blogging the various SQL related stuff I write as well as a bit of whatever I come across that looks interesting. For the first part of this blog, I thought I'd document how I got this site up and running.

After doing some research, and having a lot of past experience with Wordpress, I decided that Ghost would be a good choice for the kind of lightweight site I wanted. Ghost is built on node.js and aims to be a slimmed down blogging platform, rather than the toolkit CMS that Wordpress has become. Not that I have anything against Wordpress, mind! My friend and I host a podcast on it very successfully.

Thinking about hosting, I considered using a Raspberry Pi to host it locally until I found out about OpenShift from Red Hat. OpenShift is a scalable cloud (PaaS) host with nice pre-created apps you can deploy and, most importantly, you can host 3 of these apps for free.

Not having a lot of cloud experience, I thought this might be a good learning experience. After doing some reading I found this great tutorial by James Hatfield on setting up Ghost on OpenShift and managing the site's DNS settings using CloudFlare. I highly reccomend it if you're thinking about trying out Ghost on any platform.

After getting this blog ready to start posting, I thought I'd try out some themes. Now, I'm used to traditional clustered hosts where you just chuck the theme files in a directory and off you go. It's not that easy with this setup though!

I did some research, and apparently you need to use git to clone your Ghost repository, add the theme, then push the changes back again. To do this I had to set up my Mac to use both git and the OpenShift Client Tools. This took a bit of mucking around, but here's the steps I took to get rhc and git working on my box:

Installing rhc on OS X

  1. Install XCode from the App Store
  2. If you haven't used XCode yet you need to agree to the license, which you can do from terminal using sudo xcodebuild -license and following the prompts
  3. Next, check ruby is working using ruby -e 'puts "Hello, World!"'
  4. Then check git is installed with git --version
  5. Next, you need to get RubyGems working. First run sudo gem update
  6. Now run the following:
sudo gem install rubygems-update
sudo update_rubygems
sudo gem install rhc

You should now have rhc installed and ready to go! Using these tools you can ssh to your OpenShift app, and do other behind the scenes things. But first you have to run rhc setup and supply the credentials it asks for to get connected to your client tools working. This will also generate you a public key and upload it to OpenShift for you. Handy!

Now you have I have a working Ghost deployment and a working set of tools. Welcome to the blog! Tomorrow I'll go into how to change Ghost's theme using git.