Linux + 宝塔部署网站后无法访问怎么办?
1. 基础排查步骤
bash
# 检查Web服务状态 systemctl status nginx # 或 apache2 # 查看防火墙规则 firewall-cmd --list-all
- 未启动Web服务 →
systemctl start nginx
- 防火墙拦截 → 放行80/443端口
- 域名解析错误 →
ping 域名
检查IP是否正确
2. 宝塔面板检查
- 网站 → 设置 → 检查「域名绑定」是否正确
- 安全 → 确保「端口已开放」
📌 如果仍然无法访问,查看Nginx/Apache日志:
bash
tail -n 50 /www/wwwlogs/nginx_error.log
更新时间:2025-06-03 10:15:39