What is a web server?
A web server is software that answers HTTP requests from browsers and other clients, and by extension the computer that runs it. Every website depends on at least one.
What does web server software do?
It listens on ports 80 and 443, accepts connections, negotiates TLS, reads each HTTP request and returns a response. For static files it reads them from disk and sends them with the right headers. For dynamic pages it hands the request to an application, either in its own process or through a protocol such as FastCGI or a proxied HTTP connection, and streams back the result. Along the way it applies rules: redirects, access restrictions, compression, caching headers and logging.
Which web servers are widely used?
| Server | Character | Often chosen for |
|---|---|---|
| NGINX | Event-driven, small memory footprint | Reverse proxy, static files, high concurrency |
| Apache HTTP Server | Modular, per-directory overrides | Shared hosting, PHP applications expecting .htaccess |
| Caddy | Automatic HTTPS, simple configuration | Quick secure setups, small teams |
| LiteSpeed (open edition) | Apache-compatible rules, fast PHP | WordPress-heavy servers |
| HAProxy, Envoy | Proxies rather than file servers | Load balancing, service meshes |
Our NGINX article covers the most common choice in detail.
How can one server host many sites?
With virtual hosts selected by name. The browser sends the host name in the request and, for HTTPS, during the TLS handshake through Server Name Indication. The web server matches that name to a site configuration with its own document root and certificate. Hundreds of sites can share one IPv4 address this way, which matters here because each server includes one IPv4 address and extra ones are not sold. Caddy shows how compact a two-site configuration can be:
shop.example.net {
root * /srv/shop/public
php_fastcgi 127.0.0.1:9071
file_server
}
docs.example.net {
root * /srv/docs/build
encode zstd gzip
file_server
}
Caddy obtains and renews both certificates automatically.
What changed with HTTP/2 and HTTP/3?
Both make better use of a single connection. HTTP/2 multiplexes many requests over one TCP connection with compressed headers, removing the old habit of opening six connections per site. HTTP/3 runs over QUIC on UDP, which avoids head-of-line blocking when packets are lost and speeds up connection setup, a noticeable gain on mobile networks. Current NGINX, Caddy and LiteSpeed support both; remember to open UDP 443 in the firewall for HTTP/3.
What do web server logs tell me?
Who asked for what, when, and how it went. Each line records the client address, time, method, path, status code, response size, referrer and user agent, and can include the time taken. Logs reveal broken links (404s), errors (5xx), slow pages and abusive clients. A quick look at the busiest paths and error counts:
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
awk '$9 ~ /^5/ {print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -15
Ship logs to a central store for longer retention and rotate them locally so they never fill the disk.
What hardware does a web server need?
Less than the application behind it. Serving static files and terminating TLS is cheap: a modern core handles thousands of requests per second. The application and database usually set the requirement. For a site serving mainly cached and static content, the network becomes the limit: a 1 Gbps port moves roughly 80,000 typical 1.5 KB responses per second, and large downloads fill it far sooner. ESSENTIAL-2 with a guaranteed 1 Gbps port suits most single sites at $43.20 a month; heavy media sites benefit from BUSINESS-1 2024 with 3 Gbps. Our High-traffic websites page covers larger designs.
How is a web server secured?
Keep it patched, expose only what is needed and set safe defaults. Run it as an unprivileged user, disable directory listings and version banners, serve only HTTPS with HSTS, set security headers such as Content-Security-Policy, limit request body sizes and rate-limit sensitive paths such as logins. Keep application back ends on loopback. Every server here includes DDoS filtering against floods, but application-level abuse must still be limited at the web server. Our SSL and TLS and Application security articles go further.
Is a web server the same as a web application?
No, though they work together. The web server handles connections, TLS, static files and routing; the application implements the logic and talks to the database. Some application frameworks include a built-in HTTP server, but in production a dedicated web server or proxy in front adds TLS handling, buffering and protection. Our Web application article describes the layers behind it.
Machines for web servers
| Model | Processor | Cores | Memory | Drives | Port | Per month |
|---|---|---|---|---|---|---|
| ESSENTIAL-1 | Intel Xeon-E 2386G | 6 | 32 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $38.40 |
| ESSENTIAL-2 | Intel Xeon-E 2388G | 8 | 32 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $43.20 |
| ESSENTIAL-M | AMD Ryzen 9 9900X | 12 | 64 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $70.80 |
| BUSINESS-1 2024 | AMD EPYC 4244P | 6 | 32 GB | 2x 960 GB SSD NVMe | 3 Gbps unmetered | $81.60 |
Related pages
NGINX
The event-driven web server and reverse proxy explained: how workers handle connections, common configuration blocks, TLS, caching and tuning on bare metal.
Read moreWeb application
Software used through a browser: how front end, back end and data layers fit together, common architectures and hosting one on your own server.
Read moreHigh-traffic websites
Machines with fast cores and guaranteed 3 to 5 Gbps ports for news sites, forums, APIs and busy content platforms.
Read moreInstall a LAMP stack
Install Apache, MariaDB and PHP on Debian, Ubuntu or the Enterprise Linux family, add a virtual host and HTTPS, and tune it for the hardware.
Read moreQuestions and answers
What is the most popular web server software?
NGINX and Apache HTTP Server serve the majority of websites, with Caddy and LiteSpeed also widely used.
Can one server host many websites on one IP address?
Yes. Name-based virtual hosting and Server Name Indication let hundreds of HTTPS sites share one IPv4 address, each with its own certificate.
Does HTTP/3 need any firewall change?
Yes. HTTP/3 runs over QUIC on UDP, so allow UDP port 443 in addition to TCP 443.
Does the web server software itself need big hardware?
The web server itself needs little. The application, database and expected traffic decide the model, and port speed matters for media-heavy sites.
Which web server gets HTTPS certificates automatically?
Caddy does it by default. NGINX and Apache use an ACME client such as Certbot or acme.sh to obtain and renew certificates.