
By Michael Meiner | Article Rating: |
|
November 23, 2014 10:00 AM EST | Reads: |
5,603 |
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>...
<role rolename="manager-script"/>
<user username="admin" password="" roles="manager-script"/>
</tomcat-users>
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://54.148.187.110: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><groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://54.148.187.110:8080/manager/text</url>
</configuration>
</plugin>
Then Click Run->Run Configurations...
For Goals, enter: tomcat7:redeploy
Click Run
...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!
Published November 23, 2014 Reads 5,603
Copyright © 2014 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Michael Meiner
Michael Meiner is an Engineering Director at Oracle Corporation. His organization is responsible for lifecycle Quality Assurance of the Fusion Middleware Suite of products, including: installation, configuration, upgrade, test-to-production and interoperability on a range of computing platforms and Operating Systems. The Fusion Middleware product suite supports both On-Premise as well as Cloud offerings.
![]() Apr. 21, 2018 01:30 AM EDT Reads: 6,297 |
By Liz McMillan Apr. 21, 2018 12:00 AM EDT Reads: 2,502 |
By Liz McMillan ![]() Apr. 20, 2018 11:30 PM EDT Reads: 13,142 |
By Yeshim Deniz Apr. 20, 2018 11:15 PM EDT Reads: 2,333 |
By Elizabeth White ![]() Apr. 20, 2018 11:00 PM EDT Reads: 3,521 |
By Liz McMillan ![]() Apr. 20, 2018 10:30 PM EDT Reads: 22,416 |
By Elizabeth White ![]() Apr. 20, 2018 10:15 PM EDT Reads: 6,197 |
By Elizabeth White ![]() Apr. 20, 2018 09:15 PM EDT Reads: 3,554 |
By Elizabeth White ![]() Apr. 20, 2018 08:45 PM EDT Reads: 1,047 |
By Yeshim Deniz Apr. 20, 2018 08:00 PM EDT Reads: 642 |
By Yeshim Deniz ![]() Apr. 20, 2018 07:30 PM EDT Reads: 1,918 |
By Yeshim Deniz Apr. 20, 2018 07:00 PM EDT Reads: 2,810 |
By Liz McMillan ![]() Apr. 20, 2018 05:15 PM EDT Reads: 13,422 |
By Elizabeth White ![]() Apr. 20, 2018 03:15 PM EDT Reads: 12,943 |
By Liz McMillan ![]() Apr. 20, 2018 02:45 PM EDT Reads: 16,953 |
By Pat Romanski ![]() Apr. 20, 2018 02:30 PM EDT Reads: 6,594 |
By Pat Romanski Apr. 20, 2018 02:00 PM EDT Reads: 1,222 |
By Liz McMillan Apr. 20, 2018 01:30 PM EDT Reads: 1,625 |
By Pat Romanski ![]() Apr. 20, 2018 01:00 PM EDT Reads: 5,278 |
By Pat Romanski Apr. 20, 2018 12:45 PM EDT Reads: 2,185 |