How Apache works

2 min read

Architecture

Apache consists of a kernel and a dynamic module system. The system parameters are changed through configuration files.

Kernel

The Apache kernel is developed by the Apache Software Foundation in C. The main functions are handling configuration files, the HTTP/HTTPS protocol and module loading. The kernel may run without modules, but will have limited functionality.

Modular system

A module is a separate file, the connection of which extends the original functionality of the kernel. They can be included in the software during the initial installation or loaded later by changing the configuration file.

Most of them are responsible for some aspect of client request processing – support for different programming languages, security, caching, authentication, etc. Thus, a large task is broken up into several phases, each of which is handled by a separate, highly specialized module.

For Apache, there are more than 500 modules. Many popular web applications are also available as modules for Apache. Examples include ISPmanager and VDSmanager.

Apache Configuration

The Apache configuration system is based on text files with prescribed settings. It is divided into three levels, each of which has its own configuration file:

The server configuration level (httpd.conf file) is the main configuration file. It applies to the entire web server mechanism.

Directory level (.htaccess file) – additional configuration file. Its directives cover only the directory where the file is located, as well as subdirectories.
Virtual host level (httpd.conf> or extra/httpd-vhosts.conf file).
Normally, Apache configuration files are in the “conf” folder, and additional configuration files in the subfolder “extra”. You can make changes either by editing the file itself or by using the command line.

Virtual hosts

A web host is a server component responsible for serving a single object placed on it (a website, a virtual server). The Apache virtual host system allows you to run several projects from the same IP address at the same time.

In Apache you can set module and kernel settings, and set limits on server resource consumption (traffic, RAM, CPU) for each virtual host individually. This is the technological basis of the entire web hosting mechanism.

You May Also Like

More From Author