Platinum Partner
cloud,tutorial,wordpress,infrastructure,openshift

More on Running WordPress on OpenShift

So here is second part of running WordPress on OpenShift article. As I said this post will show you how to install OpenShift CLI, how to create snapshots, aliases and how to add your domain.

OpenShift CLI installation

First I will cover installation of CLI. For Windows you will need to install ruby 1.8.7 first, on Linux you will probably have it, so just skip first two steps:

  • You will need ruby, easiest way to install ruby on Windows is using rubyinstaller for Windows
  • During installation choose “add to path” option
  • After installation is done go to CMD/Shell and type “gem install rhc”
  • When rhc gem is installed run “rhc setup” to finish installation (you will need to provide OpenShift username and password, you can skip adding keys)

After finishing last step you are done. One note regarding CLI is that basically some things like creating snapshots or creating aliases can’t be done through web, so CLI is only option. Actually CLI has any option that is available through web and a lot more. To see full list of options just type “rhc”.

Creating snapshots and adding aliases

Next thing you will need for your application is creating backup or snapshots. Through rhc it’s pretty simple, just run following command:

rhc snapshot save appName

This command sometimes don’t work for some reason, but in that case you will get which command you need to run through ssh.

Login to your application

OpenShift uses a public key to securely encrypt the connection between your local machine and your application and to authorize you to upload code. You must create a private and public key on your local machine and then upload the public key before you can connect to your applications’ Git repositories or remotely access your application. On Windows you can use puttygen to generate keys and on Linux you can use “ssh-keygen -t rsa” command. Then copy content of your public key here.

Adding your domain name

To add your own domain you need a domain of course. Next you need to add aliases to your application:

rhc alias add appName domain.com
rhc alias add appName www.domain.com

After that go to your domain name registrar and add following:

@ - URL redirect - http://www.domain.com
www - CNAME - applicationname–namespace.rhcloud.com

Then on your WordPress application (General settings) add this URL: www.domain.com (using just domain.com will make your app unavailable)

So that is basically it for now, if you have any questions just post a comment and you will get the answer ASAP.

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}