1、下载linux版本tomcat安装包
Apache Tomcat® - Apache Tomcat 8 Software Downloads
2、下载这个文件
3、上传到服务器中,本人使用的是finalshell远程工具
4、执行命令:tar -zxvf apache-tomcat-8.5.93.tar.gz
5、如果系统开启了防火墙要开放防火墙8080端口
firewall-cmd --zone=public --add-port=8080/tcp –permanent
firewall-cmd –reload
也可以关闭防火墙:systemctl stop firewalld;
6、将tomcat注册为系统服务
7、cp -p /usr/local/tomcat/apache-tomcat-8.5.93/bin/catalina.sh /etc/init.d/tomcat
编辑tomcat文件,建议使用外部编辑器打开,配置如下信息
检查在/etc/init.d/tomcat中的#!/bin/bash 后面有没有 #chkconfig: 2345 80 90,没有的话添加上
8、添加授权,开启启动服务
命令:chmod 755 /etc/init.d/tomcatss
chkconfig --add tomcat
chkconfig tomcat on
9、启动tomcat
systemctl start tomcat
测试:到浏览器输入你服务器的IP,访问8080端口