Pcornel
Web Infrastructure · Web Services

Apache

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

Back to the Topic

Answer

Apache httpd (package apache2 on Debian, httpd on RHEL) is a modular web server with virtual hosts, .htaccess, and modules such as mod_ssl, mod_rewrite and mod_proxy.

Remember

Config layout differs: Debian uses sites-available/sites-enabled with a2ensite/a2enmod; RHEL uses /etc/httpd/conf.d/. apachectl -S lists virtual hosts and which one is default. Reload with systemctl reload.

First checks

  • apachectl -S — virtual host overview
  • 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 httpd
systemctl reload apache2
systemctl reload

Verify in this order

request → listening socket → virtual host by name/port → modules and directives → content or proxy

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=2875

Confirmation

Confirm action

Continue?