Linux installation and configuration of Tomcat 9

9008393bc9c9bb82b468b76242793b19.png

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

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBATm9ydGhlcm4gICBDcmVzY2VudA==,size_20,color_FFFFFF,t_70,g_se,x_16

3. Installation

sudo apt install tomcat9 tomcat9-admin

4. View port status

ss -ltn

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBATm9ydGhlcm4gICBDcmVzY2VudA==,size_20,color_FFFFFF,t_70,g_se,x_16

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

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBATm9ydGhlcm4gICBDcmVzY2VudA==,size_20,color_FFFFFF,t_70,g_se,x_16

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

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBATm9ydGhlcm4gICBDcmVzY2VudA==,size_20,color_FFFFFF,t_70,g_se,x_16

 7. Test server

access

http://localhost:8080/

If you see this page, Tomcat is working normally 

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBATm9ydGhlcm4gICBDcmVzY2VudA==,size_20,color_FFFFFF,t_70,g_se,x_16

 

8. Tomcat management module configuration

Web server topic: tomcat (3) tomcat-users.xml configuration file - sugar mixed tomatoes - Blog Garden (cnblogs.com)

 

Guess you like

Origin blog.csdn.net/m0_52559040/article/details/123785369