Web servers
So, it is about time that you learn what those famous web servers are. A web server is no more than a piece of software running on a machine and listening to requests from a specific port. Usually, this port is 80
, but it can be any other that is available.
How they work
The following diagram represents the flow of request-response on the server side:
The job of a web server is to route external requests to the correct application so that they can be processed. Once the application returns a response, the web server will send this response to the client. Let's take a close look at all the steps:
- The client, which is a browser, sends a request. This can be of any type—GET or POST—and contain anything as long as it is valid.
- The server receives the request, which points to a port. If there is a web server listening on this port, the web server will then take control of the situation.
- The web server decides which web application...