Use it as the entry point when a website is down, slow or returns errors.
Web Services
Linux web services are mainly Apache httpd and Nginx serving static content, running applications (PHP-FPM, app servers) or acting as reverse proxies, usually with TLS.
1. curl -vI https://<name> — status code and TLS?
2. Server running and listening?
3. Config test, then the error log.
4. Backend (php-fpm, app) up for 502/504?
5. Firewall and SELinux for 403/connection issues.
client request → DNS → TCP/TLS → virtual host → content or backend → response
For Web Services, continue with the first unproven Topic check: Pin host, service, config source, listener address/port, requested scheme/host/path and test client. If that boundary is healthy, advance to the adjacent check: Read back effective service configuration and verify which process owns the intended socket. 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
Operational reference
Fast context before you go deeper.
systemctl status nginx apache2 httpdVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
service configuration → effective unit/process → socket/listener → address/port/firewall → HTTP/TLS selection → virtual host or proxy route → upstream/application → client-visible response
Healthy evidence: the expected process owns the intended listener, configuration is loaded, the requested host/path selects the intended site or proxy and the client receives the expected status/content
Step 2 Verification and output interpretation Verify boundary
Verification path. Verify listener and selected virtual host, then inspect certificate presented for the exact hostname/SNI, chain/trust result, dates and negotiated protocol. Test HTTP response and, for proxies, the upstream transaction separately. Compare server config-test output with the running process generation and logs. For certificate issues, inspect subject/SAN, issuer chain and trust path rather than relying on browser wording alone. Preserve the exact client hostname because SNI and verification depend on it.
Existing fast checks for this Topic. - Pin host, service, config source, listener address/port, requested scheme/host/path and test client.
- Read back effective service configuration and verify which process owns the intended socket.
- Trace one exact request through TLS/HTTP selection, logs and any proxy upstream to the application response.
- Make the smallest persistent change, reload/restart only as required, then repeat the original client request and an adjacent regression test.
Verification chain. service configuration → effective unit/process → socket/listener → address/port/firewall → HTTP/TLS selection → virtual host or proxy route → upstream/application → client-visible response
Step 3 Commands Verify boundary
systemctl status nginx apache2 httpd
curl -I http://localhost
nginx -t
apachectl configtest
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: service is active but not listening, a default site wins selection, TLS/SNI selects another identity, proxy routing targets the wrong upstream, or a local curl succeeds while the real client path fails
Next check: Continue 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.
Step 5 Common mistakes Narrow the fault
- Reloading without a config test.
- Default sites left enabled.
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.
Subtopics
Go one level deeper into this subject.
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.
Subtopic NginxNginx on Linux is verified from parsed configuration and master/worker runtime state through listen/server_name selection, location processing, TLS, static-file or upstream handling and the client-visible response.
Subtopic CaddyCaddy web server: Caddyfile, automatic HTTPS with ACME, reverse_proxy, php_fastcgi, file_server, HTTP/3 by default, admin API and validate/reload commands.
Subtopic Virtual HostsVirtual Hosts maps multiple web identities to shared listeners using request attributes such as address/port, Host and often TLS SNI; diagnosis must prove which site actually wins selection.
Subtopic Reverse ProxyA Linux reverse proxy terminates a client-facing request and creates a separate upstream request; both legs have independent DNS, TLS, timeout, header and health boundaries.
Subtopic HTTP Load BalancingLayer 7 load balancing with nginx and HAProxy: algorithms, active and passive health checks, persistence, draining, timeouts, retries, X-Forwarded-For/PROXY protocol and L4 vs L7.
Subtopic TLSWeb-service TLS is the server-side binding of certificate/key, protocol policy and SNI identity to a listening web endpoint; it must be verified as presented by the running service.
Subtopic Web Server TroubleshootingWeb Server Troubleshooting isolates failures from DNS and transport through web-server process/listener, TLS/vhost routing, filesystem or reverse proxy, upstream application and the exact client-visible response.
Subtopic PHP-FPMPHP FastCGI Process Manager: pools, pm static/dynamic/ondemand sizing, sockets and permissions, status and ping pages, slowlog, timeouts and the nginx/Apache FastCGI connection.
Read the HTTP status: 502/504 point to the backend, 403 to permissions or SELinux, 404 to paths or virtual host, TLS errors to certificates. Always test the config before reloading.
systemctl status nginx|apache2|httpd— web server statenginx -t / apachectl configtest— configuration testss -ltnp | grep -E ':80|:443'— listening portscurl -vI https://<name>— response, headers and TLStail -f /var/log/nginx/error.log— error log (or apache2/httpd)
ReferenceWhy it matters1 section · depth on demand
How it works in operation
Web Services — operational mechanics and state ownership. systemd resolves unit files/drop-ins, dependencies/order, conditions and environment, then forks/execs or activates the service and tracks its main process/readiness according to Type. active does not necessarily mean the application listener, dependency or workload is healthy; oneshot, notify, socket activation and restart policies change state semantics.
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
Web service troubleshooting is resolved only when the exact request reaches the intended listener, selects the intended site/proxy policy and produces the expected application response from the real client path.
In depth
Web services on Linux: request routing from listen to server
Whichever web server you use, a request is matched to a configuration in two steps. First by the address and port it arrived on, then by the host name it asks for. The nginx documentation on request processing describes it:
- nginx first tests the IP address and port against the
listendirectives. - Among the servers that match, it tests the Host header against
server_name. - If nothing matches, or there's no Host header, the request goes to the default server for that address and port. That's the first server, unless one is marked
default_server.
Apache works the same way: it compares ServerName and ServerAlias among the virtual hosts that match the address, and uses the first listed one when no name matches.
Apache and nginx compared
| Apache httpd | nginx | |
|---|---|---|
| Configuration unit | <VirtualHost> | server { } |
| Names | ServerName, ServerAlias | server_name |
| Default site | The first vhost for the address | The first server, or default_server |
| Per-directory overrides | .htaccess (if allowed) | None; all in the main configuration |
| Process model | MPMs: event (default), worker, prefork | Event-driven workers |
| Typical role | Applications with modules (PHP via FPM, mod_*) | Reverse proxy, static files, TLS termination |
Operational commands
| Task | Apache | nginx |
|---|---|---|
| Test the configuration | apachectl configtest | nginx -t |
| Show the parsed vhosts | apachectl -S | nginx -T |
| Reload gracefully | systemctl reload apache2 / httpd | systemctl reload nginx |
| Logs | /var/log/apache2/, /var/log/httpd/ | /var/log/nginx/ |
host$ sudo nginx -t
nginx: configuration file /etc/nginx/nginx.conf test is successful
host$ sudo nginx -T 2>/dev/null | grep -E "^\s*(listen|server_name)" | sort | uniq -c
host$ curl -s -o /dev/null -w "%{http_code} %{remote_ip}\n" -H "Host: unknown.example.net" http://10.30.0.11/
444 10.30.0.11
host$ sudo apachectl -S 2>&1 | head -6
host$ ss -tlnp | grep -E ':80 |:443 '
host$ sudo tail -f /var/log/nginx/access.log
Catch unknown names explicitly
The test with an unknown Host header shows which server answers requests for names you didn't configure. Without an explicit default, that's simply the first site, which may expose an application under any name pointed at your address. A catch-all server returning 444 (nginx) or a minimal default vhost prevents that.
Documented example, not captured output.
Known-good, transitional and broken reference
Web Services — comparative operational reference for Web Services. What it does not show: systemd active/running or host-global state alone does not show the workload context is healthy Next check: move one step toward the original workload using Use systemctl show/status plus journal/PID/socket evidence, validate the resource the service owns, then run the original client/application operation. Platform/scope: Linux distribution/systemd version; unit names, presets and service hardening differ by distribution/package.
How it works at runtime
Web Services is part of Web Services. Linux Web Services covers the host-side HTTP service stack from package and unit configuration through listener binding, virtual-host or server-block selection, TLS termination, reverse-proxy behavior, logs and the original client request.
Web serving adds listener/socket binding, virtual-host selection, reverse-proxy upstream routing and HTTP semantics.
Topic-specific state model. Linux Web Services covers the host-side HTTP service stack from package and unit configuration through listener binding, virtual-host or server-block selection, TLS termination, reverse-proxy behavior, logs and the original client request.
Technical metadata. Linux distribution + service/version + client/server/time + DNS/route/firewall + listener/socket + HTTP/TLS/vhost/proxy or NFS/SMB session + identity mapping + backend path/upstream + original workload result.
Interpretation rule. - A service reporting active ≠ a listener exists on the intended address and port.
- A listening socket ≠ the requested virtual host or reverse-proxy route is selected.
- An HTTP 2xx response ≠ the intended backend, content or authorization path is correct.
- A local request ≠ the external DNS, firewall, TLS and client path are healthy.
Quick reference
Linux web stack components:
| Role | Common software |
|---|---|
| Web server / reverse proxy | Nginx, Apache httpd, Caddy, HAProxy |
| App runtime | PHP-FPM, Gunicorn/uWSGI (Python), Node.js, Java (Tomcat) |
| TLS automation | certbot, acme.sh, Caddy built-in |
| Logs | access/error logs, journald |
Typical layout: Nginx terminates TLS and serves static files, proxies dynamic requests to an app server on localhost or a Unix socket. Check listeners with ss -ltnp and configs with nginx -t / apachectl configtest before every reload.
Limits and how it fails
Primary failure point. Web service troubleshooting is resolved only when the exact request reaches the intended listener, selects the intended site/proxy policy and produces the expected application response from the real client path.
Model. A valid certificate does not show the server presents it, the client trusts its chain or the hostname matches. openssl parsing success does not show key/certificate pairing or live deployment.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Configuration intent and lifecycle. Protect private keys with least privilege and controlled deployment. Build certificate chains in the order expected by the server and keep trust-store management separate from leaf certificate deployment. Reverse proxy settings should define upstream scheme/host headers/timeouts deliberately. Reload should be preferred over disruptive restart when supported and safe.
Distribution/platform context. Web Services owns Linux web-server operation; Firewall, Certificates & TLS, DNS and application-specific Topics own their deeper boundaries.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Web Services. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://nginx.org/en/docs/ · confidence 94%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.
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.
Quick lookup tables
Web Services operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Web Services.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Linux Web Services covers the host-side HTTP service stack from package and unit configuration through listener binding, virtual-host or server-block selection, TLS termination, reverse-proxy behavior, logs and the original client request. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin 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 chain | service configuration → effective unit/process → socket/listener → address/port/firewall → HTTP/TLS selection → virtual host or proxy route → upstream/application → client-visible response | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Web service troubleshooting closes only when the exact request reaches the intended listener, selects the intended site/proxy policy and produces the expected application response from the real client path. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux web/file-service evidence can establish this proof path: service configuration → effective unit/process → socket/listener → address/port/firewall → HTTP/TLS selection → virtual host or proxy route → upstream/application → client-visible response | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved clients, names, identities, routes, sessions, backends or time periods. Web service troubleshooting closes only when the exact request reaches the intended listener, selects the intended site/proxy policy and produces the expected application response from the real client path. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue 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. |
Web Services · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Web Services |
|---|---|
| Topic path | Web Services |
| Runtime state | Linux Web Services covers the host-side HTTP service stack from package and unit configuration through listener binding, virtual-host or server-block selection, TLS termination, reverse-proxy behavior, logs and the original client request. |
| Fast checks | - Pin host, service, config source, listener address/port, requested scheme/host/path and test client. - Read back effective service configuration and verify which process owns the intended socket. - Trace one exact request through TLS/HTTP selection, logs and any proxy upstream to the application response. - Make the smallest persistent change, reload/restart only as required, then repeat the original client request and an adjacent regression test. |
| Verification chain | service configuration → effective unit/process → socket/listener → address/port/firewall → HTTP/TLS selection → virtual host or proxy route → upstream/application → client-visible response Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | Web service troubleshooting closes only when the exact request reaches the intended listener, selects the intended site/proxy policy and produces the expected application response from the real client path. Boundary chain: unit config/drop-ins → dependency/order/condition → exec/process → readiness/active state → owned socket/file/device → dependent client/workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |