1. Check the Linux version:

lsb_release -a
Copy the code

2, download.gz tomcat application and JDK tomcat.apache.org/download-70…

Configure the JDK environment

(1) RPM package

rpm -ivh jdk-7u55-linux-x64.rpm
Copy the code

Gz package: Decompress the package

mkdir /usr/java
cd /usr/java
tar -zxvf /software/jdk-7u55-linux-x64.tar.gz
Copy the code

Generate links for version upgrades

Ln -s jdk1.7.0_55 latest ln -s latest defaultCopy the code

(2) Configure environment variables

 vi /etc/profile
Copy the code
Export JAVA_HOME=/usr/ Java /default export JAVA_BIN=$JAVA_HOME/bin export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATHCopy the code

Make the configuration take effect

source /etc/profile
Copy the code

Test the JDK.

 java -version
Copy the code

If the following information is displayed, the installation is successful

Java version "1.7.0_55" Java(TM) SE Runtime Environment (Build 1.7.0_55-b13) Java HotSpot(TM) 64-bit Server VM (build 24.55 - b03, mixed mode)Copy the code

4. Decompress Tomcat

Mkdir /usr/local/tomcat CD /usr/local/tomcat tar -zxvf /software/apache-tomcat-7.0.54.tar.gz mkdir /usr/local/tomcat CD /usr/local/tomcat tar -zxvf /software/apache-tomcat-7.0.54.tar.gzCopy the code

5, decompress the WAR package and put it into webapps, configure hibrnate file, and set up intermediate library and business library

6. Start Tomcat and test it

CD/usr/local/tomcat/apache tomcat - 7.0.54 / bin/startup. ShCopy the code

Multiple commands (under bin, run and view real-time logs)

./startup.sh ; tail -f .. /logs/catalina.outCopy the code

Viewing logs separately

CD /usr/local/tomcat/apache-tomcat-7.0.54/logs tail -f catalina.outCopy the code

Test the Tomcat.

If the external device cannot be accessed, enable the firewall

/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
service iptables save
service iptables restart
Copy the code

or

firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
Copy the code