sudo tar -zxvf apache-tomcat-8.5.23.tar.gz
複製代碼
mv apache-tomcat-8.5.23 /usr/tomcat/
複製代碼
vim /usr/tomcat/apache-tomcat-8.5.23/bin/startup.sh
複製代碼
在最後一行以前加入以下信息:java
#set java environment
export JAVA_HOME=/usr/java/jdk1.8.0_111
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:%{JAVA_HOME}/lib:%{JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
#tomcat
export TOMCAT_HOME=/usr/tomcat/apache-tomcat-8.5.23
複製代碼
/usr/tomcat/apache-tomcat-8.5.23/bin/startup.sh
複製代碼
以下提示說明tomcat已開啓:apache
Using CATALINA_BASE: /usr/tomcat/apache-tomcat-8.5.23
Using CATALINA_HOME: /usr/tomcat/apache-tomcat-8.5.23
Using CATALINA_TMPDIR: /usr/tomcat/apache-tomcat-8.5.23/temp
Using JRE_HOME: /usr/java/jdk1.8/jre
Using CLASSPATH: /usr/tomcat/apache-tomcat-8.5.23/bin/bootstrap.jar:/usr/tomcat/apache-tomcat-8.5.23/bin/tomcat-juli.jar
Tomcat started.
複製代碼
/usr/tomcat/apache-tomcat-8.5.23/bin/shutdown.sh
複製代碼