Deploy a Tomcat Application Using the CLI

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Welcome to this hands-on lab, where we’ll deploy an application on Tomcat via the CLI.

We are using Apache’s Tomcat, a Java-based application platform built around deploying and managing Java Web Applications. The server provided in this lab environment is running Red Hat Enterprise 8 and has Tomcat 9 pre-installed for you. The Tomcat instance is available for you on port **8080**.

You will log into the server via the CLI and deploy an application.

You will then deploy a second version of the application. It has different information on its index page that shows the new application has been launched to replace the original.

Both of the applications will be provided in a folder on the Tomcat server for your use.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Test to Ensure You Can Access the Preconfigured Tomcat Instances on Port 8080

Connect to the Tomcat GUI and log in. To access the server, visit the external IP address provided in the hands-on lab page, and append :8080 to it.

For example, if an IP address shown was 3.92.152.3, then you would put the following into your web browser:

http://3.92.152.3:8080

You should see the GUI.

Deploy sample.war Version 1 via the CLI

You must deploy sample.war via the CLI, not the GUI. The file is located in the /files/version1/ directory.

Go to the application via a browser and test the application is working. The app can be found by going to the server’s external IP address with :8080/sample appended to the URL.

For example, if the IP address shown for the lab was 3.92.152.3, then you would put the following into your web browser:

http://3.92.152.3:8080/sample

Deploy sample.war Version 2 via the CLI

You must deploy sample.war via the CLI, not the GUI. The file is located in the /files/version2/ directory.

Go to the application via a browser and test the application is working. The app can be found by going to the server’s external IP address with :8080/sample appended to the URL.

For example, if the IP address shown for the lab was 3.92.152.3, then you would put the following into your web browser:

http://3.92.152.3:8080/sample

The application will have different text than the original application. It shows that it is Version 2.

Additional Resources

You have been tasked with deploying an application on your Tomcat server. Just after you deployed the application though, a new version was given to you, and you need to deploy that one instead.

You know there is no need to stop the Tomcat server, so you are comfortable replacing the old application with the new one, while Tomcat is running.

First deploy the application located under /files/version1/sample.war.

Test to make sure you can see the application on your Tomcat server.

Then deploy the updated application. It's located under /files/version2/sample.war.

Test you can see that the applications front page has changed. You may need to refresh your browser if it has the old site cached.

Complete the hands-on lab by performing the tasks as mentioned in the tasks list. A successful lab will have you able to see the Tomcat application on the server. The new application will be running and the old application will have been undeployed.

Note: It may take 3 to 10 minutes after the hands-on lab has started before you are able to log into the server. This is fine and will not affect the performance of the tasks for the hands-on lab.

Logging In

Use the credentials provided on the hands-on lab page, and log in to the provided server as cloud_user. Note that this is for connecting to the server and also for the Tomcat GUI.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!