1. First check the current system version
uname -a
2. Check whether the system has java installed before installation
rpm -qa | grep java rpm -qa |grep jdk rpm -qa |grep gcj
If nothing happens then java is not installed
3. If there is an installation, uninstall it, so the relevant content
rpm -qa | grep java | xargs rpm -e --nodeps
4. Retrieve all java lists in yum
yum list java*
Usually there will be many results, just choose one to install
5. Here we want to install java8 through yum
yum install java-1.8.0-openjdk* -y
6. If there is no error, the installation is successful, and then check the version
java -version
Generally, the java version you installed will appear. At this time, it means that your java environment is successfully installed, or you already have a java environment, you can skip the previous steps and go directly to this step
7. Now is the installation of tomcat software. First, under the /usr/local file, the installation path is here
cd /usr/local
8. Download the installation package file. I personally tested a mirror here and it can be successful
wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.50/bin/apache-tomcat-7.0.50.tar.gz
9. De-configure the java environment before decompressing the package is needed when decompressing the package because this step will fail if there is no java environment
tar -zxv -f apache-tomcat- 7.0 . 50 .tar.gz // Unzip the compressed package
10. Delete redundant compressed files
rm -rf apache-tomcat- 7.0.50.tar.gz // Delete the compressed package
11. Move the installation software to the tomcat file
mv apache-tomcat-7.0.50 tomcat
12. If successful, you can start Tomcat
cd /usr/local/tomcat/bin
./startup.sh
13. Basically, to this place is that tomcat has been installed successfully. All that's left is the firewall configuration.