Quality Assurance Oracle Fusion Middleware Suite

Michael Meiner

Subscribe to Michael Meiner: eMailAlertsEmail Alerts
Get Michael Meiner: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: Cloud Computing, Oracle Journal, Apache Web Server Journal, Eclipse Platform, Infrastructure 2.0 Journal

Blog Post

From On-Premise to Infrastructure As a Service By @Oracle | @CloudExpo [#Cloud]

Using Eclipse and Tomcat, you can easily deploy your webapps to the cloud

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!

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.