- ./startup.sh显示Tomcat启动成功,但是浏览器不能打开Tomcat页面
- 首先查看端口是否被占用:netstat -tunlp
- 查看防火墙是否开启8080/80端口:vim /etc/sysconfig/iptables
- 若未开启8080/80端口则执行service iptables restart
- 若报Redirecting to /bin/systemctl restart iptables.service;Failed to restart iptables.service: Unit not found.则关闭防火墙:systemctl stop firewalld并锁定firewalld:systemctl mask firewalld
- 安装iptables.service:yum install iptables-services
- 设置开机启动:systemctl enable iptables
- 保存防火墙设置:service iptables save
- 添加8080端口:firewall-cmd --zone=public --add-port=8080/tcp --permanent
- 添加80端口:firewall-cmd --zone=public --add-port=80/tcp --permanent
- 添加端口是报错:FirewallD is not running,则先解除防火墙锁定:systemctl unmask firewalld
- 启动端口服务:systemctl start iptables
- 重新载入:firewall-cmd --reload
- 查看端口:firewall-cmd --query-port=80/tcp
- 重启防火墙:systemctl restart firewalld
- 查看防火墙状态:systemctl status firewalld