Pcornel
Web Infrastructure

Web Services

Cheat sheet · https://pcornel.dk/topic.php?topic=2874

Back to the Topic

Answer

Linux web services are mainly Apache httpd and Nginx serving static content, running applications (PHP-FPM, app servers) or acting as reverse proxies, usually with TLS.

Remember

Read the HTTP status: 502/504 point to the backend, 403 to permissions or SELinux, 404 to paths or virtual host, TLS errors to certificates. Always test the config before reloading.

First checks

  • systemctl status nginx|apache2|httpd — web server state
  • nginx -t / apachectl configtest — configuration test
  • ss -ltnp | grep -E ':80|:443' — listening ports
  • curl -vI https://<name> — response, headers and TLS
  • tail -f /var/log/nginx/error.log — error log (or apache2/httpd)

Commands

systemctl reload apache2
systemctl reload nginx
ss -ltnp

Verify in this order

client request → DNS → TCP/TLS → virtual host → content or 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=2874

Confirmation

Confirm action

Continue?