This put up is a part of our Cloud Computing Foundations collection. Construct your abilities additional by taking our Introduction to Cloud Computing certification course.
You might already be accustomed to this idea. Keep in mind the shopper/server mannequin? Net servers are only a element of this mannequin—the server.
At a primary stage, an internet server shops and delivers web sites and internet functions. Net servers are composed of {hardware} and software program that work collectively to facilitate the alternate of knowledge.
The {hardware} element of an internet server refers back to the bodily or digital laptop that shops the web site’s information and elements. This contains every part from static HTML paperwork, textual content information, photos, and movies to extra complicated dynamic scripts. For instance, should you go to an internet site with a video on its homepage, that video is saved on the internet server {hardware}.
The software program element of an internet server is answerable for controlling how customers can entry the information saved on the server. It does this by managing the requests that are available in from internet browsers and different gadgets related to the web. The software program put in on the internet server means that you can view web sites in your internet browser.
Let’s begin by digging into the elements that make internet servers tick.
Hyper Textual content Switch Protocol (HTTP)
HTTP allows internet servers to ship web sites and internet functions to customers, to allow them to entry and think about content material on the web.
Once you use an internet browser to entry an internet site, your internet browser sends a request to the online server internet hosting that web site. This request is within the type of an HTTP message. The online server receives and processes the request, retrieving the requested useful resource from its {hardware} and software program elements.

On the suitable within the picture above, we are able to see that the online server sends a message to an internet browser utilizing HTTP. To request an internet site, we are able to merely sort its URL into the browser’s tackle bar. The browser then maps this URL to an IP tackle, which represents the server’s bodily location the place the web site is saved. If the server is discovered at this IP tackle, the online server software program will obtain the request and ship again the web site we requested for. So, if we typed “www.instance.com” into the browser, the online server would return the web site for “www.instance.com.”
Self-Internet hosting vs. Internet hosting Supplier
In relation to internet hosting your internet utility, you may have a selection between utilizing a internet hosting supplier or establishing your personal server on your own home laptop. People typically self-host, however for organizations that present important companies, a internet hosting supplier gives way more safety.
With a internet hosting supplier, you’ll be able to make the most of high-speed servers and networks. A internet hosting supplier additionally has the flexibility to reliably deal with fluctuating energy consumption and shield from potential failure. However the largest cause that we use internet hosting suppliers for important companies is to make sure non-public data doesn’t leak into the general public area.
Net Server Software program
Net server software program is the center of any web site or internet utility. It allows us to serve internet content material to customers over the web. After we are establishing an internet site and configuring our servers, we’d like software program to make it work.
When it comes to software program, two options dominate the market: Apache and NGINX. We’ll go over these two right here, nevertheless it’s price noting that there are different choices together with IIS, and Lighttpd, every with distinctive advantages and challenges.
Apache
Apache is a broadly used internet server software program ultimate for internet hosting dynamic content material, reminiscent of eCommerce websites or boards. It could possibly run on a number of platforms, together with Home windows, macOS, and Linux. It’s been round since about 1995 and is among the oldest and most widely-used internet servers out there.
Apache is able to dealing with quite a lot of internet protocols, together with HTTP, HTTPS, and FTP, and may run on many various working programs, together with Home windows, Linux, and macOS. It’s extremely customizable, with numerous modules that may add extra performance like assist for dynamic content material, authentication, and caching. It was particularly constructed to course of dynamic content material inside the server itself, impartial of any server elements.
Apache has a one-connection-per-process mannequin. A one-connection-per-process mannequin is a conventional method to constructing internet servers the place every shopper connection is dealt with by a separate course of or thread. This course of, or thread, is answerable for managing the shopper’s connection and processing their requests till the connection is closed. As a result of Apache makes use of this mannequin, server efficiency is considerably degraded when the variety of concurrent connection requests surpasses the variety of processes.
One of many key options of Apache is its potential to assist a number of digital hosts on a single server, permitting web sites to share assets whereas sustaining their distinctive configurations. Apache can also be extremely extensible, with a big neighborhood of builders creating and sustaining extra modules and plugins to increase its performance.
NGINX
However, NGINX (pronounced Engine X) is optimized for serving static content material like photos and movies and is widespread for its potential to deal with giant numbers of simultaneous shopper connections. NGINX is very valued for its potential to enhance content material supply over the online.
NGINX was constructed utilizing an asynchronous, event-driven mannequin. Let’s go over these ideas for a second.
We use asynchronous fashions when a system must deal with many simultaneous requests, reminiscent of in internet servers, community communication, and database administration. By utilizing an asynchronous programming mannequin, these programs can obtain higher efficiency and scalability and cut back the danger of blocking and freezing.
An event-driven mannequin is pushed by occasions within the system moderately than following a predetermined sequence of steps.
So, having an asynchronous and event-driven mannequin permits a system to deal with a number of duties and occasions collectively with out blocking the processing of different duties.
Due to its structure, NGINX can’t course of dynamic content material, reminiscent of PHP. It should cross it on to an exterior processor for execution. Because of this, NGINX is extra fitted to static content material, reverse proxy, load balancing, mail proxy, and HTTP caching. NGINX can also be advisable for Linux programs.
Utilizing NGINX and Apache Collectively
NGINX and Apache are sometimes used collectively. By doing so, we are able to leverage every server’s strengths whereas overcoming their limitations.

One of the vital widespread strategies of integrating Apache and NGINX is by putting NGINX in entrance of Apache to deal with all incoming HTTP requests, as seen within the above picture. This configuration includes directing all incoming HTTP requests to NGINX, which then relays requests for dynamic content material to Apache whereas serving requests for static content material by itself.
By putting NGINX in entrance of Apache, we make the most of NGINX’s potential to deal with giant volumes of simultaneous connection requests with its asynchronous, event-driven mannequin. This helps alleviate a number of the pressure on Apache by lowering the variety of open threads and processes required to deal with requests, which may in any other case degrade Apache’s efficiency.
The reverse proxy configuration additionally supplies extra advantages, reminiscent of load balancing and improved safety. NGINX can distribute requests throughout a number of Apache servers, balancing the load and stopping any single server from turning into overwhelmed. Moreover, NGINX can act as a buffer between the web and the online server, offering an additional layer of safety in opposition to assaults.
Construct the talents to reach cloud computing by taking our Introduction to Cloud Computing certification course.