1. 下载apache-tomcat-8.5.41.tar.gz
2. 创建目录:
sudo mkdir /usr/lib/Tomcat
3.上传apache-tomcat-8.5.41.tar.gz到/usr/lib/Tomcat
4. 进入/usr/lib/Tomcat文件夹,并解压tomcat:
sudo tar -zxvf jdk-7u60-linux-x64.gz -C /usr/lib/Tomcat
5. 进入Tomcat的bin目录,修改配置文件:
sudo vi startup.sh
sudo vi shutdown.sh
在倒数第二行,增加以下内容:
JAVA_HOME=/usr/lib/jdk1.8.0_191
JRE_HOME=${JAVA_HOME}/jre
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
TOMCAT_HOME=/usr/lib/jvm/apache-tomcat-8.5.41
6. 启动Tomcat
sudo /usr/lib/jvm/apache-tomcat-8.5.41/bin/startup.sh
7. 关闭Tomcat
sudo /usr/lib/jvm/apache-tomcat-8.5.41/bin/shutdown.sh