centos8安装tomcat

  1. 创建目录
  2. cd /
  3. mkdir download
  4. cd download/
  5. 下载tomcat
  6. wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.98/bin/apache-tomcat-8.5.98.tar.gz /download/
  7. 解压
  8. tar -xf apache-tomcat-8.5.98.tar.gz
  9. 创建目录
  10. cd ../
  11. mkdir tomcat
  12. cd download/
  13. 移动到这个目录下 /tomcat/
  14. mv apache-tomcat-8.5.98 /tomcat/
  15. cd /tomcat/
  16. chmod +x apache-tomcat-8.5.98/bin/*.sh
  17. 开放永久8080端口
  18. firewall-cmd --permanent --add-port=8080/tcp
  19. 重启防火墙 不是必须
  20. firewall-cmd --reload
  21. systemctl restart firewalld
  22. 查看tomcat是否运行 不是必须
  23. ps -ef|grep java
  24. 运行tomcat
  25. cd /tomcat/apache-tomcat-8.5.98/bin/
  26. ./startup.sh
  27. 测试8080端口
  28. 8080
  29. 关闭tomcat
  30. ./shutdown.sh

补充点:
查看临时开放端口

firewall-cmd --list-ports

查看永久开放端口

firewall-cmd --list-ports --permanent

添加永久端口

firewall-cmd --add-port=223/tcp --permanent

删除永久端口

firewall-cmd --remove-port=223/tcp --permanent

查看tomcat是否运行

ps -ef|grep java

不运行结果

root        端口号    6886  0 01:42 pts/2    00:00:00 grep --color=auto java
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值