How to Run WordPress on Redhat Openshift for Beginners

A few weeks back my buddy called me all excited to tell me about Openshift, the new free Cloud service recently released by Redhat. The first idea that came to mind was to use it to host WordPress,  and of course, so I immediately jumped on it,  signed up for a free account and started playing with it, by the way, thanks Redhat and team!.

As a designer, I immediately struggled doing everything through the terminal. I soon got frustrated and quickly decided to find a way of doing all this via GUI. After 48 hours I managed to compile a list of instructions for those like me that are NOT good with terminals or command lines. Although I manage to do most of it through GUI there are a few steps that are unfortunately require to do via terminal (sorry for the bad news).

So without further interruption here are the steps you came for and if you find this useful, please leave a positive comments, thank you!

1. register a domain with godaddy (or whomever you wish to do it with)

 

2. register for a free account with redhat

a. go to openshift.redhat.com
b. create a app server by clicking on My Applications
c. select PHP 5.3
d. Create MySQL instance by clicking on My Applications > yourAppName > Details
and select “Add cartridge”, then select MySQL
e. Install PHPMyAdmin the same way as step d
f.

3. Display hidden files on Mac
a. type on the terminal:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

NOTE: to hide files again once we are done simply retype command above but set it to FALSE

3. Connect via Shell
a. connect to your domain and create a domain to generate a SSH key
b.

3. Install git on Mac
a. go to http://code.google.com/p/git-osx-installer/ and install the latest version of Git
b.

4. install smartGit for Mac
a. Download smartGit by going to: http://www.syntevo.com/smartgit/index.html

5. Point to your registered name
a. now that you have a redhat domain name you need to create a Alias to point to your godaddy registered name. Unfortunately you can’t do this through OpenShift via HTTP (web), you will have to do this via terminal, to do this simple type on the terminal:

using Finder, navigate to user/.ssh/ and open id_rsa.pub, open with textEdit and copy the key.
Paste it online under username > public key

go to myApplication > myappname and copy the SSH key
NOTE: the key part is creating and storing the key to a new directory or folder
for example:
1. create the key
a. ssh-keygen -t rsa
2. initialize ssh agent
a. eval ‘ssh-agent’
3. load new key from new directory
a. ssh-add ~/bla where bla is the key file at the root of /user/
4. Verify changes
a. rhc domain status

Useful commands:

rhc-user-info
rhc domain create -n mydomain -l rhlogin
rhc domain status

New steps:
create a SSH key on your local machine by typing:

ssh-keygen -t rsa

reuse a public key:
rhc domain alter -n uiguerilla -l rhloginname(usually email address)
ssh-add ~/.ssh/libra_id_rsa

Check if you have a SSH key install:
rhc-domain-info -i

ssh://publickey@appname-namespace.rhcloud.com/~/git/appname.git/

creating a alias:
rhc-ctl-app -a AppName -c add-alias –alias www.domainName.com

connect to server via terminal:
ssh publickey@appname-namespace.rhcloud.com

rhc domain alter -n appname -l rhloginname(usually email address)

check your logs command:
rhc app tail -a {appName}

Resourceful links:

Watch a video for how to create the alias:
Creating a VHOST on OpenShift Express

http://www.youtube.com/watch?v=PtSf0TnCrC8&noredirect=1

http://docs.redhat.com/docs/en-US/OpenShift/2.0/html/User_Guide/sect-User_Guide-Managing_SSH_Keys.html

http://docs.redhat.com/docs/en-US/OpenShift/2.0/html/User_Guide/sect-User_Guide-Managing_SSH_Keys-Generating_New_SSH_Keys.html

https://openshift.redhat.com/community/blogs/managing-multiple-ssh-keys-on-openshift

Finally, I will like to thank David Salter and its blog to help me get over the hurdle:

http://www.davidsalter.com/tag/openshift