Wednesday, August 24, 2011

Deploy a Java/Spring based Web App on Cloud in few easy steps

If you haven't tried this then you should. Everyone is going to cloud these days :) You will find several options for this such as Amazon's cloud etc but I choose VMware's Cloud Foundry because its free for now and is easy to integrate with STS (SpringSource Tool Suite) or Eclipse, so why not try it on. In this example I am using STS. For advance info check out http://blog.cloudfoundry.com/

Here are the steps to get started:

  1. Signup yourself at cloud foundry signup (This step takes about three weeks to complete) Once you are registered then you will have a userid/passwd to logon into your a/c.
  2. If you don't have STS then download here.
  3. Integrate STS with Cloud Foundry Extension by opening up STS-->Help-->Dashboard and then going to Extensions tab. Search for Cloud Foundry and install it.
  4. Add a New Server in STS and select VMware--> Cloud Foundry
  5. Now supply your login credentials here which you received from step 1 and validate account.
  6. Almost done! This is how your server will look like. Now just add any web project to it and enjoy the   benefits of cloud.
  7. After adding the project to "VMware Cloud Foundry" you can connect and start the app. Check out the url http://amitonjava.cloudfoundry.com/ Download the source here AmitOnJava.zip by clicking "File-> Download Original" (Note: you have to rename the project from AmitOnJava to something else because by deploying to cloud amitonjava.cloudfoundry.com is already taken) 

    Off-course this is a very dumb app as it is just printing a text message but the whole point is we can now deploy and share the app with the world really fast. Check out some of the professionally done apps http://vaadin.cloudfoundry.com/http://infinigram.cloudfoundry.com etc. or you can also download various sample applications @ https://github.com/SpringSource/cloudfoundry-samples.git

The next thing I want to do now is develop a REST based API and deploy it in cloudfoundry for reference.

No comments:

Post a Comment