下载安装tomcat
#创建tomcat路径
$ sudo mkdir /usr/local/tomcat
#修改文件夹权限
$ sudo chmod -R 775 /usr/local/tomcat
#下载tomcat https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.50/bin/apache-tomcat-9.0.50.tar.gz
$ wget -O /usr/local/tomcat/tomcat-9.tar.gz https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.50/bin/apache-tomcat-9.0.50.tar.gz
#指定解压文件的目录
$ tar -zxvf /usr/local/tomcat/tomcat-9.tar.gz -C /usr/local/tomcat/
#查看解压后的文件名
$ ls -al /usr/local/tomcat/
total 11244
drwxrwxrwx. 3 root root 57 Jul 19 16:10 .
drwxr-xr-x. 15 root root 4096 Jul 19 15:58 ..
drwxrwxr-x. 9 xia xia 220 Jul 19 16:10 apache-tomcat-9.0.50
-rw-rw-r--. 1 xia xia 11507318 Jun 28 16:52 tomcat-9.tar.gz
#文件复制到指定tomcat文件夹 命名方式建议使用tomcat_端口号
$ cp -r -i /usr/local/tomcat/apache-tomcat-9.0.50/ /usr/local/tomcat/tomcat9_8090
# 切换到tomcat文件下
$ cd /usr/local/tomcat/tomcat9_8090/
#执行tomcat bin/startup.sh脚本,确认tomcat能正常启动
$ bin/