[root@ly-01 ~]# tar -zxf apache-tomcat-9.0.31.tar.gz
3. 重命名tomcat
mv apache-tomcat-9.0.31 order-tomcat
4. 配置tomcat环境变量
#java environment
export JAVA_HOME=/app/jdk1.8.0_202
#MYSQL HOME
export MYSQL_HOME=/app/mysql-5.7.25
#TOMCAT HOME
export TOMCAT_HOME=/root/order-tomcat
export M2_HOME=/app/apache-maven-3.6.3
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin:$M2_HOME/bin:${MYSQL_HOME}/bin:${TOMCAT_HOME}/bin
5. 刷新配置文件
[root@ly-01 ~]# source /etc/profile
6. 启动tomcat
[root@ly-01 ~]# startup.sh
Using CATALINA_BASE: /root/order-tomcat
Using CATALINA_HOME: /root/order-tomcat
Using CATALINA_TMPDIR: /root/order-tomcat/temp
Using JRE_HOME: /app/jdk1.8.0_202
Using CLASSPATH: /root/order-tomcat/bin/bootstrap.jar:/root/order-tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@ly-01 ~]# tail -f order-tomcat/logs/catalina.out