Sunday, 15 April 2012

How do web servers work?

If you have interest in computer technology, you may have wondered that how the webpage is displayed on the computer screen when you enter the URL of the website. You would be anxious to know the work going behind to display the webpage onto the screen. If you have curiosity to know the mechanism then read on. This article describes the complete processing of the web server behind the scene.





What is web server


Web server is software or a program based on client-server model. It is commonly used for website hosting. When the client sends a request for a file through HTTP protocol, it sends back the response in form of HTML text. The files are stored on the Internet in form of webpage. Every computer connected to Internet is supposed to have a web server to open a website. Apache and Microsoft’s IIS(Internet Information Server) are most commonly used web servers.

Common terms related to Web Server


Before starting the description of the complete process it is better to understand the common terms and vocabulary related to web server and its working.

1. Internet- As the name suggests, it is collection of several computers which are inter-connected to each other. The network between the computers slows them to communicate with each other

2. Clients and servers- The whole network system works on two types of system- client and server. The computer machine which provides services to the other machines is known as servers. And the machines which request for the services are known as clients.

3. IP address- It is a unique address assigned to each machine available on the Internet. It is a 32 bit number which are expressed as four octets.

4. Domain names- It is difficult for humans to remember the IP address. Therefore, they are provided a name known as domain. Domain names are human readable names assigned to each IP address.

5. Name servers- It is a set of servers which is used to map the domain names to the IP addresses. It is a form of database which maps the human readable names to IP address and is distributed all over the Internet.

6. Port- Each server machine is assigned a port number to provide its services to other machines. Some of the commonly used port numbers are:
80 for WWW, 21 for FTP server, 23 for telnet

7. Protocol- It is a set of rules used for communication over Internet. These rules describe the way the clients and server machine can have conversation between them.

8. URL- Abbreviated form of Uniform Resource Locator is the unique address of the files available on Internet. It is constituted in three parts.
a. The protocol( e.g. HTTP or FTP)
b. The domain name( e.g. www.indiastudychannel.com)
c. The file name(e.g. 13763-Resource-posting-guidelines.aspx)

Basic process on web server


When the URL of a website is entered in the browser, the browser connects to the server and sends a request for the page. After the complete processing, the servers send back the requested page. And finally the user is able to view the page on the computer screen. So, the three processes are involved in the complete scenario.
1. Establishing a connection
2. Sending a request
3. Responding to the request
Working of web server

Detailed description of the complete processing of the requested web page


As soon as the user enters the URL, it is divided into three parts: protocol, domain name and file name.
Here is step-by-step procedure

1. The domain name is mapped with the IP address through domain name servers. This is done to connect it with the server machine.

2. The browser then establishes a connection with the server machine at the provided IP address on the port available for the particular server machine.

3. After the connection is established, browser sends a request to the server and asks to provide the particular file.

4. The server then sends the HTML text of the requested file or web page to the browser.

5. The browser then read the HTML tags in the text file and formats the page onto the screen

Example of working of the web server


Suppose, the user enters a URL http://www.webopedia.com/Web_server.html

1. As soon as the user enters the URL, it is divided in three parts.
First, the protocol i.e. HTTP
Second, the domain name, www.webopedia.com
And third and the final, file name, Web_server.html

2. The domain name servers maps the domain name www.webopedia.com to the IP address.

3. WWW is available on port number 80. So, the browser forms a connection on the port 80 at that IP address.

4. Since, the protocol being used is HTTP; browser sends a GET request to the web server.

5. The web server sends a response in form of HTML text file which is formatted and displayed on the screen.

Finally, the user is able to view the requested webpage on the screen.

Did you like this resource? Share it with your friends and show your love!


3 comments: