Pcornel
Browse topics
Options
Recent
Favorites
Web Infrastructure · Technical reference

Apache

Direct 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.

When to use this

Use it to configure or troubleshoot Apache sites.

First 30 seconds

1. apachectl configtest — Syntax OK?

2. apachectl -S — virtual hosts and default.

3. Module needed enabled? apachectl -M.

4. Error log: /var/log/apache2/error.log or /var/log/httpd/error_log.

5. Reload and test with curl.

Operational verification

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

Evidence · next step

For Web Services → Apache, continue with the first unproven Topic check: Identify package/service name, loaded config path/includes, modules/MPM and exact vhost request. If that boundary is healthy, advance to the adjacent check: Validate syntax, dump effective virtual-host/listener mapping and confirm socket ownership. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to configure or troubleshoot Apache sites.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

apache config/includes → config test → unit/process + modules/MPM → Listen socket → vhost selection → filesystem/proxy handler → response/log

Healthy evidence: config test passes, expected modules are loaded, intended listener is owned by Apache, vhost selection matches Host/SNI and request logs correlate the expected response

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Identify package/service name, loaded config path/includes, modules/MPM and exact vhost request.

  • Validate syntax, dump effective virtual-host/listener mapping and confirm socket ownership.
  • Correlate access/error logs with one request and separate local handler, filesystem and upstream dependencies.
  • Apply the smallest persistent config or dependency fix, reload safely, then repeat the original request.

Verification chain. apache config/includes → config test → unit/process + modules/MPM → Listen socket → vhost selection → filesystem/proxy handler → response/log

Step 3 Verification path Verify boundary
# Syntax and include check
sudo apachectl configtest            # apache2ctl on Debian/Ubuntu

# Which vhost answers which name and port, and which is the default
sudo apachectl -S

# Loaded modules and MPM
sudo apachectl -M | sort
sudo apachectl -V | grep -i mpm

# Listening sockets and recent errors
sudo ss -ltnp | grep -E 'httpd|apache2'
sudo tail -n 50 /var/log/httpd/error_log     # /var/log/apache2/error.log on Debian

# Request with a specific Host header to the local server
curl -sSI -H 'Host: www.example.com' http://127.0.0.1/
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: config is syntactically valid but wrong include/vhost wins, module/MPM differs from assumption, permission or SELinux blocks content, or proxy/backend failure is surfaced as an Apache error

Step 5 Common mistakes Narrow the fault
  • Reloading without configtest.
  • Relying on .htaccess everywhere instead of vhost configuration.
  • Forgetting that the first vhost is the default for unknown names (and certificates without SNI).
  • prefork with mod_php on busy servers instead of event + PHP-FPM.
  • Disabling SELinux instead of fixing contexts and booleans.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

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.

Key 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)
ReferenceWhat it is1 section · depth on demand

Direct Answer

Apache HTTP Server (httpd) is a modular web server. Requests are matched to a virtual host by IP:port and then by ServerName/ServerAlias; modules (mod_ssl, mod_proxy, mod_rewrite, mod_proxy_fcgi…) add features, and an MPM decides how connections are handled (event is the modern default). Always run apachectl configtest (or -t) before reloading, and use apachectl -S to see which virtual host serves which name.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Apache is confirmed only when the effective configuration and selected virtual host handle the exact request as intended; config syntax or service state alone is insufficient.

In depth

Apache httpd: MPMs, modules and configuration layout

Apache's behaviour under load depends on its Multi-Processing Module (MPM). The Apache documentation describes the choice:

  • event and worker are threaded MPMs for sites that need a great deal of scalability. prefork suits stability or compatibility with older software.
  • On systems with threads and thread-safe polling, the default is event, which "will almost always" be the case.
  • Only one MPM can be loaded. With modular builds it's selected by a LoadModule line, and httpd -l shows a compiled-in MPM.

MPMs and PHP

CombinationNotes
prefork + mod_phpThe classic setup; one process per connection; memory-hungry
event + PHP-FPM (via mod_proxy_fcgi)The modern recommendation; PHP runs in its own pool
worker + mod_phpNot supported: mod_php isn't thread-safe

Configuration layout by distribution

Debian / UbuntuRHEL family
Package and serviceapache2httpd
Main file/etc/apache2/apache2.conf/etc/httpd/conf/httpd.conf
Sitessites-available/ + a2ensiteconf.d/*.conf
Modulesmods-available/ + a2enmodconf.modules.d/
Logs/var/log/apache2//var/log/httpd/
Control toolapache2ctlapachectl

Settings worth knowing

DirectivePurpose
ServerTokens Prod, ServerSignature OffDon't advertise the version
AllowOverride NoneIgnore .htaccess (faster, and centrally controlled)
Options -IndexesNo automatic directory listings
MaxRequestWorkersUpper limit on simultaneous requests
KeepAliveTimeoutHow long idle connections are kept
host$ apachectl -V | grep -i mpm
Server MPM:     event
host$ apachectl -M 2>/dev/null | grep -E "mpm|proxy_fcgi|ssl|php"
 mpm_event_module (shared)
 proxy_fcgi_module (shared)
 ssl_module (shared)
host$ sudo a2dismod php8.3 mpm_prefork && sudo a2enmod mpm_event proxy_fcgi setenvif && sudo a2enconf php8.3-fpm
host$ sudo apachectl configtest && sudo systemctl restart apache2
host$ sudo apachectl status | grep -E "requests currently being processed|idle workers"

Switching to event + PHP-FPM

The sequence above replaces mod_php and prefork with PHP-FPM behind event. An MPM change needs a full restart, not a graceful reload, because the process model itself changes. Check apachectl -M afterwards to confirm that only one MPM is loaded.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Apache is part of Web Services → Apache. Apache HTTP Server operation on Linux centers on the effective httpd/apache2 configuration graph, loaded modules, MPM/process model, listeners, virtual-host selection, permissions and request logging.

Topic-specific state model. Apache HTTP Server operation on Linux centers on the effective httpd/apache2 configuration graph, loaded modules, MPM/process model, listeners, virtual-host selection, permissions and request logging.

Interpretation rule. - apachectl configtest success ≠ the intended vhost is selected.

  • HTTPD active ≠ every configured listener or site is reachable.
  • A default page ≠ the requested application virtual host is working.
  • An Apache error log line ≠ Apache itself is the root cause when an upstream or filesystem dependency failed.

Quick reference

Layout by distribution

ItemRHEL / FedoraDebian / Ubuntu
Package / servicehttpdapache2
Main config/etc/httpd/conf/httpd.conf/etc/apache2/apache2.conf
Extra config/etc/httpd/conf.d/*.confsites-available/ → sites-enabled/ (a2ensite), conf-available/
Modules/etc/httpd/conf.modules.d/mods-available/ → mods-enabled/ (a2enmod)
Logs/var/log/httpd//var/log/apache2/
Controlapachectl, systemctl reload httpdapache2ctl, systemctl reload apache2

Virtual host selection

Apache first finds the best IP:port match (<VirtualHost 10.0.0.1:443> beats <VirtualHost *:443>); only among vhosts tied at that level does it compare the Host header (or SNI) with ServerName/ServerAlias in configuration order. If none matches, the first vhost listed for that address is the default — which is why an unknown name shows another site. Without SNI on HTTPS, the first name-based vhost also decides the certificate.

MPMs

MPMModelUse
preforkOne process per connection, no threadsOnly for non-thread-safe modules such as embedded mod_php
workerProcesses with threadsGeneral use
eventLike worker, with keep-alive connections handled by a listener threadDefault on current distributions; use with PHP-FPM

Size MaxRequestWorkers to memory; when it is reached, requests queue and the error log says so.

Access control and overrides

Apache 2.4 uses Require (Require all granted, Require ip 10.0.0.0/8). .htaccess files are read on every request where AllowOverride permits them — convenient on shared hosting, slower and harder to audit; prefer configuration in the vhost.

PHP

Current practice is event MPM plus PHP-FPM through mod_proxy_fcgi (SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"), instead of mod_php with prefork.

SELinux (RHEL family)

Content must carry httpd_sys_content_t (or _rw_t for writable paths), and proxying to back ends needs setsebool -P httpd_can_network_connect on. Denials show as 403/503 with AVC entries in the audit log.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Apache is confirmed only when the effective configuration and selected virtual host handle the exact request as intended; config syntax or service state alone is insufficient.

Apache/Nginx config syntax success is not application health.

ReferenceConfiguration & state2 sections · depth on demand

Configuration, persistence and lifecycle

Validate Apache/Nginx configuration before reload and understand virtual-host/SNI/default-server selection.

Distribution/platform context. Apache owns HTTPD-specific configuration and request handling; TLS, filesystem permissions and reverse proxy dependencies remain separate things to check.

Lifecycle and ownership

  • Change: edit, apachectl configtest, then systemctl reload (graceful — existing connections finish).
  • Sites: one file per vhost; enable/disable with a2ensite/a2dissite (Debian) or by file name in conf.d (RHEL).
  • Modules: load only what is used; review after upgrades.
  • TLS: certificates renewed by ACME clients need a reload hook (ACME Certificate Automation).
  • Logs: rotated by logrotate; keep error log level warn except while debugging.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Web Services → Apache. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://nginx.org/en/docs/ · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
apacheapache2httpd linux
Embedded reference data

Quick lookup tables

Apache operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Apache.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateApache HTTP Server operation on Linux centers on the effective httpd/apache2 configuration graph, loaded modules, MPM/process model, listeners, virtual-host selection, permissions and request logging.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact client/server + time + request/file operation → identify authoritative configuration → read back effective service/listener/session state → trace protocol selection/auth/identity → verify backend/upstream boundary → correlate logs → make smallest persistent change → repeat original workload + regression check.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainapache config/includes → config test → unit/process + modules/MPM → Listen socket → vhost selection → filesystem/proxy handler → response/logTrace requested/configured state through effective state to the observed workload result.
Failure boundaryApache is proven only when the effective configuration and selected virtual host handle the exact request as intended; config syntax or service state alone is insufficient.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux web/file-service evidence can establish this proof path: apache config/includes → config test → unit/process + modules/MPM → Listen socket → vhost selection → filesystem/proxy handler → response/logUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove unobserved clients, names, identities, routes, sessions, backends or time periods. Apache is proven only when the effective configuration and selected virtual host handle the exact request as intended; config syntax or service state alone is insufficient.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven service boundary, capture adjacent effective state and protocol/application evidence, make only the demonstrated persistent change, then repeat the original client workload plus a regression check.Continue to the next unresolved boundary while preserving the original test condition.

Apache · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryApache
Topic pathWeb Services → Apache
Runtime stateApache HTTP Server operation on Linux centers on the effective httpd/apache2 configuration graph, loaded modules, MPM/process model, listeners, virtual-host selection, permissions and request logging.
Fast checks- Identify package/service name, loaded config path/includes, modules/MPM and exact vhost request. - Validate syntax, dump effective virtual-host/listener mapping and confirm socket ownership. - Correlate access/error logs with one request and separate local handler, filesystem and upstream dependencies. - Apply the smallest persistent config or dependency fix, reload safely, then repeat the original request.
Verification chainapache config/includes → config test → unit/process + modules/MPM → Listen socket → vhost selection → filesystem/proxy handler → response/log Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryApache is proven only when the effective configuration and selected virtual host handle the exact request as intended; config syntax or service state alone is insufficient. Boundary chain: unit config/drop-ins → dependency/order/condition → exec/process → readiness/active state → owned socket/file/device → dependent client/workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

ObservationMeaning
apachectl -S: *:443 is a NameVirtualHost with default server …The listed default answers names that match no vhost
AH00558: Could not reliably determine the server's fully qualified domain nameHarmless warning — set a global ServerName
AH00072: make_sock: could not bind to addressPort already in use or no permission
AH00161: server reached MaxRequestWorkers settingAll workers busy — slow back end or too few workers
AH01630: client denied by server configurationRequire rules deny access
Permission denied (13) with SELinux enforcing, AVC entries in the audit logFile context or boolean missing
failed to make connection to backend / attempt to connect to … failedBack end (PHP-FPM, app server) unreachable — 503 to clients
Confirmation

Confirm action

Continue?