A web server is software that receives requests from browsers over HTTP or HTTPS and sends back web pages, images and other files. It is the part of hosting that actually delivers your website. This guide explains what a web server is and follows one request from start to finish.
Before you start
No setup is needed – this is a concept guide. If you want to see where DNS fits first, read how DNS resolution works.
What a web server does
- Listens on network ports – 80 for HTTP, 443 for HTTPS.
- Decrypts HTTPS traffic using your SSL/TLS certificate.
- Works out which website the request is for (virtual hosts).
- Returns a static file directly, or hands the request to an application (PHP, Node.js, Python) and returns its output.
- Applies rules such as redirects, rewrites, compression, caching headers and access control.
- Writes access and error logs.
One request, step by step
- The browser resolves
example.comto an IP address through DNS. - It connects to port 443 and performs a TLS handshake; the server presents the certificate for
example.com(chosen via SNI). - The browser sends
GET /about HTTP/2with aHost: example.comheader. - The web server matches the host to a virtual host and applies rewrite rules (for example from
.htaccess). - If
/aboutmaps to a file, it sends it. If it is handled by WordPress, it passes the request to PHP, which queries the database and builds HTML. - The server sends the response with a status code (200, 301, 404, 500…) and headers, possibly compressed with gzip or Brotli.
- The browser parses the HTML and requests CSS, JavaScript and images – often over the same connection.
Static vs dynamic content
| Static | Dynamic | |
|---|---|---|
| Examples | Images, CSS, JS, plain HTML | WordPress pages, shop carts, dashboards |
| Work per request | Read a file and send it | Run code, query the database, build output |
| Speed | Very fast | Slower; benefits greatly from caching |
Page caches such as LSCache turn dynamic pages into near-static responses, which is why they make such a big difference.
Virtual hosts: many sites, one server
Thanks to the Host header and SNI, one web server and one IP address can serve hundreds of domains. Each virtual host has its own document root, logs and certificate. This is how shared hosting works.
Popular web server software
- Apache – flexible, module-based, supports
.htaccess. - Nginx – event-driven, popular as a reverse proxy.
- LiteSpeed – event-driven, Apache-compatible, with LSCache; used on MdmHost hosting.
- OpenLiteSpeed – free edition of LiteSpeed.
- Caddy – automatic HTTPS and simple config.
- Microsoft IIS – for Windows Server and ASP.NET.
Common HTTP status codes
- 200 OK – success.
- 301/302 – redirect.
- 403 – forbidden (permissions or rules).
- 404 – not found.
- 500 – application error.
- 502/503/504 – a backend or upstream problem, overload or timeout.
FAQ: what is a web server?
Is a web server hardware or software?
Both terms are used. Strictly it is the software (such as LiteSpeed); people also call the machine running it a web server.
Do I need to install a web server on shared hosting?
No. The host runs and maintains it; you upload your files.
Can one server run two web servers?
Yes, but only one can use ports 80/443 directly. A common setup puts one in front as a reverse proxy for the other.
