排查Ubuntu Apache启动失败可按以下步骤进行:
sudo tail -f /var/log/apache2/error.log 或 sudo journalctl -xe -u apache2 查看详细错误信息。sudo netstat -tuln | grep -E ':(80|443)' 确认端口是否被占用,若被占用可修改 /etc/apache2/ports.conf 中的监听端口。sudo apachectl configtest 检查配置文件是否有语法错误,根据提示修复。/var/www/html 及日志目录权限正确,使用 sudo chown -R www-data:www-data /var/www/html 和 sudo chmod -R 755 /var/www/html 设置。sudo a2dismod),再逐个启用排查。free -h 和 df -h 确认内存、磁盘空间充足。sudo systemctl restart apache2 验证是否正常启动。若以上步骤无效,可根据错误日志进一步分析或尝试重新安装Apache。