|By Michael Meiner||
|November 23, 2014 10:00 AM EST||
Moving From On-Premise to Infrastructure As a Service
Let’s say we developed an application and plan to move our app to production on Amazon Elastic Cloud (EC2). Our application, in the form of a webapp, was developed using eclipse and we have tested it on Tomcat running locally. Now, we may want to test our app on an EC2 environment before moving to production.
First, we need to obtain an EC2 cloud instance. To keep costs down, I selected the free offering which offers a 1GB Linux instance. This is sufficient to run a basic tomcat installation. I found this article to help me get Tomcat release 7 running on my EC2 instance: http://alextheedom.wordpress.com/cloud/amazon-free-usage-tier-installing-tomcat-7-on-an-ec2-linux-instance/. Note that it is important to modify the tomcat-users.xml file and add the following:<tomcat-users>
<user username="admin" password="" roles="manager-script"/>
This will enable the eclipse and the associated maven plugin to gain access to the Tomcat manager using scripts, with the default username and no password (if you want to use a password, there are additional settings required inside eclipse as described in the article below).
Then from my browser, I went to http://188.8.131.52:8080/ and I can see the Tomcat intro page.
Then, I configured the eclipse on my Windows laptop. I used:Eclipse Java EE IDE for Web Developers.
Version: Luna Service Release 1 (4.4.1)
I found this article http://stackoverflow.com/questions/17254839/eclipse-on-click-deploy-to-remote-tomcat that explains how to configure maven within eclipse to deploy a webapp to a remote tomcat (in my case, it’s the Tomcat on my EC2 instance.)
Now I can deploy my webapp as follows:
Right-click on the project name in the Project Explorer panel, select Configure->Convert to Maven Project
After the project is converted, bring up the newly created pom.xml and add the following plugin section (note: you will need to change the URL to your own).<plugin>
Then Click Run->Run Configurations...
For Goals, enter: tomcat7:redeploy
...and you are done!
You can access your webapp by going to your browser and typing in the URL for the Tomcat manager (http://<IP address>:8080/manager). From there, you can select your application.
Now, your webapp is running on Tomcat in the Amazon Elastic Cloud!
- Cloud Expo 2011 East To Attract 10,000 Delegates and 200 Exhibitors
- Cloud Expo New York to Attract More Than 8,000 Delegates
- New Release of Quest Toad for Oracle Offers Enhancements to Reduce Risk
- Twelve New Programming Languages: Is Cloud Responsible?
- The Future of Cloud Computing: Industry Predictions for 2012
- Universal Middleware: What's Happening With OSGi and Why You Should Care
- Oracle To Keynote Cloud Computing Expo
- Oracle-Sun: Jonathan Schwartz Writes His Toughest Ever Email
- An Exclusive Interview with Oracle, Cloud Expo 2010 Diamond Sponsor
- Why SOA Is a Good Fit for CRM Solutions