Lab Setup & Configuration
Topics
Installation
Apache Tomcat depends on Java, so the Java JDK must be installed on your server. Use the following command to install it:
Create a new user named tomcat
with the following command:
Download the Tomcat tar.gz file from the official website.
Download the latest version to the Ubuntu machine and extract the files:
Move the extracted folder to the /opt/tomcat
directory, assign ownership to the tomcat
user, and set execution permissions for the binary files:
Create a tomcat.service
file in the /etc/systemd/system/
directory with the following content:
Reload the systemd daemon to apply the changes:
Enable the Tomcat service to start automatically on reboot:
Check the Tomcat server status:
Configuration
Once installation is complete, configure the Tomcat server.
To set an admin user password, modify the tomcat-users.xml
file:
If neovim
is not installed, install it using:
Add the following lines before the closing </tomcat-users>
tag:
To enable remote access for the Tomcat Manager, edit the context.xml
file in both the manager
and host-manager
directories:
Remove the following line from both files:
Restart the Tomcat service:
Verify that the Tomcat server is running on port 8080
.
Last updated