1.下载 安装包
wget http://mirrors.aliyun.com/apache/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.tar.gz
2.解压安装包
tar -zvxf apache-tomcat-8.5.31.tar.gz mv apache-tomcat-8.5.31 tomcat8
3.运行tomcat8.5.31
进入tomcat8.5.31的根目录
cd /usr/local/tomcat8/bin vi catalina.sh 在开头增加以下在内容:
export JAVA_HOME=/usr/local/jdk1.8.0_171
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export TOMCAT_HOME=/usr/local/tomcat8
export CATALINA_HOME=/usr/local/tomcat8
export PATH=$PATH:$JAVA_HOME/bin
然我们启动服务
./startup.sh