CentOS 7 study notes (7)

Installing Tomcat

Posted by Chen Xingxu on October 24, 2020

07.CentOS7学习笔记–安装Tomcat

Tomcat 与 JDK 版本对应关系

Apache Tomcat 版本 支持 Java 版本
10.0.x 8 及更高版本
9.0.x 8 及更高版本
8.5.x 7 及更高版本
8.0.x (被取代) 7 及更高版本
7.0.x 6 及更高版本 (WebSocket 7 及更高版本)
6.0.x (归档) 5 及更高版本
5.5.x (归档) 1.4 及更高版本
4.1.x (归档) 1.3 及更高版本
3.3.x (归档) 1.1 及更高版本

完整版表格:

Servlet Spec JSP Spec EL Spec WebSocket Spec Authentication (JASIC) Spec Apache Tomcat Version Latest Released Version Supported Java Versions
5.0 3.0 4.0 2.0 2.0 10.0.x 10.0.0-M7 (alpha) 8 and later
4.0 2.3 3.0 1.1 1.1 9.0.x 9.0.37 8 and later
3.1 2.3 3.0 1.1 1.1 8.5.x 8.5.57 7 and later
3.1 2.3 3.0 1.1 N/A 8.0.x (superseded) 8.0.53 (superseded) 7 and later
3.0 2.2 2.2 1.1 N/A 7.0.x 7.0.105 6 and later (7 and later for WebSocket)
2.5 2.1 2.1 N/A N/A 6.0.x (archived) 6.0.53 (archived) 5 and later
2.4 2.0 N/A N/A N/A 5.5.x (archived) 5.5.36 (archived) 1.4 and later
2.3 1.2 N/A N/A N/A 4.1.x (archived) 4.1.40 (archived) 1.3 and later
2.2 1.1 N/A N/A N/A 3.3.x (archived) 3.3.2 (archived) 1.1 and later

参考:

http://tomcat.apache.org/whichversion.html

下载 Tomcat 8

https://gitee.com/zhuzhulu/java-dev-software

https://tomcat.apache.org/download-80.cgi

选择 apache-tomcat-8.5.57.tar.gz 进行下载。

安装

将 gz 压缩文件放到指定目录,如 /usr/local,解压:

cd /usr/local
tar -zxvf apache-tomcat-8.5.57.tar.gz

使用 Tomcat 8

cd /usr/local/apache-tomcat-8.5.57/bin/
#开启 Tomcat
./startup.sh
#查看 Tomcat 启动日志
tail -f ./../logs/catalina.out
#关闭 Tomcat
./shutdown.sh