CentOS7 install and configure Tomcat-8
Installation instructions
Installation environment: CentOS-7
Installation Method: source code Installation
Software: apache-tomcat-8.0.14.tar.gz
: Http://tomcat.apache.org/download-80.cgi
Prerequisites
You must have installed and configured JDK 6 +. For installation instructions, see install and configure JDK 8 in CentOS 7.
Install tomcat
Upload the apache-tomcat-8.0.14.tar.gz file to/usr/local and perform the following operations:
[Java] view plaincopy
- [Root @ localhost ~] # Cd/usr/local
- [Root @ localhost ~] Unzip tar-zxv-fapache-tomcat-8.0.14.tar.gz // decompress the compressed package
- [Root @ localhost ~] #Rm-rfapache-tomcat-8.0.14.tar.gz // Delete the compressed package
- [Root @ localhost ~] #Mvapache-tomcat-8.0.14.tar.gz
Start TOMCAT
Perform the following operations:
[Java] view plaincopy
- [Root @ localhost ~] #/Soft/tomcat02/bin/startup. sh
If the following information is displayed, the operation is successful.
Using CATALINA_BASE:/soft/tomcat02
Using CATALINA_HOME:/soft/tomcat02
Using CATALINA_TMPDIR:/soft/tomcat02/temp
Using JRE_HOME :/
Using CLASSPATH:/soft/tomcat02/bin/bootstrap. jar:/soft/tomcat02/bin/tomcat-juli.jar
Tomcat started. open port 8080 in the firewall and add port 8080 to the firewall configuration. perform the following operations: [java] view plaincopy
- [Root @ localhost ~] # Vi +/etc/sysconfig/iptables </span>
# Add the following code
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 8080-j ACCEPT
Restart Firewall
[Java] view plaincopy
- [Root @ localhost ~] # Serviceiptablesrestart </span>
Verify Tomcat installation and running
Check whether tomcat is running properly at the following address:
Http: // 127.0.0.1: 8080/
The tomcat System Interface is displayed, indicating that the installation is successful!
Stop Tomcat
[Java] view plaincopy
- [Root @ localhost ~] #/Usr/local/tomcat/bin/shutdown. sh // stop tomcat </span>