tomcat's official website
Enter the official website to find download right click and select the second copy connection
Download the installation package
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.29/bin/apache-tomcat-9.0.29.tar.gz
tomcat need java environment download jdk
yum -y install java-1.8*
Decompression
zxvf apache-tomcat tar 9.0 . 29 .tar.gz
Start tomcat
./apache-tomcat-9.0.29/bin/startup.sh
Check local 8080 port is open
netstat -tnlp |grep 8080
Turn off the firewall
systemctl stop firewalld
Sign in local ip of 8080 to see if the operation is successful, there is a page to indicate success
Some security policy
Tomcat root directory of websites in webapps / ROOT /
In the configuration file conf / server.xml
1, remove the default webapps directory under the file
rm -rf /webapps/*
2. Close war package management
Without the need of close management of the war package to prevent the upload Trojan horses or other malicious programs
In /conf/server.xml, modify the true to false
3, prohibit catalog documents listed in conf / web.xml, modified to be true false, high version off by default
4、不需要web部署的时候,把conf/tomcat-users.xml内容注释掉
5、端口保护
修改8080默认访问端口
注释掉AJP端口