To install OpenShift RHC Client Tools on Windows, we have to install three items – RubyInstaller, Git and OpenShift RHC.
RubyInstaller is a self-contained Windows-based installer that includes the Ruby language and execution environment. Download the stable release from RubyInstaller Org and install. During the installation accept all of the defaults, but it is mandatory to select the Add Ruby executables to your PATH check box in order to run Ruby from the command line.
C:> ruby -e 'puts "Welcome to Ruby"' Welcome to Ruby
Git is a software configuration management (SCM) that keeps track of changes to software source code. With Git, we can manage the OpenShift application source repository. Download latest release from Git Hub and install with all defaults. Open command prompt and verify Git installation.
C:> git --version git version 1.9.2
To install OpenShift RHC Client Tools, open command prompt and run the following command.
C:> gem install rhc
On Fedora Linux, we have to install rubygem-rhc, which installs Ruby, GIT and other dependencies required to run OpenShift RHC client tools.
$ sudo yum install rubygem-rhc
- Prompts for the OpenShift account User ID and password. For User ID, we have to enter the e-mail ID we used to create the OpenShift account.
- RHC creates and stores a token on disk, which allows us to carry out application management and access the OpenShift Shell without using a password. Authentication tokens last for a month and after the expiry of tokens, we are forced to re-authenticate again with the e-mail id and password to generate fresh tokens.
- Checks whether there are any SSH Public-Private key pairs in the
.sshfolder. If a key pair exists, then rhc uploads the public key to the OpenShift server else rhc creates a new pair and uploads the newly created public key. SSH keys are used encrypt the traffic between PC and OpenShift server.
C:> rhc setup
C:> rhc apps
$ rhc ssh <app name>
C:> rhc ssh --ssh <path_to_ssh_executable> <app name>
- OpenShift Account: we use an e-mail ID to create an OpenShift account, and we use it to login to OpenShift server.
- We use the e-mail id to log in to OpenShift Web Console.
- RHC uses our e-mail id and tokens (created during RHC setup) when we log in to OpenShift Shell.
- Application Public URL: when we create an application, OpenShift allots a public URL to like http://quickstart-wordpressguide.rhcloud.com, and we use this to access the application.
- Application User ID: For each application, OpenShift creates a virtual Linux server, and we need a User ID to access this virtual server. UUID, a 24 chars hex decimal string, is a unique ID allotted to our virtual server, which is also the User ID. When we see a long hex string, we know that its is our unique user id in OpenShift cloud.
a word about Prompts
wordpress tutorial sample zip, which is available at CodeTab Downloads.
> cd app-root/data
> wget http://www.codetab.org/wp-content/uploads/wordpress-tutorial-sample.zip
> unzip wordpress-tutorial-sample.zip
- htmlimport folder contains sample HTML files with distinct stylesheets and images, which we use to describe WordPress static page import.
- backup folder contains WordPress Backup and Dropbox setup scripts.