What is a Web Server Module?

Web ServerMost popular Web servers are modular pieces of software, which means they can be customized by loading the Web server module for a particular function. Most people use Apache with Linux or Windows, and both Apache and Linux are modular components of a server stack. By default in Apache and most Linux distributions, the most common modules are compiled into the kernel or server and included in one or several configuration files so that they’re loaded automatically.

Understanding the Configuration File

Although Apache comes with a fairly standard configuration file that works pretty well for most people out of the box, it still may need to be edited to load some modules, such as Python 3 or PHP. Most users won’t ever need to delve deeper into Apache’s httpd.conf file than the pre-compiled modules that are commented out by default, but Web developers often want or need to compile third-party modules and include them in the LoadModule list. These modules enable certain functionality that makes websites run faster or makes programming more convenient, such as FastCGI for executing Common Gateway Interface scripts and Mod POP3 for adding email functionality.

To enable modules that have already been compiled into the server, users just need to uncomment the include line in the configuration file and restart the server. Uncommenting a line means to delete the “#” character at the beginning of the line that tells the software to ignore the line when it sources the configuration file. To restart Apache from the command line, simply type “httpd restart,” “systemctl httpd restart” or the appropriate command for your operating system. Some Linux distributions come with an Apache configuration tool that provides a graphical user interface for compiling and loading modules and starting and stopping Apache. If you use one of these programs, it’s important to never manually compile and install modules, because the installation will get out of sync with the configuration tool.

A Modular Server Stack

In Web development, modular programming is a common theme, and many components of a Web server stack are often modular. For example, Python includes the package manager Pip, which allows developers to install modules or collections of modules, called packages, from the command line. Ruby has a similar package manager called RubyGems that lets programmers add third-party modules to their projects through the community-generated repository of packages called Gems. Developers who want to compile and install new Apache modules can visit the Apache website to browse the collection of httpd modules that are available for free under the GNU General Public License.

Server and operating system modules provide low-level functionality that isn’t built into the system by default. Although a computer’s hardware may be capable of certain functions, such as network access or accelerated graphics, it needs low-level software to give applications an interface for accessing these functions. In Windows, these modules are called drivers, and without the appropriate drivers, users can’t send jobs to the printer or play games that render graphics on the video processor.

Related Resource: Ruby on Rails

The Web is the most important medium of information in the 21st century, and learning the basics of Web design is a smart decision for anyone who wants to start a blog or online business. If you need to load a particular Web server module, it’s usually just a matter of uncommenting the include line and restarting the server.