Environment: Ubuntu 21.10.
First of all, you must have JDK8 before installing Tomcat
Linux JDK8 apt installation and environment variable JAVA_HOME configuration
If you have JDK, then start directly
1. Update source
sudo apt update
2. Search software packages
sudo apt-cache search tomcat
3. Installation
sudo apt install tomcat9 tomcat9-admin
4. View port status
ss -ltn
3306 MySQL
8080 Tomcat
5. Change self-start
When the Ubuntu operating system restarts, the Tomcat server will start automatically.
we can
disable autostart
sudo systemctl disable tomcat9
or
enable autostart
sudo systemctl enable tomcat9
6. Change firewall rules
Allow connections to Tomcat server port 8080 from any source
sudo ufw allow from any to any port 8080 proto tcp
7. Test server
access
If you see this page, Tomcat is working normally
8. Tomcat management module configuration