Web Server Troubleshooting
Cheat sheet · https://pcornel.dk/topic.php?topic=2880
Answer
Web server troubleshooting follows the request: DNS, TCP, TLS, virtual host, permissions, application backend — using the HTTP status code and logs to find the failing step.
Remember
Status codes guide you: 403 permissions/SELinux/index, 404 path/vhost, 500 application, 502 backend down, 503 overloaded, 504 timeout. Check the server's error log at the same second as the request.
First checks
systemctl status nginx|apache2|httpd— web server statenginx -t / apachectl configtest— configuration testss -ltnp | grep -E ':80|:443'— listening portscurl -vI https://<name>— response, headers and TLStail -f /var/log/nginx/error.log— error log (or apache2/httpd)
Commands
ss -ltnp- Operational command for Inspect listening web-service sockets. Focus fields: local address, port, state, PID and proces…
systemctl reload nginx
Verify in this order
DNS → TCP → TLS → vhost → permissions → backend → response
Where it usually breaks
First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2880