Web Server Hardware
Depending upon your website and the resources it will need, you may need a single low performance box as a web server, multiple clusters of physical devices, or something in between the two extremes.
Companies like Google, Amazon, Facebook, etc. have multiple server farms spread out all over the world to make their websites as responsive as possible. Each server farm has hundreds to thousands of computers taking a little bit of the load because they are processing tens of thousands of website requests each second.
At the other end of the spectrum, your local barber shop, florist, etc., is probably sharing a server with lots of other websites or hosting on a small local server.
Let’s consider a mid-sized company which will be hosting their own server. If it is a static site, then the web server is little more than a fancy file server. It needs fast throughput for accessing and transmitting the files that are being requested. It doesn’t have any real processing to accomplish, and therefore doesn’t need a lot of processing power or potentially RAM.
One server I worked on had two separate network cards to speed up communication. One was used for internal intranet hosting, the other went to an external IP for external facing clients. This improved the throughput because of the way the network engineers designed the system and isolated communications for security reasons as well.
If you have a dynamic site, which is running a lot of server side scripting languages, you might need to have fast processors with lots of cores and lots of ram.
Google’s IT department has two basic server configurations you can request as a developer – one with a lot of storage and one a lot of RAM – all depending on the type of task you will be doing. They do this because they know most servers tend to fall into one of those two categories. This also makes it easy for them to manage instead of having multiple unique configurations. It is important to understand the needs of your website to be able to properly pick the hardware which will be used as well as making it easy for your IT team to configure and maintain.
Web Server Software
There are various web servers we can work with, from something custom built to run off of a cell phone or other mobile device, to something a little more standard like an Internet Information Server (IIS) which is run on Windows servers or Apache which is generally found on *nix servers, but can be found elsewhere.
Note: *nix is short for the various versions of Unix, including Unix, Linux, Iris, AIX, etc.
Let’s look at how a standard web server will run. Now, different modules may be installed on the servers, but how they run is fairly consistent. Most servers support some sort of dynamic language integration. On a Windows server, that is probably a .Net language like C# or VB.Net. Although you can also find PHP, Java, Python, Ruby, and other languages. *nix servers rarely have .Net support, however, they can support almost any other server side language.
The most common application stack out there is the *AMP stack. AMP would be Apache, MySql (for Database support) and PHP.
Note: The generic *, allows for different Operating Systems, kind of like with *nix. The biggest is LAMP, running under Linux, but you can also download MAMP for Macs, and WAMP for Windows servers.
The web server application sits on the server, listening for network communication. By default it looks on network port 80, although this can be overwritten. Once data is routed to it, the server will check the HTTP request headers.
HTTP, or HyperText Transfer Protocol, is a simple protocol that works off of a series of request and response messages. When you request a file from a web server, it looks at the URL being requested, as well as other data inside of the request.
One of the items checked is the hostname. A web server can serve multiple different websites at once. Whenever you see hosting for just a few dollars a month, this is how they do it – hundreds, if not thousands, of websites reside on this single server, each with their own domain name. The web server application looks at the host name to determine which website to send the request to and get the file from.
For web servers with just a few, or even one, website, this isn’t too difficult. For those with hundreds, it has to switch between requests quickly.
Once the host is determined, the file is selected. This is also found in the request URL. Unfortunately, sometimes a request URL isn’t given. For example, if you go to https://access2learn.com/, which file are you supposed to get?
Default File List
The answer comes from the default file list. The web server software knows that if a file isn’t listed, it can do one of two things. First is to check the default file list, this is a list of files it looks for to determine if a file should be sent to the end user, when none is created. While this list can be modified to hold anything it wants, typically it includes things like index.htm, default.htm, home.htm, and all of their .html equivalents, as well as other file names and dynamic extensions potentially. If a file on that list is found, then the file is displayed.
Now, what happens if multiple files on the list are found? The server looks at the list, and starts at the first item. Once a match is made, the server stops looking, and displays that file.
But what happens if that no file from the list exist in the folder? In that case it depends upon the server. In some cases it is configured to show a list of files in the folder. In other cases, it will show an error message that the user doesn’t have access to the file.
As you might be able to tell, this means that the web server application is responsible for performing at least some level of security on the server and what data it transmits. Depending upon the server, the methods used will vary, from a .htaccess file under Apache, to Windows Permission settings, and IIS settings under IIS.
Once the server has determined the file to transmit, it will allow it to be sent to the requesting client, assuming the permissions are correct and the file exists. At this point, the server doesn’t do anything else, until another request is sent to it.
This is part of what makes the HTTP server so simple, is it doesn’t do anything that isn’t requested of it, and basically is a file handling processor. The browser will need to request the next file(s) to download, and the process will start all over again.
The Role of the Web Server was originally found on Access 2 Learn