Tuesday, May 10, 2011

Working with Red Hat OpenShift from Ubuntu

Today I learned about Red Hat OpenShift platform, its free cloud service that enable developers to deploy applications written in multiple frameworks and languages across clouds. Please find more information from here.

But it looks like Official tools from Red Hat are supported on Red Hat Enterprise Linux / Fedora only. But we can also install same tools on Ubuntu as well.

I followed following steps.

Install git-code,ruby and openssh.
sudo apt-get install git-core openssh-client ruby-full 
sudo apt-get install rubygems1.8

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

Now we have tools ready, we need to create domain name.
/var/lib/gems/1.8/bin/rhc-create-domain -n DOMAIN_NAME -l EMAIL_ID

We have created domain, Now we can create application by following.
/var/lib/gems/1.8/bin/rhc-create-app -a TEST_APP_NAME -t php-5.3.2

Now we can publish web application by following.
cd TEST_APP_NAME/

nano php/index.php 

git commit -a -m "first time change"

git push

So we successfully published our application, we can verify it by typing following URL.
http://TEST_APP_NAME-DOMAIN_NAME.rhcloud.com/

Here is my test application.

No comments:

Post a Comment