OpenShift client tools installation in Debian/Ubuntu

19 Mar 2012
Posted by stylesen

OpenShift is a free cloud-based application platform from RedHat. Of late I caught an interest in Cloud Computing and wanted to try out different stuff. Though I did extensive reading on Eucalyptus, Amazon EC2, Ubuntu Cloud, etc. I wanted to try something hands on and chose to experiment with OpenShift. OpenShift has two flavors such as Express and Flex. Express is a shared application platform which supports Ruby, PHP, and Python applications. On the other hand flex is dedicated platform-as-a-service for Java and PHP applications which creates and provides management capabilities to operate on Amazon EC2 clouds (in future more cloud platforms will be added).

I wanted to start with OpenShift Express by deploying some sample applications. For this purpose I wanted to get OpenShift command line client tools installed in my Debian box. Following are the steps to install OpenShift client tools in a Debian machine (mine is debian 6.0.4 - squeeze), this will also hold good for Ubuntu machines:

Step1 - Install the required packages:

# aptitude install git-core openssh-client ruby ruby-dev rubygems libopenssl-ruby

Step2 - Install ruby gems for OpenShift client tools ie., rhc*:

# gem install --source http://gems.rubyforge.org --source https://openshift.redhat.com/app/repo/ rhc

Ideally after installation of the above the client tools ie., rhc* should be available in the Debian/Ubuntu box, but unfortunately they are not in the default binary search path, which motivated me to write this blog post. They are at a different location, hence lets link these binaries in common locations so that it will be available for all users in the system over the command line, for that, issue the following command:

Step3 - Create links for client tool binaries in default bin search path:

# ln -s /var/lib/gems/1.8/bin/rhc* /usr/bin/

Now we have OpenShift client tools installed in our Debian/Ubuntu box and accessible via command line.

$ rhc --help

Usage: rhc (<resource> | --help) [<command>] [<args>]
Command line tool for performing operations related to your rhcloud account.

List of resources
  domain             Manage the namespace for the registered rhcloud user.
  app                Manage applications within the rhcloud account.
  sshkey             Manage multiple keys for the registered rhcloud user.

See 'rhc <resource> --help' for more applicable commands and argumments on a specific resource.

NOTE: All the above commands except 'rhc --help' are run as root user in a Debian box. If you are on Ubuntu, then don't forget to run the commands as sudo.

This is the first step in my experiment with OpenShift. Watch my blog for more posts regarding OpenShift in future for sometime, till I get to know the platform.