1.排查是否主程序是否运行成功,
可以telnet一下tomact的ip+端口,如果telnet成功就说明成功运行,获取tomcat端口的方法
1.首先通过命令:ps -ef|grep tomcat 获得进程号
2.再通过netstat -nlp|grep (进程号)获取端口号
2.排除是否代理转发的问题
(排除Nginx是否挂掉了Nginx是否代理成功)
打开Nginx目录下的conf查看nginx.conf
查看转发端口以及转发ip是否有误
无误排查是否是nginx挂掉了,telnet nginx的端口
和上面的一样ps -ef | grep nginx查看进程号查看进程,查看目录路径
netstat -nlp|grep (进程号)获取端口号去telnet
3.排除防火墙的问题
查看服务器防火墙是否封禁了对外的端口ip,确定对外开放接口:比如80还是443什么的(是否统一打包对外开放)
查看防火墙firewall-cmd --list-all
看白名单内有没有对外发布的ip以及端口
没有的话就通过firewall-cmd --permanent --add-rich-rule='rule family=“ipv4” source address=“192.168.31.0/24” port protocol=“tcp” port=“80” accept’添加,确定success以后 firewall-cmd --reload重启
# firewall-cmd --list-all
public
target: default
icmp-block-inversion: no
interfaces:
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
rule family="ipv4" source address="192.168.48.108" port port="22" protocol="tcp" accept
rule family="ipv4" source address="192.168.48.109" port port="22" protocol="tcp" accept
rule family="ipv4" source address="192.168.48.110" port port="22" protocol="tcp" accept
rule family="ipv4" source address="192.168.30.16" port port="22" protocol="tcp" accept
rule family="ipv4" source address="192.168.30.17" port port="22" protocol="tcp" accept
rule family="ipv4" source address="192.168.30.18" port port="22" protocol="tcp" accept
rule family="ipv4" source address="100.66.255.18" port port="22" protocol="tcp" accept
rule family="ipv4" source address="100.66.255.19" port port="22" protocol="tcp" accept
rule family="ipv4" source address="125.218.208.0/24" port port="22" protocol="tcp" accept
[root@lixiao-app-22-184 bin]# firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.31.0/24" port protocol="tcp" port="80" accept'
success
[root@lixiao-app-22-184 bin]# firewall-cmd reload
usage: see firewall-cmd man page
firewall-cmd: error: unrecognized arguments: reload
[root@lixiao-app-22-184 bin]# firewall-cmd -reload
usage: see firewall-cmd man page
firewall-cmd: error: unrecognized arguments: -reload
[root@lixiao-app-22-184 bin]# firewall-cmd --reload
4.排除安全策略的问题(是否安全部封掉了)
版权声明:本文为CSDN博主「misin Husng」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_44471504/article/details/126619341