Apache HTTP Server (httpd) is the world's most widely used open-source web server, powering a significant share of the web since 1995 and continuously updated — Apache 2.4.67 (May 2026) is the current stable release. Its directive-based, modular architecture lets administrators configure everything from static file serving to complex multi-domain hosting with SSL/TLS, reverse proxying, load balancing, and automatic certificate management via ACME (mod_md). Understanding Apache's configuration hierarchy — server config → virtual host → directory → .htaccess — is the single most important mental model for avoiding unexpected behavior in production environments.
What This Cheat Sheet Covers
This topic spans 27 focused tables and 222 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Virtual Host Configuration
Name-based virtual hosting is the standard approach: a single IP serves many domains, with Apache routing by the Host header. IP-based virtual hosting is reserved for rare cases where TLS SNI is unavailable. Every virtual host should have its own ErrorLog and CustomLog to keep troubleshooting clean.
| Directive | Example | Description |
|---|---|---|
<code><VirtualHost *:443></code><br> ServerName example.com<br></VirtualHost> | Defines a **named or IP-based virtual host** container; *:port` matches all IPs on that port for name-based hosting. | | ||
ServerName www.example.com | Canonical hostname used to identify the virtual host; essential for name-based routing and self-referential URL generation. | |
ServerAlias example.com *.example.com | Alternate hostnames for the virtual host; wildcard patterns match multiple subdomains within one block. | |
DocumentRoot "/var/www/html" | Root filesystem directory from which Apache serves files; must exist and be readable by the Apache process. | |
ServerAdmin admin | Administrator email shown on server-generated error pages. |