Install Tomcat 8 in CentOS
Install Tomcat 8
Go to renewal.
Put the apache-tomcat-8.0.26.tar.gz file in the/usr/local directory and execute the following script:
#cd/usr/local
Unzip tar-zxvfapache-tomcat-8.0.26.tar.gz // decompress the compressed package
#Rm-rfapache-tomcat-8.0.26.tar.gz.tar.gz // Delete the compressed package
#mvapache-tomcat-8.0.26tomcat
Start Tomcat8
#/Usr/local/tomcat/bin/startup. sh // start tomcat
Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/java/jdk1.8.0 _ 60
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
If the following error occurs:
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
You must set the java path in advance.
Add the following content to apache-tomcat-8.0.26/bin/setclasspath. sh:
exportJAVA_HOME=/usr/java/jdk1.8.0_60
exportJRE_HOME=/usr/java/jdk1.8.0_60/jre
exportCLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
exportPATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
Open firewall port 8080
Add port 8080 to the firewall configuration and perform the following operations:
#vi/etc/sysconfig/iptables
# Add the following code
-ARH-Firewall-1-INPUT-mstate--stateNEW-mtcp-ptcp--dport8080-jACCEPT
Restart Firewall
#serviceiptablesrestart
Verify the installation and running of Tomcat8
Check whether tomcat is running properly at the following address:
Http: // 192.168.11.52: 8080/
The tomcat System Interface is displayed, indicating that the installation is successful!
Stop Tomcat8
#/Usr/local/tomcat/bin/shutdown. sh // stop tomcat