Files
rlz/Postman连接问题快速解决.txt

58 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2026-01-26 15:02:59 +08:00
========================================
Postman无法连接 - 快速解决方案
========================================
问题: Postman显示 "Could not get any response"
原因: 防火墙或云服务器安全组未开放8039端口
一、快速修复 (需要sudo权限)
---------------------------
【方法1: 使用修复脚本】
sudo bash fix_firewall.sh
【方法2: 手动执行命令】
sudo firewall-cmd --permanent --add-port=8039/tcp
sudo firewall-cmd --reload
sudo firewall-cmd --list-ports # 验证
二、云服务器安全组配置
--------------------
如果使用腾讯云/阿里云等云服务器,还需要在控制台配置安全组:
1. 登录云服务器控制台
2. 找到"安全组" → 选择对应的安全组
3. 添加入站规则:
- 协议: TCP
- 端口: 8039
- 源: 0.0.0.0/0 (允许所有IP生产环境建议限制)
三、验证修复
-----------
修复后在Postman中测试:
- Method: POST
- URL: http://101.43.95.130:8039/appLogin
- Headers: Content-Type: application/x-www-form-urlencoded
- Body: username=admin&password=admin123
如果成功会返回包含token的JSON响应。
四、如果仍然无法连接
------------------
1. 检查服务器是否运行:
ps aux | grep java | grep 8039
2. 检查端口监听:
netstat -tlnp | grep 8039
3. 临时关闭防火墙测试 (仅测试用):
sudo systemctl stop firewalld
# 测试后记得开启: sudo systemctl start firewalld
4. 检查云服务器安全组是否配置正确
========================================