防火墙与127.0.0.1

问题背景

公司开发了一套即时消息系统(类似QQ),内部各web系统与其做了单点登陆集成,打开web系统页面时会通过js访问本机127.0.0.1:12700端口获取用户信息(即时消息系统提供的)。在我本机 fedora30系统(5.6.13-100.fc30.x86_64)上,一直出现单点登陆不好使问题,给自己的办公(特别是每周考勤)造成了很大不便。

问题解决

经过排查发现,本机默认开启防火墙,造成12700端口不能被访问

[wangzhen@hellow-pc bin]$ systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-07-16 12:06:42 CST; 11s ago
     Docs: man:firewalld(1)
 Main PID: 17665 (firewalld)
    Tasks: 2 (limit: 4915)
   Memory: 31.5M
   CGroup: /system.slice/firewalld.service
           └─17665 /usr/bin/python3 /usr/sbin/firewalld --nofork --nopid```

关闭防火墙(且不设置成开机自启动)后,问题解决

[wangzhen@hellow-pc bin]$ systemctl stop firewalld.service
[wangzhen@hellow-pc bin]$ systemctl disable firewalld.service

原文地址:https://www.cnblogs.com/wangzhen3798/p/13321973.html