View the number of Linux system bits
Getconf Long_bit
Java jdk:http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.rpm
Tomcat 9.0:http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.10/bin/apache-tomcat-9.0.10.tar.gz
Upload the above 2 files to the/home/admin directory
Cd/home/admin
RPM-IVH jdk-8u181-linux-x64.rpm Installing Java JDK
Tar zxvf apache-tomcat-9.0.10.tar.gz Unzip Tomcat
Configuring the JDK System environment variables
cd/etc/
VI Profile
Add the following at the end of this file
# java Path
Export JAVA_HOME=/USR/JAVA/JDK1.8.0_181-AMD64
Export Classpath=.:${java_home}/lib
Export Path=${java_home}/bin: $PATH
Can be set to modify Tomcat port
Cd/home/lifu/apache-tomcat-9.0.10/conf
VI Server.xml
Modify 8080 for the port number you need
Start Tomcat
Cd/home/lifu/apache-tomcat-9.0.10/bin
./startup.sh
See if Tomcat starts properly
Cd/home/lifu/apache-tomcat-9.0.10/logs
Cat Catalina.out
If it does not start properly, the port number may be used, and you can use the following method to query
lsof-i:8080 See which process is taking up
COMMAND PID USER FD TYPE DEVICE size/off NODE NAME
Java 8446 root 49u IPv4 8294048 0t0 TCP *:webcache (LISTEN)
PS Axu|grep 8446 View details of the corresponding PID process
Close Tomcat
Cd/home/lifu/apache-tomcat-9.0.10/bin
./shutdown.sh
Add the specified port to the firewall
Iptables-i input-p Protocol--dport port number-j ACCEPT
For example:
1 iptables-i input-p UDP--dport 161-j ACCEPT2 iptables-i input-p tcp--dport 8080-j ACCEPT
Linux (64) under Tomcat + Java environment setup