How a Web Server Works

A web server is essentially software that is able to listen for requests and respond with information.

When the web server software is installed on your computer, it will be hooked up to listen on a specific IP address and port on your computer. Requests for information for that specific IP and port will go to the server, where it will fetch the requested information and respond back.

The information requested can be text, images, videos, or nearly anything. Generally, the requested information is a webpage and the request comes from someone typing in a URL such as “indigothemes.com/webpage-example” on their web browser.

This URL is requesting a specific IP, which has been given a nice user friendly domain. We won’t get into the details of URLs and domain routing here.

In this particular example, the request may have been initiated by someone on their home computer requesting for our webpage over the internet. The computer with the web server software installed will be listening for that request, and respond back with the web page for “webpage-example”.

Since we have a WordPress website, the information for webpage-example will most likely be dynamic. That means once the request is received, it will pull all the information it needs from the database and generate the webpage you requested by getting all the images, widgets, and data together on the fly.

It will send that information back to the person who requested the webpage and the browser will display the page.

 

Since this software is installed on a computer, any computer with web server software installed can be called a “server”. When people refer to servers they are essentially talking about a computer that has the web server technology installed.

When we host a website, however, we want to have a specific computer that is always turned on to listen and respond to requests.

While you could technically serve your website with your home computer, in most cases your home computer is used for work, has other applications running, gets turned off from time to time and simply isn’t a reliable way to serve your website.

That’s why a dedicated computer stripped down of all unnecessary components and whose sole purpose is to stay up and respond to requests is generally used as a web server.

Many companies provide these dedicated servers for you to essentially rent. These companies will do more than provide you with the technology, they also ensure that the computers stay up (“uptime”) so that you don’t miss any requests, provide maintenance, load balances, etc., etc.

The more detailed nuances of keeping these things up and running. It can get complicated quite fast. That’s why most technology companies will hire network administrators to deal with this stuff if they have in-house servers.

As a small business you’ll simply use a hosting provider.

The most popular web server software are:

  1. Apache
  2. Nginx

We generally recommend people use Apache for their WordPress website as it is the most popular one on the market.

There are others out there, such as Microsoft Internet Information Server, and all kinds of other app servers and special purpose web servers like Tomcat for Java, Node for JavaScript, Sinatra for Ruby, and so on.

That’s not so relevant to us right now, but we’re just listing them for your own curiosity’s sake.

Since the job of the web server is to get a request, find whatever data is needed and compose a reply, the bulk of the work in getting a single web server up and running is in configuring it to have access to the needed resources, and how to handle or route requests that come to that server.

For a website that receives a lot of requests, that means many people are visiting your website, one server alone will not be able to handle all the requests.

In which case you will have multiple servers that work together to spread the load. In those cases, you’ll need to determine how to spread the demand across multiple servers and resources.

We’ve all heard of stories where a website gains a lot of popularity, people flood in to visit their site and because the servers are not able to handle the influx of requests, their whole server crashes.

Just to give you an idea of how many servers some companies need, lets take a look at an extreme example, Microsoft. They have one of the largest data centers in the world at 1,200,000 Sq. Ft.

The image below is a look inside a data center. As you can see, it'll typically just be rows and rows of servers on racks. However, for most of us, just a shared server provided by a hosting service company will do the trick.

The hosting providers themselves may have large facilities so you'll get the benefit of the upkeep and just pay a monthly fee to have a part of a server, or even a dedicated server or multiple servers depending on your needs.

You can scale up or down as your needs change and the costs will vary accordingly.