- Lab
- A Cloud Guru
Back Up and Restore Tomcat
Welcome to this hands-on lab. Here, 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, available on port **8080**. In this lab you will back up your Tomcat instance. Then you will break it by deleting one of the management GUI applications. Afterward, you will restore the application from the backup you took earlier. The Tomcat instance is located under `/usr/local/tomcat9`, and the files are owned by the `tomcat` user. Your task is to restore the missing files from that backup, and get the Manager GUI application working again.
Path Info
Table of Contents
-
Challenge
Test to Ensure You Can Access the Preconfigured Tomcat Instances on Port 8080
Use the Tomcat server's public IP address and port 8080. Connect to the Tomcat GUI and log in. The username and password to use are the same as what's provided for CLI access.
To access the server, copy the external IP address and test in your browser by using this IP address and appending the :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. This is to test that Tomcat is up and running, and the lab is ready for you to perform the tasks. You will not be able to access the Manager GUI application. This is part of the lab.
Note: It may take from 3 to 10 mins after the Hands-On Lab has started before you can access the Tomcat server on Port 8080.
Logging In
Use the credentials provided on the hands-on lab overview 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. -
Challenge
Back up Your Tomcat Application to a Folder Called /backups
First create the folder
/backups
.Use the
tar
command (or whatever method you are comfortable with) and create a backup of the Tomcat application. You should put your backup in the/backups
folder.Tomcat is located under
/usr/local/tomcat9
. -
Challenge
Delete the Manager Application from /usr/local/tomcat9/webapps
Your Tomcat installation is located under
/usr/local/tomcat9
.Delete the Manager application. It can be found under the
/usr/local/tomcat9/webapps
folder.Test to make sure the Tomcat application is broken by going to your Tomcat server's Manager address (something like http://3.92.152.3:8080/manager) via your web browser.
-
Challenge
Restore the Entire Manager Folder to Your Tomcat Instance's webapps Folder, Then Test to Make Sure It Works
Extract your backup file into the
/backups
folder.Put back the
manager
folder that was deleted earlier from the/usr/local/tomcat9/webapps
folder.Move only that folder from
/backups
back into the Tomcat applicationswebapps
folder.When completed, you should see the following under the
/usr/local/tomcat9/webapps/
folder:docs examples host-manager manager ROOT
Test to make sure you can log into the manager application.
You should be able to see the Manager application when you go to your Tomcat server's Manager address (something like http://3.92.152.3:8080/manager) via your web browser.
Again, the username and password are the same as for your lab username and password.
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.