What a Web Server Actually Does

Web Servers Fundamentals

Chapter 1 · What a Web Server Actually Does

Apache has only ever shown up as an implementation detail inside Setting Up a Web Server on Debian, and Nginx has had no coverage at all — despite both being some of the most widely used infrastructure software in existence. This course compares Apache, Nginx, and IIS directly: their architecture philosophies, their configuration models, and when each one is actually the right choice. This chapter starts with the one question underneath all three: what does a web server actually do?

What "Serving a Website" Actually Means

A web browser opens a TCP connection to a server and sends an HTTP request — a plain-text message naming a method (GET, POST, ...), a path, and a set of headers. A web server is the piece of software listening on that port, waiting for exactly this kind of message, that parses the request and sends back an HTTP response: a status code, response headers, and a body — the actual HTML, image, or data the browser asked for. Every single feature this course covers is built on top of this one request-in, response-out cycle.

Where a Web Server Sits in the Stack

A request typically passes through more than one piece of software before a response comes back: the browser talks to the web server, and the web server either answers directly (for a static file already sitting on disk) or hands the request off to something else — a PHP interpreter, a Python or Node.js application process, a database-backed application server — and then relays that result back to the browser as the final response. The web server's own specific job is narrower than "running the website": it's the thing standing at the front door, deciding what to do with each request that arrives.

The Three Servers This Course Compares

Apache HTTP Server (1995) is the oldest of the three, built around a module system and, historically, a process-per-connection model. Nginx (2004) was built specifically to handle far more simultaneous connections than Apache's original model could, using a fundamentally different event-driven architecture. Internet Information Services (IIS) is Microsoft's own web server, tightly integrated with Windows and the .NET ecosystem, configured through a GUI and XML rather than the plain-text config files the other two use. Chapter 2 goes into each of these architecture models directly — this chapter is only introducing the three names.

Static vs. Dynamic Content

Serving a static file — an image, a stylesheet, a plain HTML page — is a web server's own native job: read the file from disk, send it back, done. Dynamic content is different: a page that needs to run code, query a database, or generate different output per request has to be handed off to something that can actually execute that code, with the web server acting as the front-facing layer that receives the request and relays the eventual response. This distinction — what the web server does itself vs. what it hands off — comes up constantly throughout this course, especially once Chapter 6 covers reverse proxying.

ApacheNginxIIS
First released199520041995 (bundled with Windows NT)
PlatformCross-platformCross-platformWindows only
Config formatPlain-text directivesPlain-text directivesGUI / XML
Best known forFlexibility, module ecosystemHigh-concurrency performanceWindows/.NET integration
Connecting this to a real deployment you've already done
Setting Up a Web Server on Debian walked through installing and configuring a real Apache server on a real machine. Everything that course had you actually type and configure — virtual hosts, config directives, restarting the service — is Apache's own concrete implementation of the general request/response model this chapter just introduced. This course revisits that same territory from a comparative angle: not just "how do you configure Apache," but "why does Apache's own approach look the way it does, compared to Nginx's or IIS's."
A web server is not the same thing as a web application
It's easy to blur "the web server" and "the website" together into one idea, especially when a single Apache install feels like it's "running" an entire site. The web server itself is only the layer handling connections and HTTP requests/responses — the actual application logic (a PHP script, a Django app, a Node.js process) is a separate piece of software the web server talks to, not something the web server is doing itself. Keeping this distinction clear is what makes the rest of this course's architecture comparisons make sense.

Hands-On Exercises

Exercise 1

In your own words, describe the full request/response cycle for a browser loading a plain HTML page from a web server — name every step between clicking a link and the page appearing.

📄 View solution
Exercise 2

A page on a site displays a user's account balance, pulled live from a database. Explain which part of serving this page is the web server's own job, and which part has to be handed off to something else, and why.

📄 View solution
Exercise 3

A friend says "my website runs on Apache" and separately "my website is built with Django." Explain, using this chapter's own distinction, why both statements can be true about the same site without contradicting each other.

📄 View solution

Chapter 1 Quick Reference

  • A web server's core job: accept HTTP requests, send back HTTP responses
  • Static content — served directly from disk by the web server itself
  • Dynamic content — handed off to a separate application process, with the web server relaying the result
  • This course compares Apache (1995, modular), Nginx (2004, event-driven), and IIS (Windows/.NET-integrated)
  • A web server and a web application are two different pieces of software working together, not one and the same