Skip to content

Informatics Practices · Ch 5 — Internet and Web

Web Server

5.9

Web Server

A web server is the foundation of every website you visit. It is the system that stores a website's files and delivers them to a user's browser when requested. Without a web server, no website content — text, images, or videos — can ever reach your screen.

The term "web server" can refer to either hardware or software, and understanding both meanings is essential.

Web Server as Hardware

As a piece of computer hardware, a web server is a physical machine connected to the Internet. This machine stores two things: the web server software itself, and all the contents of a website — HTML pages, images, CSS stylesheets, JavaScript files, and more. Because it is connected to the Internet, anyone with a browser can access those stored contents. The server is assigned a unique domain name (like www.example.com), which allows users anywhere in the world to reach it by typing that name into their browser.

Web Server as Software

As software, a web server is a specialised program that runs on that hardware. Its job is to understand URLs (web addresses) that come in as requests from browsers, and to respond to those requests. When you type a web address or click a link, your browser sends an HTTP request to the web server. The server then accepts that request, interprets what is being asked for, searches its storage for the correct file, and sends back an HTTP response containing the requested page. The browser receives this response and displays the page to you.

Developing and Testing a Website Locally

If you want to build and test a website on your own personal computer, you must first install web server software on that computer. This creates a local environment where your browser can request pages from your own machine, just as it would from a live server on the Internet. This is a standard step in web development.

The Request-Response Cycle

The interaction between a browser (the client) and a web server follows a clear four-step cycle, especially when dealing with dynamic web pages:

  1. HTTP Request: The browser sends an HTTP request to the web server for a specific page or resource.
  2. Program Execution: The web server calls an application program (like a script written in PHP or Python) in response to the request.
  3. HTML Output: That program executes and produces HTML output as its result.
  4. HTTP Response: The web server sends this HTML output back to the browser as an HTTP response, and the browser displays the final web page. …