Chapter 4. Working with Apache modules


The httpd service is a modular application, and you can extend it with several Dynamic Shared Objects (DSO). You can dynamically load or unload DSO modules at runtime as necessary. You can find these modules in the /usr/lib64/httpd/modules/ directory.

4.1. Loading a dynamic shared object module

To configure the functionality for the Apache HTTP Server, you can load Dynamic Shared Object (DSO) modules. You need to use the LoadModule directive to load a particular DSO module. A separate package has modules with their own configuration file stored in the /etc/httpd/conf.modules.d/ directory.

Prerequisites

  • You have installed the httpd package.

Procedure

  1. Search for the module name in the configuration files in the /etc/httpd/conf.modules.d/ directory:

    # grep mod_ssl.so /etc/httpd/conf.modules.d/*
    Copy to Clipboard Toggle word wrap
  2. Uncomment the LoadModule directive of the module in the configuration file where the module name is present:

    LoadModule ssl_module modules/mod_ssl.so
    Copy to Clipboard Toggle word wrap
  3. If the module was not found, for example, because a Red Hat Enterprise Linux (RHEL) package does not include the module, create a configuration file, such as /etc/httpd/conf.modules.d/30-example.conf with the following directive:

    LoadModule ssl_module modules/<custom_module>.so
    Copy to Clipboard Toggle word wrap
  4. Restart the httpd service:

    # systemctl restart httpd
    Copy to Clipboard Toggle word wrap

Verification

  • Verify that the module is loaded and enabled:

    # httpd -M | grep ssl
    Copy to Clipboard Toggle word wrap

4.2. Compiling a custom Apache module

You can create your own module and build it by using the httpd-devel package, which has the include files, the header files, and the Apache Extension (apxs) utility required to compile a module.

Prerequisites

  • You have the httpd-devel package installed.

Procedure

  • Build a custom module:

    # apxs -i -a -c module_name.c
    Copy to Clipboard Toggle word wrap

Verification

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top