centos

CentOS Apache2错误怎么解决

小樊
38
2025-11-21 21:58:10
栏目: 智能运维

CentOS 上 Apache 错误排查与修复指南

一 快速定位

二 常见错误与对应修复

三 高频场景速查表

症状 优先命令 处理要点
服务起不来 systemctl status httpdtail -f /var/log/httpd/error_log 先看日志末几行定位错误类型
启动报端口占用 `ss -tulpen grep -E ':80
配置改完仍报错 apachectl configtest 按提示修复语法,再重启
外部访问不了 firewall-cmd --list-all 放行 http/https 并重载防火墙
访问被拒绝 ls -ld /var/www/htmlgetenforce 校正目录属主为 apache:apache、权限 755;SELinux 临时置 permissive 验证
页面不存在 tail -f /var/log/httpd/error_log 核对 DocumentRoot 与文件路径是否存在

四 修复后验证与建议

0
看了该问题的人还看了