Apache HTTP Server (httpd) is the world's most widely used open-source web server, powering millions of websites since 1995. It provides a highly configurable, modular architecture that enables administrators to customize server behavior through configuration files (typically httpd.conf and .htaccess), supporting everything from simple static sites to complex multi-domain hosting with SSL encryption, reverse proxying, load balancing, and fine-grained access control. Understanding Apache's directive-based configuration system is essential for securing production environments, optimizing performance under high traffic, troubleshooting request routing issues, and implementing modern features like HTTP/2 and WebSocket proxying—making it a critical skill for DevOps engineers, system administrators, and web developers managing server infrastructure.
What This Cheat Sheet Covers
This topic spans 23 focused tables and 149 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Virtual Host Configuration
| Directive | Example | Description |
|---|---|---|
<code><VirtualHost *:80></code><br> ServerName example.com</VirtualHost> | • Defines a named or IP-based virtual host container that isolates configuration for a specific site • matches requests based on IP address and port. | |
ServerName www.example.com:80 | • Specifies the canonical hostname and port the server uses to identify itself • essential for name-based virtual hosting and generating self-referential URLs. | |
ServerAlias example.com *.example.com | • Defines alternate names for the virtual host • supports wildcards to match multiple subdomains within a single VirtualHost block. | |
DocumentRoot "/var/www/html" | • Sets the root directory from which Apache serves files • must point to an existing directory with appropriate permissions. |