Apache has a lot of modules (or “mods”) that extend its core functionality for special purposes.
How to list installed Apache modules – is a common question as it is very often required to check which Apache modules are loaded/enabled.
List of installed Apache modules can be found using special option for
httpd/apachectl (CentOS, RHEL etc.) or
apache2/apache2ctl (Ubuntu, Debian etc.) commands.
Cool Tip: Would you like to know how to list all Apache virtual hosts (VHosts)? Really simple! Read more →
-M option lists all loaded/enabled static (statically compiled into the httpd binary) and shared (compiled as dynamic shared objects that exist separately from the main httpd binary) Apache modules.
List Enabled Modules in HTTPD
Get a list of all loaded/enabled modules in HTTPD on
$ httpd -M $ apachectl -M
List Loaded Modules in Apache2
Get a list of all loaded/enabled modules in Apache2 on
$ apache2 -M $ apache2ctl -MIn the output of the above commands you’ll see all currently loaded/enabled Apache modules.
In the brackets will be shown whatever each Apache module is static or shared (see explanation of each above).
As a pleasant bonus you will also get a syntax check of the all Apache configuration files.
Loaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) auth_basic_module (shared) cgi_module (shared) version_module (shared) wsgi_module (shared) Syntax OK
It was really simple, wasn’t it?