Drek.ca

Setting Up Ghost on OpenShift using Windows

May 15, 2014

OpenShiftLogo

Using Windows 7, assumed to work for Windows 8 and Vista.
Run all code from the command line (cmd).”
Insert your own values for **CAPITALS**.


###Initial Setup###
  • Sign up with OpenShift.com.
  • Install Ruby. Check “Add Ruby executables to your PATH.”
  • Install Git for Windows. Check “Use Git from the Windows Command Prompt.”
  • Verify Ruby and Git have installed properly. Any non-error output is fine.

    ruby -e 'puts "Welcome to Ruby"'
    git --version
    
  • Install RHC using RubyGem.

    gem install rhc
    
  • Setup RHC. Enter your OpenShift credentials and accept the defaults.

    rhc setup
    
  • Set some git defaults.

    git config --global user.email "**EMAIL@ADDRESS.com**"
    git config --global user.name "**YOUR_NAME**"
    git config --global push.default simple
    
  • Remember to update RHC from time to time

    gem update rhc
    
  • Create the Ghost application. Pick a meaningful name.

    rhc app create **APP_NAME** nodejs-0.10 --env NODE_ENV=production --from-code https://github.com/openshift-quickstart/openshift-ghost-quickstart.git
    

###Troubleshooting the Setup###
  • The first time this is done the authenticity of your site likely can’t be established, so just type ‘yes’ when prompted. If setup get stuck after this, press Ctrl+C and clone the git repository manually.

    rhc git-clone **APP_NAME**
  • If you don’t make it that far or want to start fresh, delete the application and free up that app name.
rhc app-delete **APP_NAME** --confirm

###Working with Git and RHC###
  • Navigate into the new directory. Edit the files there manually.
cd **APP_NAME**
  • To see info about your app type the following.

    rhc show-app **APP_NAME**
    
  • Update and push out changes like this.

    git add --all .
    git commit -m 'My changes'
    git push
    
  • Then restart the app to put those changes into effect.

    rhc app restart
    
  • Don’t forget to take regular snapshots!

    rhc save-snapshot
    

###Themes###
###Configuring Ghost###
  • [OPTIONAL] Provide a Gmail account for sending password resets. _ Edit config.js, but be warned this is not secure! _ After this is done update git and restart the app.

            url: 'http://**YOUR_SITE_ADDRESS**,
          mail: {
                  transport: 'SMTP',
                  options: {
                          service: 'Gmail',
                          auth: {
                                  user: '**GMAIL@GMAIL.COM',
                                  pass: '**PASSWORD**'
                          }
                  }
          },
    

###Custom Domain Setup###

Configuring GhostWall Theme

For details on this this site is configured, please see the link below. Be warned that the theme used costs around $24 US.

http://www.derekroberts.ca/build/


That’s it!


Many thanks to Andrew Hobden (aka. Hoverbear) for providing just enough taunting/direction to help.


Written by Derek Roberts.

Agile DevOps, OpenShift, Music and More.