A Web Server is a machine which works under response and request mechanism. Depending upon the request type and authority web server decides and allow access to the particular resource. The application (Web Server whether IIS or Apache) uses http protocol to communicate between Client and Sever. The full name of http is hypertext transfer protocol. In Client Server architecture Web Servers are the nodes.
How Web Server Works?
1. User enters the URL in browser. (URL stands for uniform resource locator, which is used to uniquely identify a resource in the internet). This URL will contain the host’s address, which can be either IP address or a particular name mapped to the IP address. This name is known as domain name.
2. There will be a DNS server local to the client’s network. DNS server will map the domain name to the particular IP address. Local DNS Server will check whether that IP address is present in the network.
3. If the IP address is not present in the local network, check will be done against other DNS servers in the internet in order to get the IP address corresponding to the domain name provided in the URL.
4. The IP address corresponding to the domain name will be returned back to the browser. (If the IP address of the server itself is entered in the URL, the steps 2, 3, 4 can be avoided).
5. The browser will connect to the particular IP address through the internet.
6. A connection will be established between client (browser) and the server.
7. The browser will send a request (since we are using http, the request is known as http request) for the web page.
8. Server will return http response and that response contains contents of the requested page. (The terms URL, DNS server, http request, http response will be explained in detail later).