Use Sophia to knock out your gen-ed requirements quickly and affordably. Learn more
×

Web Servers

Author: Sophia

what's covered
In this lesson, you will learn what a web server is and its different critical functions. You will also learn about the factors that need to be considered when choosing an operating system platform for a web development project. Furthermore, you will be introduced to various low-cost, but effective collections of software that can be used to develop and deploy websites and web applications.

Specifically, this lesson will cover the following:

Table of Contents

1. Web Servers

Web servers are an important component of the World Wide Web. As you learned previously, a web server is a combination of software and hardware that performs the basic operations needed to host resources and sites on the web.

watch

View this video to learn more about the client and server in the transport layer.

Server hardware is made up of a typical or server-grade computer system and operating system. The web server itself, circled in the top left corner of the image below, is software that runs on top of the operating system and uses the computer’s file system, processor, and network card to fulfill its responsibilities. The following diagram represents the basic elements of a web server.

A diagram that shows hardware, an operating system, and an HTTP server comprising the bare necessities. The addition of a database and scripting language extends a server’s capabilities, and they are utilized in most servers as well.

There are lots of web server products to choose from, whether you are looking for specific application uses, low-cost, or a fully customizable solution, there are ideal options available.

  • Apache is a free, open-source web server that was originally designed for Linux systems but is now available for Windows and a variety of Linux-based systems.
  • Apache TomCat is not just a web server but is actually a Java-based application server that can host websites as well as web applications.
  • Microsoft IIS, or Microsoft Internet Information Service (IIS), is Microsoft’s web server product that runs primarily on Windows operating systems.
  • NGINX (pronounced “Engine-X”) is another free, open-source web server that is considered high-performance.
  • Node itself is a framework that is built around JavaScript and can be used to write web applications that can run on Microsoft IIS and even Apache. However, Node also allows developers to write their own web server to host Node applications.
These are just a few of the popular web servers available today. There are many more options available, many of which are paid products that offer unique and specialized features and capabilities designed for specific use cases.

terms to know

Apache Web Server
A free and open-source web server software application that is available for a wide range of operating systems. Also called Apache.

Apache TomCat
A Java-based application server that can host websites as well as web applications. Also called TomCat.

Microsoft Internet Information Service (IIS)
Microsoft’s web server product that runs primarily on Windows operating systems. Also called Microsoft IIS.

NGINX
A free, open-source, high-performance web server. Pronounced “Engine-X”.

Node
An open-source server platform that operates on a wide range of operating systems and provides a platform for building general and special-purpose web servers.


2. Functions of a Web Server

Web servers are the foundation of the World Wide Web and perform a number of functions needed to host sites and resources on the Internet. The basic functions of a web server include:

Server Function Description
Listen for HTTP(S) requests Web servers use the network interface card to listen for HTTP-based requests. The server examines the request to determine how it should respond.

Serve pages and resources from a designated directory Site pages, server scripts, and other resources are hosted within directories within the server’s secondary storage. The web server is configured to search through these target directories in order to find a resource being requested.
Manage server-side scripting and dynamic content Since web servers need to handle more than just HTML, such as plain text, CSS, images, etc., the server needs to know what it is in order to process and handle that type of data. Multipurpose Internet Mail Extensions (MIME) types are designations for different types of resources and are used by the web server to determine how to serve the requested resource. Furthermore, requests for scripts and pages that contain dynamic content need to be processed by the proper scripting engine prior to being sent to the client. The server receives the request, examines the requested file’s extension, and then hands the resource off to the configured scripting engine for processing.
Handle file uploads and downloads Web servers also host computer files for download and can be configured to accept files from a client through the website or web app and store them in a specified location on the server.
Manage user sessions and authentication Web servers also provide mechanisms for creating and managing user-authenticated sessions, access controls, and user management.
Configuration management Web servers provide configuration mechanisms for the server, sites, and even specific site directories. The server itself provides configuration options for how the server should behave and respond to client requests. Furthermore, specific sites and even sub-directories hosted on the server can contain their own unique configurations. These site and directory-specific configuration files are often stored in a text-based file in the directory that it applies to.
Logging and monitoring Web servers are also responsible for logging activities and requested operations. Whether used for performance management, security, or troubleshooting, web servers offer a comprehensive logging system that can track any number of aspects. Incoming requests, response codes, client IP addresses, timestamps, error messages, etc., can all be logged by the server and used by administrators for a variety of purposes.

terms to know

Secondary Storage
Data storage within a computer system that is persistent and non-volatile and is used to store programs and files.

Multipurpose Internet Mail Extensions (MIME)
MIME types are used to associate different types of files and resources to their appropriate extension, which in turn informs the web server how to handle the resource.

Scripting Engine
The collection of code and logic that resides on a server and processes code to create, manipulate, access, and format content for a webpage.


3. Operating Systems Considerations for Web Servers

Any computer equipped with a network card and just about any modern operating system can serve as a web server and will work in most use cases. However, in order to ensure that a website performs properly, several factors need to be considered when making the choice of which operating system and web server will be used to host the site. Compatibility, performance, security, and cost are some of the factors that may influence the decision.

  1. Compatibility is a major factor in the decision-making process. If a site contains any code that was programmed using the ASP.NET framework, then the web server will need to be a Windows system running the Internet Information Service (IIS) web server. ASP.NET is a proprietary framework that belongs to Microsoft and requires the use of IIS.
  2. Performance could always be a concern, but in cases where a site contains web applications and undergoes heavy utilization, there is a higher emphasis placed on minimizing processing overhead and improving stability. Linux operating systems have a proven track record of stability and efficiency, as well as the ability to reliably handle high processing loads which would make it a suitable choice.
  3. Security certainly plays a part in the decision-making process. This is especially true in situations where a site accepts and stores sensitive user information. While all operating systems employ security, some have a good track record and have a reputation for prioritizing security. One example is the Kodachi distribution of Linux which comes loaded with lots of security features and tools (Sharma, 2023).
  4. Another important consideration is cost. Budgetary constraints will certainly influence the choice of software implementations including the operating system, web server, and database. In such cases, open-source software products may be the ideal approach. In fact, there are different sets of open-source software options, each called a software stack, that can be used to implement together to provide a low-cost, extensible solution for deploying a web server. Each option provides its own unique characteristics and benefits and lends itself to an existing familiarity with different development frameworks.
terms to know

Framework
Software packages that are used to improve the speed and efficiency of building software applications.

Open-Source Software
Software wherein the developer has made the original source code available to the community for modification and extension.

Software Stack
A collection of software products that facilitate the development of different software such as websites, web applications, and regular applications.

3a. LAMP (Linux, Apache, MongoDB, PHP)

LAMP is the first, and one of the oldest, stacks. It includes Linux as the operating system, Apache as the web server, MongoDB as the database server, and PHP as the server-side scripting language.

The Linux operating system is open-source, often free, and comes in a variety of distributions, each distribution is modified and equipped for specific uses.

key concept

Open-source software, often incorrectly misinterpreted as free, simply means that the producer of the software product has released the software’s original source code to the community and has permitted the community to modify or extend the original code and functionality. This is important as users and developers are free to completely customize the original software to meet their specific needs.

The Apache web server is a free, open-source web server that can operate on a variety of operating systems. Being one of the older web servers around, Apache is not only reliable but is compatible with most of the popular server-side scripting languages.

MongoDB is a source-available database storage solution that provides more flexibility in how it stores information. Unlike other database solutions, MongoDB is considered a NoSQL or non-relational, document-based storage solution that provides better support and performance for web-based applications. MongoDB is a good example of open-source software that is not considered free, although it does provide a free “community” edition.

The last component of the LAMP stack is the Hypertext Preprocessor (PHP) scripting language. PHP is a free, server-side scripting language and library that provides programming features and access to server resources. Typically PHP is embedded within HTML code to create dynamic content and access databases to provide real-time, and up-to-date data. PHP can also be located within stand-alone script files in order to serve as an API (Application Programming Interface), which acts as a translator of data between separate software products.

key concept

Together, the LAMP stack provides a robust, powerful, flexible, and low-cost solution for hosting websites and web applications. The LAMP stack is centered around two coding languages, PHP and JavaScript which do require those skill sets.

Next, let’s take a look at the composition of some more recent stacks, MEAN and MERN.

terms to know

LAMP Stack
A combination of software that includes Linux, Apache, MongoDB, and PHP that offers a low-cost solution for developing and hosting websites and web applications.

Linux Operating System
Linux is a popular family of open-source computer operating systems that was first released in 1991.

MongoDB
A source-available, document-oriented database software application that is available for a wide range of operating systems.

NoSQL
A database storage method that can support different styles of data storage in addition to that standard relational database.

Hypertext Preprocessor (PHP)
A general purpose, server-side scripting language that is primarily used for web development.

Application Programming Interface (API)
Any software that facilitates the transmission of data between different systems that would otherwise be incompatible.

3b. MEAN (MongoDB, Express, Angular, Node)

Similar to LAMP, the MEAN stack also utilizes the MongoDB solution. The key difference is that MEAN removes the need for PHP and replaces it with Node, Express, and Angular, all of which are based on JavaScript. Node provides a powerful framework for the JavaScript language that not only enables the use of JavaScript outside of a web browser but also provides the ability to easily program your own web server. Express is an add-on package for Node that makes it even easier to program a web server by greatly simplifying the code.

Angular is a framework for designing interactive, flexible, and professional website and web application interfaces, also referred to as client-side scripting. Angular is based on an expanded version of JavaScript called TypeScript and is primarily used for designing reusable “components” that represent pre-built webpage elements.

terms to know

MongoDB, Express, Angular, Node (MEAN) Stack
An alternative combination of software from LAMP that includes MongoDB, Express, Angular, and Node, which offers a low-cost solution for developing and hosting websites and web applications.

Angular
A free, open-source framework designed for developing single-page applications and is based on the TypeScript language.

TypeScript
An extension of JavaScript that provides enforcement of explicit data typing of variables and objects.

3c. MERN (MongoDB, Express, React, Node)

Finally, the MERN stack resembles the MEAN stack, but uses a different framework for building the site or application interface by replacing Angular with React. React, originally designed by Facebook (now known as Meta), works similarly to Angular in that a developer creates flexible, customizable, and reusable “components” that represent the different elements of a webpage or application interface.

EXAMPLE

A React component can be developed to produce a site’s navigation menu, and the same component can be updated with the user’s current location on the site each time it is rendered. The navigation component’s code would then update the navigation menu’s format to provide an indication of the user’s current location.

Much of the inner workings of React and Angular, however, are different and offer their own benefits and drawbacks. Angular is an entire framework of components, libraries, and native features that provide a robust environment for creating enterprise-grade applications. In comparison, React focuses on performance and render optimization. React by itself is rather lightweight in comparison and only when additional capabilities and resources are needed are they added into the React system. Additional features, capabilities, and libraries can easily be imported from one of the world's largest public software repositories called npm.

big idea

Given the variety of choices available to developers and their potential impact on a web project’s overall success, it is important to understand and consider the different factors when planning the approach to the project. From the developer’s perspective, utilizing fewer technologies and coding languages and taking advantage of effective frameworks makes managing web projects less complex. From the organization’s perspective, understanding the direction and overall goals of a web project helps to determine the ideal technology platform for the project.

terms to know

MongoDB, Express, React, Node (MERN) Stack
A combination of software that includes MongoDB, Express, React, and Node that offers a low-cost solution for developing and hosting websites and web applications.

React
A free and open-source JavaScript library designed for developing single page applications.

Node Package Manager (npm)
A command line utility that allows developers to easily search for and install software packages from the world's largest repository of software.

summary
In this lesson, you learned what a web server is and about its basic functions. You were also introduced to various Operating System Considerations for Web Servers such as compatibility, performance, security, and cost. You were also introduced to several software stacks for web development and deployment including LAMP, MEAN, and MERN, all of which can provide low-cost solutions that are powerful as well as flexible.

Source: This Tutorial has been adapted from "The Missing Link: An Introduction to Web Development and Programming " by Michael Mendez. Access for free at https://open.umn.edu/opentextbooks/textbooks/the-missing-link-an-introduction-to-web-development-and-programming. License: Creative Commons attribution: CC BY-NC-SA.

Terms to Know
Angular

A free, open-source framework designed for developing single page applications and is based on the Type-Script language.

Apache TomCat

A Java-based application server that can host websites as well as web applications. Also called TomCat.

Apache Web Server

A free and open-source web server software application that is available for a wide range of operating systems. Also called Apache.

Application Programming Interface (API)

Any software that facilitates the transmission of data between different systems that would otherwise be incompatible.

Framework

Software packages that are used to improve the speed and efficiency of building software applications.

Hypertext Preprocessor (PHP)

A general purpose, server-side scripting language that is primarily used for web development.

LAMP Stack

A combination of software that includes Linux, Apache, MongoDB, and PHP, which offers a low-cost solution for developing and hosting websites and web applications.

Linux Operating System

Linux is a popular family of open-source computer operating systems that was first released in 1991.

Microsoft Internet Information Service (IIS)

Microsoft’s web server product that runs primarily on Windows operating systems. Also called Microsoft IIS.

MongoDB

A source-available, document-oriented database software application that is available for a wide range of operating systems.

MongoDB, Express, Angular, Node (MEAN) Stack

An alternative combination of software from LAMP that includes MongoDB, Express, Angular, and Node, which offers a low-cost solution for developing and hosting websites and web applications.

MongoDB, Express, React, Node (MERN) Stack

A combination of software that includes MongoDB, Express, React, and Node, which offers a low-cost solution for developing and hosting websites and web applications.

Multipurpose Internet Mail Extensions (MIME)

MIME types are used to associate different types of files and resources to their appropriate extension, that in turn informs the web server how to handle the resource.

NGINX

A free, open-source, high-performance web server. Pronounced “Engine-X”.

NoSQL

A database storage method that can support different styles of data storage in addition to that standard relational database.

Node

An open-source server platform that operates on a wide range of operating systems and provides a platform for building general and special-purpose web servers.

Node Package Manager (npm)

A command line utility that allows developers to easily search for and install software packages from the world's largest repository of software.

Open-Source Software

Software wherein the developer has made the original source code available to the community for modification and extension.

React

A free and open-source JavaScript library designed for developing single page applications.

Scripting Engine

The collection of code and logic that resides on a server and processes code to create, manipulate, access, and format content for a webpage.

Secondary Storage

Data storage within a computer system that is persistent and non-volatile and is used to store programs and files.

Software Stack

A collection of software products that facilitate the development of different software such as websites, web applications, and regular applications.

TypeScript

An extension of JavaScript that provides enforcement of explicit data typing of variables and objects.