The World Wide Web

If we are going to add a server to the world wide web (hereafter just "the web") we will need to know how the web works.

The web is a client-server network in which user-agents request resources from servers. You are used to doing this using a user-agent called a browser, to get resources you refer to as web pages. The web is more general than this though. Lots of web traffic, perhaps the majority, is generated by automated programs, e.g. spiders, requesting resources rather than humans using browsers, and the resources they request don't have to be web pages at all. They may be XML or JSON "files" or in fact any resource type the client can process.

Servers provide resources to clients that request them. A typical webserver runs a tight loop to monitor port 80 (by convention, not necessity) for requests for resources. Upon receiving a request it looks for the resource and sends it out to the client. The resource may be static, typically a file, or dynamic, typically the output of a program.

Clients and servers communicate according to HTTP: the HyperText Transport Protocol. A resource is any chunk of information that can be identified by a URL (resource is the R in URL). The client and server sort out the details of their interaction using headers that specify the formats in which the resource is available (from the server's perspective) and acceptable (from the client's perspective), the encodings they will use, authorization to access the resource, and much more.