CentOS7部署tomcat10
查看tomcat与jdk版本对应关系
https://tomcat.apache.org/whichversion.html
一、先安装jdk
1.下载jdk
如有旧版本请先卸载openjdk:
[root@localhost ~]# yum erase `rpm -qa | grep openjdk` -y
2.解压安装
[root@localhost ~]# tar -xvf jdk-11.0.16.1_linux-x64_bin.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/
[root@localhost local]# ll jdk-11.0.16.1
3.修改环境变量
[root@localhost ~]# vim /etc/profile #jdk-11.0.16.1 export JAVA_HOME=/usr/local/jdk-11.0.16.1 export PATH=$PATH:$JAVA_HOME/bin [root@localhost ~]# source /etc/profile
4.查看java版本
[root@localhost ~]# java -version java version "11.0.16.1" 2022-08-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.16.1+1-LTS-1) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.16.1+1-LTS-1, mixed mode)
二、安装tomcat10
1.官网下载二进制包
[root@localhost ~]# wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.0.27/bin/apache-tomcat-10.0.27.tar.gz --no-check-certificate
2.解压安装
[root@localhost ~]# tar -xvf apache-tomcat-10.0.27.tar.gz -C /usr/local/ [root@localhost local]# mv apache-tomcat-10.0.27/ tomcat-10.0.27/
3.修改环境变量
[root@localhost ~]# vim /etc/profile export CATALINA_HOME=/usr/local/tomcat-10.0.27 [root@localhost ~]# source /etc/profile
4.启动tomcat
[root@localhost ~]# /usr/local/tomcat-10.0.27/bin/catalina.sh start
标签:27,tomcat,部署,local,tomcat10,CentOS7,16.1,root,localhost From: https://www.cnblogs.com/haoee/p/17022349.html