We often talk about servers and tell you which are the best to choose for business purposes. You can rent a cloud VPS/VDS server on ArkHost 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. A web server consists of several components necessary to process user requests, like software. 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 analogues, but not really. There are several differences between web servers and application servers. A web server is HTTP-only and is intended mainly 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., constantly 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. It is essential to understand how a web server works and what algorithm is used to interact with the user within this publication framework.
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, transferring 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 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 for free access, Apache surpassed all competitors and continues to lead today, used for 40.89% of sites.
About ten years ago, Apache was the primary and only web server. Now, with more data and the increased number of connections, it is always enough; often used as the main webserver and combined with other solutions.
Apache is a cross-platform software. It supports all major operating systems, including Microsoft Windows, Mac OS, and UNIX-like operating systems. 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 Russian developer Igor Sysoyev who released the product in 2004. It is the only Russian web server on this list popular in other countries – it accounts for 23.77% of all sites worldwide; used by ordinary website owners and market giants, such as Facebook, Pinterest, Netflix, Tumblr, and Instagram, etc. Like Apache, Nginx is open-source. But it can only be used on UNIX-like operating systems.
Some significant shortcomings of existing web servers were taken into account during the development, 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.
IIS is approximately on par with the more popular free solutions in terms of functionality and performance. 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, especially 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.
You cannot do it if you own a site without a web server. It is good that there are many products on the market and they can be combined. For example, many believe that the best combination is Apache + Nginx. The main task is to choose the correct option in terms of performance, security, and cost.