The term web server can refer to hardware or software, or both working together.

  1. On the hardware side, a web server is a computer that stores web server software and a website's component files (for example, HTML documents, images, CSS stylesheets, and JavaScript files). A web server connects to the Internet and supports physical data interchange with other devices connected to the web.
  2. On the software side, a web server includes several parts that control how web users access hosted files. At a minimum, this is an HTTP server. An HTTP server is software that understands URLs (web addresses) and HTTP (the protocol your browser uses to view webpages). An HTTP server can be accessed through the domain names of the websites it stores, and it delivers the content of these hosted websites to the end user's device.

When a browser needs a file that is hosted on a web server, it requests the file via HTTP. When the request reaches the correct (hardware) web server, the (software) HTTP server accepts the request, finds the requested document (if it exists), reads it, processes it as needed, and sends it back to the browser (through HTTP).

HTTP (Hypertext Transfer Protocol)

HTTP is an application-layer protocol for transmitting hypermedia documents, such as HTML. It was designed for communication between web browsers and web servers, but it can also be used for other purposes. HTTP follows a classical client-server model, with a client opening a connection to make a request, and then waiting until it receives a response. HTTP is a stateless protocol, meaning that the server does not keep any data (state) between two requests.

URLs (Uniform Resource Locator )

A URL is a text string that specifies where a resource (such as a web page, image, or video) can be found on the Internet. In the context of HTTP, URLs are called "Web addresses" or "links". A web browser displays URLs in its address bar (for example, https://developer.mozilla.org). Some browsers display only the part of a URL after the "//", that is, the Domain name.

A URL is composed from a limited set of characters belonging to the US-ASCII character set. These characters include digits (0-9), letters(A-Z, a-z), and a few special characters ("-"".""_""~"). Moreover, there are some characters that have special meaning within URLs. These characters are called reserved characters. Some examples of reserved characters are ?/#: etc. Any data transmitted as part of the URL, whether in query string or path segment, must not contain these characters. To transmit data in URLs that contain them, they need to be encoded. This is done by escaping the character with a % and converting it to hexadecimal.

TCP/IP

TCP/IP stands for Transmission Control Protocol/Internet Protocol and is a suite of communication protocols used to interconnect network devices on the Internet. It specifies how data is exchanged over the internet by providing end-to-end communications that identify how it should be broken into packets, addressed, transmitted, routed, and received at the destination.

Sockets

A socket is a software concept for a connection. Sockets enable applications to connect to a TCP/IP network. An application running on a host creates a socket or doorway to connect with an application on another host. Messages pass through this socket or doorway.

What is a port?

A port is a virtual point where network connections start and end. Ports are software-based and managed by a computer's operating system. Each port is associated with a specific process or service. Ports allow computers to easily differentiate between different kinds of traffic: emails go to a different port than webpages, for instance, even though both reach a computer over the same Internet connection.

What does a socket do in an HTTP server?

In sum: