How to List All Enabled Modules in Apache?

This guide provides a quick and direct overview of how to check which modules are currently enabled in your Apache web server. Whether you are troubleshooting a server configuration, verifying a new installation, or conducting a security audit, knowing how to list active modules is an essential skill for server administration. Depending on your operating system—whether you are using a Debian-based system like Ubuntu or a Red Hat-based system like CentOS—Apache offers built-in command-line tools to display this information instantly.

Using the Apache Control Command (apachectl)

The most universal method to list enabled Apache modules across almost all Linux distributions is using the apachectl command. This tool acts as a front-end to the Apache HTTP server engine.

To see all loaded modules, open your terminal and run the following command:

apachectl -M

Alternatively, you can use the apache2ctl command on Debian and Ubuntu systems:

apache2ctl -M

Both commands will output a complete list of all loaded modules, categorized into static modules (compiled directly into the binary) and shared modules (loaded dynamically via configuration files).

Using the HTTPD Command

On Red Hat Enterprise Linux (RHEL), CentOS, Fedora, and Rocky Linux, the Apache service is known as httpd. You can query the binary directly to list the enabled modules.

Run the following command in your terminal:

httpd -M

If you need to check for a specific module within a long list, you can pipe the output into the grep command. For example, to check if the rewrite module is active, use:

httpd -M | grep rewrite

Checking via Debian/Ubuntu Configuration Files

On Debian-based systems, Apache manages modules using a symlink system. Enabled modules are stored as symbolic links in a specific directory. You can list the contents of this directory to see what is currently active without running the Apache binary.

Run the following command to view the enabled modules directory:

ls -l /etc/apache2/mods-enabled/

Every .load file present in this directory represents an Apache module that is currently active and will be loaded the next time the web server restarts.