Installation Instructions installation environment: CentOS-7.0.1406 installation method: Source code installation software: apache-tomcat-7.0.29.tar.gz: License
Installation Instructions
Installation environment: CentOS-7.0.1406
Installation method: Source code installation
Software: apache-tomcat-7.0.29.tar.gz
: Http://tomcat.apache.org/download-70.cgi
Prerequisites
The system must have JDK6 + installed, see install and configure the CentOS-6.3 in the JDK-7.
Install tomcat
Upload the apache-tomcat-7.0.29.tar.gz file to/usr/local and perform the following operations:
The code is as follows:
[Plain]View plaincopyprint?
- [Root @ admin local] # cd/usr/local
- [Root @ admin local] # wget http://apache.fayea.com/apache-mirror/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz
- [Root @ admin local] # tar-zxv-f apache-tomcat-7.0.29.tar.gz // Unzip the package
- [Root @ admin local] # rm-rf apache-tomcat-7.0.29.tar.gz // delete compressed package
- [Root @ admin local] # mv apache-tomcat-7.0.29 tomcat
Start Tomcat
Perform the following operations:
The code is as follows:
[Plain]View plaincopyprint?
- [Root @ admin ~] #/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.7.0/jre
- Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/tomcat-juli.jar
The above information indicates that the instance has been started successfully.
Open Firewall port 8080
Add port 8080 to the firewall configuration and perform the following operations:
[Plain]View plaincopyprint?
- [Root @ admin ~] # Vi +/etc/sysconfig/iptables
# Add the following code
[Plain]View plaincopyprint?
- -A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 8080-j ACCEPT
Restart firewall
[Plain]View plaincopyprint?
- [Root @ admin java] # service iptables restart
Verify Tomcat installation and running
Check whether tomcat is running properly at the following address:
Http: // 192.168.15.231: 8080/
The tomcat System interface is displayed, indicating that the installation is successful!
Stop Tomcat
[Plain]View plaincopyprint?
- [Root @ admin ~] #/Usr/local/tomcat/bin/shutdown. sh // stop tomcat