Installation configuration Tomcat
1: Download the latest installation package at http://tomcat.apache.org/download-80.cgi
2: Install Tomcat
Upload the apache-tomcat-8.0.21.tar.gz file to the/usr/local to do the following: (this path is variable)
Copy Code
The code is as follows:
[Email protected] local]# cd/usr/local
[[email protected] local]# TAR-ZXVF apache-tomcat-8.0.21.tar.gz//Decompression Pack
[[email protected] local]# RM-RF apache-tomcat-8.0.21.tar.gz//Delete compressed package
[[Email protected] local]# MV apache-tomcat-8.0.21 Tomcat//renamed Tomcat
And then
Service iptables Stop shutting down the firewall
3: Start Tomcat to perform the following actions
Copy Code
The code is as follows:
[[email protected] ~]#/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 message has been successfully 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 are needed to run this program
Be aware that the prerequisites also set the Java path
Add content to apache-tomcat-8.0.9/bin/setclasspath.sh
Export javahome=/opt/jdk1.8.0
Export JREHOME=/OPT/JDK1.8.0/JRE
Export classpath=.: $JAVAHOME/lib: $JREHOME/lib: $CLASSPATH
Export path= $JAVAHOME/bin: $JREHOME/bin: $PATH
Firewall Open 8080 Port
Add 8080 ports to the firewall configuration and do the following:
[Email protected] ~]# VI +/etc/sysconfig/iptables
#增加以下代码
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 8080-jaccept
Restarting the firewall
[Email protected] java]# service iptables restart
Check Tomcat installation Run
See if Tomcat is working properly with the following address:
http://192.168.15.231:8080/
See the Tomcat system interface to show that the installation was successful!
Stop Tomcat
[[email protected] ~]#/usr/local/tomcat/bin/shutdown.sh//Stop Tomcat
Automatically start the Tomcat service
Vim/etc/rc.local
You can then add the following content to the text to
Service Iptables Stop
export JAVA_HOME=/usr/java/jdk1.8.0_25
/data/soft/tomcat/cap-api/bin/startup.sh
/data/soft/tomcat/cap-crm/bin/startup.sh
/data/soft/tomcat/cap-update/bin/startup.sh
Linux test Environment Deployment Tomcat (II)