Over a million developers have joined DZone.

More on Running WordPress on OpenShift

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

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.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.


Published at DZone with permission of Alen Komljen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}