Web Server

Introduction to Web Servers in Linux

A web server is a software (or hardware that has web server software on it) that responds to client requests through the Internet using HTTP. In the Linux context, the web server runs as a service or daemon process.

When a browser sends an HTTP request with a URL (Uniform Resource Locator) to the server, the web server handles requests and creates HTTP responses with specified website resources including HTML, CSS, and Javascript documents with required image and media files.

Apache and Nginx

There are two major web servers for Linux OS – Apache and Nginx. Both are open-source software and are available for free. According to W3Techs.com, more than 60% of all websites in the world were running on these two web servers as of February 2023.

Apache

Apache used to be the most widely used web server software in the world until Nginx took its place in 2021. Apache adopts a module system. With Apache’s modules, users can easily add or remove functions and customize their server. Apache can handle both static and dynamic content without an additional application server. Although Apache covers more functions than Nginx, Apache tends to be slower and consumes more RAM space than Nginx.

Nginx

Nginx was designed and developed to solve the C10K problem, which refers to the inability of a server to scale a large number (10K) of clients or connections (C). With a focus on static content handling, Nginx can be more scalable and faster than Apache. One major disadvantage of Nginx compared to Apache is that Nginx cannot handle dynamic content. Nginx needs another application server to handle dynamic content. For Nginx, there is an enterprise version called Nginx Plus, which covers enterprise-grade features.


You can also learn this topic offline. Click AmazonKindle.