Fix Apache that will not start
We'll check config with apachectl configtest, inspect status with systemctl and journalctl, fix syntax and permission errors, and resolve port conflicts—or tell you when to escalate.
What you'll need
- SSH or console access with sudo
Step-by-step diagnostic
Quick triage — pick your path
Quick triage — pick your path
Choose the option that matches what you see. You can jump straight to that section.
- Follow this guide Work through the full procedure from apachectl configtest to fixing the config.
- Check config syntax You want to confirm the config is valid first.
- Check status and logs You want to see the error from systemctl and journalctl.
- Fix port conflict You suspect another service is using port 80 or 443.
- When to escalate Config management or application-level fix needed.
Show full guide
Steps
Goal: Check config with apachectl configtest, inspect status and logs, fix syntax and permission errors, and resolve port conflicts.
- Run
sudo apachectl configtest(orapache2ctl configteston Debian) to check config syntax. If it fails, fix the reported file and line. - Run
systemctl status apache2(orhttpdon RHEL) andjournalctl -u apache2 -n 50to see the error. - Good: You see the cause. Proceed to Check config syntax or Fix port conflict.
- Bad: Run Apache in foreground (
sudo apachectl -X) to capture startup output.
Check config syntax
Goal: Confirm the config is valid before starting.
- Run
sudo apachectl configtest(Debian:apache2ctl configtest). Syntax errors (missing quotes, unclosed directives, invalid options) prevent start. - Good: “Syntax OK”. Proceed to Check status and logs.
- Bad: Fix the file and line reported. Run configtest again until it passes.
Check status and logs
Goal: See the current state and error from systemctl and journalctl.
- Run
systemctl status apache2(or httpd) for state. Runjournalctl -u apache2 -n 50(or -u httpd) for the error. - Common causes: address already in use (port conflict), permission denied (config or log dirs), file not found.
- Good: Error identified. Proceed to Fix port conflict or fix permissions.
- Bad: Run
sudo apachectl -Xin foreground to see startup output.
Fix port conflict
Goal: Free port 80 or 443 if another service uses it.
- Run
ss -tlnporlsof -i :80andlsof -i :443. Nginx or another web server may be using the port. - Stop the conflicting service or change the Listen directive in Apache config.
- Good: Port is free. Run
sudo systemctl start apache2(or httpd). Confirm you should see active (running). - Bad: If you cannot stop the conflicting service, change Apache to listen on a different port.
When to escalate
Escalate if:
- Apache is managed by config management.
- The fix requires application-level changes.
- You cannot safely modify the config.
Provide apachectl configtest output, systemctl status, and journalctl output.
Verification
sudo apachectl configtestreports “Syntax OK”.systemctl status apache2(or httpd) shows active (running).- No errors in journalctl -u apache2.
- Apache serves requests (e.g. curl localhost returns a response).
Escalation ladder
Work from the device outward. Stop when the problem is fixed.
- Config test apachectl configtest to check syntax.
- Status and logs systemctl status apache2; journalctl -u apache2.
- Fix config and permissions Fix syntax errors; chown/chmod for www-data or apache user.
- Port conflicts ss -tlnp or lsof; stop conflicting service or change port.
- Escalate Provide apachectl configtest, status, journalctl.
What to capture if you need help
Before calling support or posting for help, have these ready. It speeds everything up.
- apachectl configtest output
- systemctl status apache2 output
- journalctl -u apache2 -n 50 output
- ss -tlnp or lsof -i :80 output (if port conflict)
- Steps already tried
Does apachectl configtest pass?
Run sudo apachectl configtest. Syntax errors prevent start.
You can change your answer later.
Fix config syntax
What does journalctl show?
Read the last 50 lines of Apache logs.
You can change your answer later.
Apply fix
You can change your answer later.
Done
Test manually or escalate
Reviewed by Blackbox Atlas
Frequently asked questions
- Why would Apache not start?
- Config syntax error, port already in use, permission denied on config or log dirs, or missing modules. Run apachectl configtest and journalctl first.
- Can I fix Apache that will not start myself?
- Yes. Run apachectl configtest to find config errors, fix the config, check port conflicts with ss -tlnp, and confirm permissions. Reload with systemctl daemon-reload.
- When should I escalate Apache start failures?
- If Apache is managed by config management, the fix requires application-level changes, or you cannot safely modify the config.
Rate this guide
Was this helpful?
Thanks for your feedback.