CentOS7.0 install and configure Tomcat-7
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 @ adminlocal] # cd/usr/local
- [Root @ adminlocal] # wgethttp: // logs
- Unzip root@adminlocal##tar-zxv-fapache-tomcat-7.0.29.tar.gz // decompress the compressed package
- Export root@adminlocal1_1_rm-rfapache-tomcat-7.0.29.tar.gz // Delete the compressed package
- [Root @ adminlocal] # mvapache-tomcat-7.0.29tomcat
Start Tomcat
Perform the following operations:
The Code is as follows:
[Plain] view plaincopyprint?
- [Root @ admin ~] #/Usr/local/tomcat/bin/startup. sh // start tomcat
- UsingCATALINA_BASE:/usr/local/tomcat
- UsingCATALINA_HOME:/usr/local/tomcat
- UsingCATALINA_TMPDIR:/usr/local/tomcat/temp
- UsingJRE_HOME:/usr/java/jdk1.7.0/jre
- UsingCLASSPATH:/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?
- -ARH-Firewall-1-INPUT-mstate -- stateNEW-mtcp-ptcp -- dport8080-jACCEPT
Restart Firewall
[Plain] view plaincopyprint?
- [Root @ adminjava] # serviceiptablesrestart
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