Apache HTTP Server
The Apache HTTP Server is an open-source web server that has served a large share of the web since 1995. It handles HTTP requests using a modular architecture, supporting virtual hosts, URL rewriting, authentication, TLS, and reverse proxying through loadable modules.
itWeb servers, proxies, and traffic management | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Apache HTTP Server
Almost nobody adopts Apache any more; it gets inherited. A configuration written years ago, extended twice, documented never, currently serving something the organisation would notice losing. So the skill worth acquiring is archaeology: knowing which setting wins, which module is quietly loaded, and how to prove what the server will do before restarting it.
Underneath, there is startlingly little server. Connection handling and coordination are all the core does. Everything anyone would call a feature — TLS, rewriting, authentication, proxying, compression — arrives as a module hooking a defined stage of the request, and the individual configuration lines, called directives, decide which modules act on which requests.
That is why one installation can serve files, run applications and forward
traffic to other servers at once, and equally why its characteristic failure is
combination rather than error. httpd -M lists what is genuinely loaded, which
beats reading any single file.
One module is special. Exactly one multi-processing module is active, and it
decides how work is accepted and dispatched: prefork uses separate processes
with no threads, worker puts threads inside processes, event adds
asynchronous handling of some connection work.
That is an architectural choice rather than a speed switch, and it is where the
largest inherited win usually hides. Apache's own documentation is blunt that
under prefork the HTTP/2 module handles one request at a time per connection,
and that prefork is chosen today only for processing engines that would crash
if threaded — meaning PHP running inside the server. Moving off it is often the
biggest available improvement, and it stalls for years because nobody owns it.
Then the containers, the configuration blocks that scope a rule to part of
the server. <Directory> and <Files> match things on disk. <Location>
matches URL space whether or not a file exists there. <VirtualHost> selects a
site. Protect files with the disk-based ones, because a URL can arrive at a file
by more than one route, so a <Location> restriction alone may protect nothing.
Here is the fact that surprises people and keeps surprising them. No file on disk contains the configuration that applies to a request. Policy is assembled at request time from the main config, the matched virtual host, the containers above, any per-directory overrides, and each module's own merge order.
So a change process where somebody reads a diff and nods is theatre: the diff is
real, the conclusion drawn from it is a guess. The parsed virtual-host dump from
apachectl -S, and a traced request against the running server, are the only
honest evidence.
Two habits follow. Run apachectl configtest before every reload, and apply
with apachectl graceful so requests already in flight finish. And count the
per-directory .htaccess override files under the served directories: zero
means central policy is real and reviewable, hundreds means access control is
editable by anyone who can write a file there.
Look up directives and control commands on the Cheatsheet, and let the Intro give scope merging and the request path the room they need. Field Notes is about the staffing bill nobody budgets for.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://httpd.apache.org/docs/2.4/
Supports
- Current Apache HTTP Server 2.4 documentation structure
- Reference paths for modules, directives, administration, user guides, tutorials, and platform notes
- https://httpd.apache.org/docs/2.4/getting-started.html
Supports
- Client, server, URL, request, response, status-code, and logging mental model
- Configuration file and Include variability across builds and distributions
- Static and dynamic content distinction
- DocumentRoot and index-file introductory behavior
- Error log as the first troubleshooting source
- https://httpd.apache.org/docs/2.4/configuring.html
Supports
- Plain-text directives, main configuration, Include, and restart activation
- Syntax testing with apachectl configtest and the t command option
- Core versus module capabilities and LoadModule behavior
- Static and dynamic module inspection options
- Directive scope and `.htaccess` request-time behavior
- https://httpd.apache.org/docs/2.4/dso.html
Supports
- Dynamic shared objects as separately built modules
- Static versus dynamic module inclusion
- LoadModule activation at startup or restart
- Third-party modules as code loaded into the server process
- https://httpd.apache.org/docs/2.4/mpm.html
Supports
- MPM responsibility for binding, accepting requests, and dispatching work
- Exactly one active MPM
- Process and thread distinctions among prefork, worker, and event
- MPM selection differences across operating systems and builds
- https://httpd.apache.org/docs/2.4/sections.html
Supports
- Filesystem, file, URL, virtual-host, proxy, and conditional containers
- Filesystem versus webspace security boundary
- Configuration section merge order
- One selected virtual host per request
- Module-owned configuration merging during request processing
- https://httpd.apache.org/docs/2.4/vhosts/
Supports
- Name-based and IP-based virtual hosts
- ServerName, ServerAlias, and VirtualHost concepts
- Parsed virtual-host inspection with the S command option
- https://httpd.apache.org/docs/2.4/urlmapping.html
Supports
- Default URL-path append behavior under DocumentRoot
- Per-virtual-host document roots
- Alias, redirects, reverse proxy, rewrite, and handlers as alternate mappings
- DirectoryIndex selection for directory requests
- https://httpd.apache.org/docs/2.4/howto/htaccess.html
Supports
- Per-directory delegated configuration purpose
- AllowOverride and AllowOverrideList authorization
- Preference for main configuration when administrators have access
- Request-time filesystem search and performance cost
- Security implications of delegated configuration authority
- https://httpd.apache.org/docs/2.4/programs/apachectl.html
Supports
- apachectl as a front end to the httpd daemon
- Configuration testing behavior
- Graceful restart and graceful stop behavior
- Difference between graceful and ordinary restart for open connections
- Build-dependent command and file paths
- https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html
Supports
- Reverse-proxy role and backend isolation
- ProxyPass request mapping
- ProxyPassReverse redirect-header rewriting
- Balancers, members, failover, health checks, and balancer-manager restrictions
- https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html
Supports
- Minimal mod_ssl virtual-host shape
- Certificate and private-key directives
- Cipher policy, OCSP stapling, client authentication, access control, and TLS logging topics
- Need for deeper production policy beyond the minimal example
- https://httpd.apache.org/docs/2.4/logs.html
Supports
- Error log as the primary startup and request diagnostic source
- Access logs through CustomLog and LogFormat
- Per-module LogLevel configuration
- Access and error log correlation identifiers
- Log-directory ownership risk and untrusted raw log content
- https://httpd.apache.org/docs/2.4/mod/mod_status.html
Supports
- Active and idle worker, traffic, uptime, CPU, client, and request status data
- Human-readable and machine-readable status endpoints
- Status endpoint access-control requirements
- Use of status data in resource troubleshooting
- https://httpd.apache.org/docs/2.4/misc/security_tips.html
Supports
- Update requirements across server, add-ons, applications, and operating system
- Protection of executable, configuration, and log paths from untrusted writes
- Unprivileged request-serving process model
- Request timeouts, request-size limits, MaxRequestWorkers, and MPM considerations
- Resource-exhaustion limits and tradeoffs
