What is a web server and how does it work?
Do you know what a web server is? In this post, we will tell you in a simple way. The web servers are one of the indispensable elements for the functioning of the internet. Without them, you would not be able to enter Google, YouTube, Facebook, or any other sites.
And is that all the web content you can imagine is stored on web servers, and only they can provide it. But how does this work? If you want to know more, stay until the end of this post, where we will tell you everything.
What is a web server?
To answer this question, we must first explain what a server is. A server is a computer designed to meet the needs of other equipment (computers, smartphones, etc.). Servers can save and / or provide information, manage processes, etc.
To meet the needs of "user computers", a server must have the indicated programs. Thus, a server has one or more software, each corresponding to a type of service. Software intended for content delivery is called a web server.
A web server is a software with the function of storing web information and providing it to user computers. In other words, this software allows you to review any website. Thanks to him you can read this post. Thus, the expression does not refer to a computer as such, but to the software.
There is other software, such as mail server, FTP server, DNS server, file server, etc. The funny thing, and it can also get a little confusing, is that each of these programs includes the word "server" in their name.
Operation of a web server
To view content (pages, images, etc.), the first thing you need is a browser: Chrome, Firefox, Safari, or other. It should be noted that browsers are also called "web clients".
When you enter an address in the browser, or when you click to enter a page, you quickly enter the site. However, there is a behind-the-scenes process that takes very little time.
- First, your computer consults with a DNS server, to locate the server (computer) where the web information is stored. The DNS server provides you with the IP address of that server. Remember that an IP address is a number that identifies computers, smartphones, tablets, etc.
- By knowing the location of the server, your browser requests the desired content from the web server (software). This process is carried out using the HTTP (HyperText Transfer Protocol) protocol.
- The server then processes the request. First determine the domain to which the content belongs, since a web server can have multiple domains. It should be noted that the server will respect the rules of the websites.
- Then, the web server determines the type of information requested: static (images, HTML files, etc.) or dynamic (search engine page, banks, etc.). In the first case, you need to look it up on the SSD of the server. In the second case, the content is generated instantly using a code.
- Finally, the server will deliver the content to the client (browser). It is there, where you can see it on your computer screen.
Featured web servers
Among the most prominent web servers worldwide are Apache, Nginx, IIS, and GWS. The truth there are many others, however, these four "serve" the largest amount of web data. They have almost 80% of the websites, according to the study carried out by Netcraft in August 2019.
Lately, Nginx has positioned itself as one of the leaders in the market. According to Netcraft, in August 2019 it had 31.56% of the sites worldwide. This places it as the most used web server, at least on that date.
Nginx is a server free of open source, although there is also a paid version of the same. It has a very simple but efficient design, which makes it easily adjustable to any technology or programming language. It is compatible with multiple platforms: Windows, Linux, Unix, etc.
It stands out for its great performance, being able to attend thousands of requests quickly. It is ideal for dispatching static and dynamic content. In addition, it consumes very few resources as there are many simultaneous visits.
Its only disadvantage is that it cannot process .htaccess files. However, it has its own rewriting language.
For almost 20 years Apache HTTP Server was the leader in this field. It was born in April 1996 and quickly became the most widely used web server worldwide. However, from the beginning of 2012, it began to lose ground against other servers.
According to Netcraft, in August 2019, Apache had 29.43% of the websites worldwide. Seeing himself surpassed only by Nginx, and not by much. Hence, Apache remains one of the most used web servers.
This web server stands out for being open source, and for being free. In addition, it is cross-platform, being compatible with Linux, Windows, Unix, etc.
One of its disadvantages is that it performs poorly while simultaneously receiving thousands of requests for content from sites.
The IIS (Internet Information Services) is a web server created by Microsoft, designed specifically for the Windows platform. It is one of the most popular web servers, although it is not free. It has 14.71% of the sites (Netcraft, August 2019).
You can process websites developed in ASP or ASP.NET. However, it can also interpret pages programmed in Perl or PHP. In addition, it offers SMTP and FTP services.
Its biggest disadvantage is that it is not compatible with many languages and technologies. This puts it below other servers in terms of compatibility.
GWS (Google Web Server) is Google's server. It is a private server, intended for the company's websites. According to Netcraft, it occupied 2.43% of the total websites in August 2019.
Its main function is to provide the dynamic content of google web pages. If you check the URL of one of these sites you can find the term "gws".
To conclude, it is worth mentioning the importance of web servers. Without them the internet would not exist today as we know it, we would not have access to websites. But you already know this, because you already know what a web server is.