We often talk about servers and tell you which are the best to choose for business purposes. As a reminder, you can rent a cloud VPS/VDS server on QuantumHost for your business or other purposes. But today, we will discuss another important thing – the webserver. Let’s understand what it is, how it works, and which option is better to choose for your website.
What is a web server?
A web server is a server that receives a request from a user in the form of a URL, processes it, and sends the necessary data in the form of HTML pages, documents, media files, and media streams. It refers to both software and hardware. Like software, a web server consists of several components necessary to process user requests. Among them, the HTTP server is a must. Suppose we consider the web server as “hardware,” the computer hardware on which the documents are stored (the user sends a request to retrieve them). The hardware must be connected to the network so that the client can retrieve the requested data from the server.
Web servers often get confused with application servers or use these terms as synonyms. In part, they can be called analogs, but not really. There are several differences between web servers and application servers. A web server is HTTP-only and is intended mostly for sending static data. An application server supports HTTP and other protocols such as RPC and others, and their primary purpose is to transmit dynamic, i.e., always changing, content. Initially, they had different tasks. Now web servers often support PHP, Python, and other scripting languages to interact with static and dynamic data. And among the components of the majority of application servers, there are web servers used as proxy servers.
But this is a topic for a separate article. Within this publication framework, it is essential to understand how a web server works and what algorithm is used to interact with the user.
How does the webserver work?
Let’s look at a typical example that all Internet users encounter daily.
A user wants to go online and visit a particular site. To do this, he opens the browser on his computer or phone. When the program opens, he enters the desired URL into the address bar, goes to the saved address in the bookmarks, or clicks on a link to an already open resource. It doesn’t matter how, but it goes to the site. After a few seconds, the requested page appears on the screen with text, pictures, videos, and other content.
This is what the process looks like from the point of view of any ordinary person. Now let’s understand the necessary internal procedures.
The user opens the client application. It is often a regular browser from Google Chrome or Mozilla Firefox, installed on any device that supports this feature. It can be a PC, smartphone, tablet, or even a game console that can install a web browser. The client transmits a request via the HTTP protocol, which goes to the webserver. Going to the URL is the process of sending the request. The web server processes it and sends the user the requested data. It can be an ordinary HTML page, images, or other media files. The web server sends resources to the user using the same HTTP protocol.
If we briefly describe the procedure, we get the following sequence:
- The client sends an HTTP request.
- The web server receives the request and processes it.
- The web server sends an HTTP response.
- The client receives the requested resources.
The above steps cover the fundamental way web servers work. Now that sites are not limited to simple static pages, the transfer of resources is a more complicated process. For example, web servers provide the ability to securely receive and send data via HTTPS protocol, support scripting languages to send dynamic content, etc.
Thus, every Internet user unknowingly comes into contact with web servers daily.
An overview of the three most popular web servers
The first web server in history was CERN’s httpd, launched in 1991. Now there are many of them, so it is not so easy to decide on the choice.
If we consider the Russian-language Internet statistics, then in 2020, Nginx, Cloudflare, and Apache held leadership among web servers. Nginx accounts for more than half of the sites – 66.21%. Cloudflare takes second place – it is used in 8.51% of cases. Apache web server is used on 5.45% of platforms.
The top three most popular servers in 2020 are:
Given world statistics, we will consider these web servers as the most popular.
Apache HTTP Server was introduced by developers back in 1996. This is one of the first web servers on the market. After launching the software in free access, Apache surpassed all competitors and continues to lead today. Apache is used for 40.89% of sites.
About ten years ago, Apache was used as the primary and only web server. Now, with more data and with them increased the number of connections, it is always enough. Apache is often used as the main webserver and combined with other solutions. The web server is freely available and can be used for free.
Apache is a cross-platform software. It supports all major operating systems, including Microsoft Windows, Mac OS, and UNIX-like operating systems. Architecturally, Apache consists of a kernel, which performs the necessary tasks and many add-ons. The kernel is always running. The modules can be plugged in and unplugged so that we have some control over the server’s functionality.
Nginx was created by a Russian developer Igor Sysoyev who released the product in 2004. It is the only Russian web server on this list, which is popular in other countries – it accounts for 23.77% of all sites worldwide. Nginx is used by ordinary website owners and market giants, such as Facebook, Pinterest, Netflix, Tumblr, Instagram, and many others. Like Apache, Nginx is open-source. But it can only be used on UNIX-like operating systems.
During the development were taken into account some major shortcomings of existing web servers, including Apache. Thanks to this, Nginx perfectly copes with the increasing load and can easily handle several thousand requests at a time.
When it comes to flexibility, however, Nginx lags behind other products. For example, the modules have to be selected and compiled with the kernel-they are not mounted dynamically. However, plugging the modules themselves can be considered a plus because users can choose only necessary modules and avoid installing other modules manually.
IIS, or Internet Information Services, is a product of Microsoft. Therefore, it can only be used on the Windows operating system. Version 1.0 was released in 1995. Now a web server IIS is used on 16.45% of all sites in the world.
Technically, this is a package of servers with the main component in the form of a web server. Unlike Apache and Nginx, IIS is not freely available but is bundled with the Windows NT operating system.
In terms of functionality and performance, IIS is approximately on par with the more popular free solutions. The developers pay great attention to security and improve it with the release of each new version – in this matter, IIS surpasses Apache and Nginx. Because the solution is a commercial one, users can count on Microsoft support, which is especially important for large businesses. Significant disadvantages – work only on one platform and the need to buy a license Windows. Although the second factor indicates that IIS is conditionally free, it is already in the package.
If you own a site without a web server, you can not do it. It is good that there are many products on the market and they can be combined. For example, many believe that the best combination of Apache + Nginx. The main task is to choose the right option in terms of performance, security, and cost.