1.下载tar.gz格式的Tomcat安装包
https://tomcat.apache.org/download-80.cgi
2. 将Tomcat解压到指定目录
切换到目录 cd /usr
mkdir web
3.进入tomcat的压缩包目录下、解压tomcat、
tar -zxvf apache-tomcat-8.5.55.tar.gz -C /usr/web
4.启动tomcat
在bin目录下输入 sh startup.sh
5.观测是否启动成功
ps -ef|grep tomcat
五、如何安装mysql
#wget命令用来从指定的URL下载文件
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
重启mysql服务
service mysqld restart || systemctl restart mysqld.service
mysql -uroot 回车
默认安装完,root是没有密码的,需要手动添加密码
#set password for 'root'@'localhost'=password('密码');
set password for 'root'@'localhost'=password('root');
#给root用户赋予远程登录权限
grant all privileges on *.* to root@'%' identified by 'root' with grant option;
#刷新mysql权限
flush privileges;
#开放3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
#重启防火墙
systemctl restart firewalld