Tuesday, 27 November 2012

OpenShift - Free Cloud Hosting for Startups

OpenShift provides a cloud hosting platform. Best thing about it is that its free to get started wherein they provide you THREE small gears. Each small gear is like a container with 512 MB RAM and 1 GB disk space. An application can use a single gear or multiple gears. And you can deploy multiple WAR files in your application.

How to use:

1. Create Account

Sign up for OpenShift here.

2. Install Client Tools

Install OpenShift pre-requisite client tools depending on your OS.
Example: for Windows OS install Ruby and GIT.

Click here to see complete details of client tools and installation links.

3. Environment Setup

In your command prompt execute

Just follow the instructions and the wizard will complete all your configuration settings. You will have to specify a namespace that will be part of your domain.

Example: If your namespace is MY_NAMESPACE and application name is MY_APPLICATION then your Application URL will be of the form "http://MY_APPLICATION-MY_NAMESPACE.rhcloud.com/"

We will create an application and generate its URL in the next step.

4. Create an application

In your command prompt execute

This will create an Application named "YourAppName" and will use Jboss Application Server 7.0 as your server. You may specify other application servers, for Example: nodejs-0.6, zend-5.6, ruby-1.9, jbossas-7, python-2.6, jenkins-1.4, ruby-1.8, jbosseap-6.0, diy-0.1,jbossews-1.0, php-5.3, perl-5.10.

After you application is created the URL for this application will be printed on the screen. Note this URL!

5. Deploy your WAR file

Copy your war file to the "deployments" folder inside your application root on your client system.
Example: C:\Users\USER_NAME\YOUR_APP_NAME\deployments

Now, navigate to your application folder in command prompt.
and execute -

and you are online !

6. Access your application

Hit the application URL you noted down followed with the WAR file name -
Your war specific welcome page will be displayed.

If the name of your war is "ROOT.war", you can access your war file directly at "http://MY_APPLICATION-MY_NAMESPACE.rhcloud.com/"

Dats It!
Let me know if you face any issues.

No comments:

Post a Comment