linux中启动tomcat后浏览器无法访问的解决方法之防火墙关闭

本文详细介绍了如何解决在CentOS系统上运行Tomcat时遇到的因防火墙设置不当而导致的问题。文章提供了两种解决方案,一是停止并禁用默认的firewalld服务,二是选择安装和启用iptables服务。

这个问题折磨了大半天,也怪自己对linux不是很熟悉。网上的文章铺天盖地没有一篇正常的

如果tomcat 确定启动正常,排查以下两个问题:

1.系统是否安装有安全软件例如360或电脑管家之类的 退出

2.关闭本地防火墙
centos从7开始默认用的是firewalld,这个是基于iptables的,虽然有iptables的核心,但是iptables的服务是没安装的。所以你只要停止firewalld服务即可:
sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service。

systemctl stop firewalld.service && systemctl disable firewalld.service

如果你要改用iptables的话,需要安装iptables服务:
sudo yum install iptables-services
sudo systemctl enable iptables && sudo systemctl enable ip6tables
sudo systemctl start iptables && sudo systemctl start ip6tables
 

原文:https://segmentfault.com/q/1010000004193816

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值