What is a web server?

Although Apache can be used in many ways (e.g. as a proxy server or a load balancer), it is commonly used as a web server. A web server is a software with a primary function to store, process and deliver web pages to clients. The protocol used to deliver web pages is HTTP (Hypertext Transfer Protocol).

HTTP is a client-server protocol; a client (usually a web browser) requests a resource (a web page) from a web server. The web server responds with the requested web page. Here is a graphical representation of the communication between a web client and a web server:

how web server works

As you can see in the picture above, the client wants to access http://google.com and points the browser to the URL http://google.com (this is an example of an HTTP Request message). The web server (running Apache or a similar web server software) hosting http://google.com receives the request and responds with the content of the web page (an HTTP response message).

Web servers usually use a well-known TCP port 80. If the port is not specified in a URL, browsers will use this port when sending HTTP request. For example, you will get the same result when requesting http://google.com and http://google.com:80.

Geek University 2021