Apache is a modular system where its modules extend the functionality of the main program. A module could be installed into the system, and Apache would then be configured to load and use the module during its startup.
Some of the most used Apache modules, for example, are PHP and SSL. They enable the hosting of PHP applications and provide encrypted web traffic.
Apache modules could be enabled using the LoadModule directive in the configuration files.
Related: How to install Apache modules
$ apachectl -t -D DUMP_MODULES Loaded Modules: core_module (static) so_module (static) watchdog_module (static) http_module (static) log_config_module (static) logio_module (static) version_module (static) unixd_module (static) access_compat_module (shared) alias_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) filter_module (shared) mime_module (shared) mpm_event_module (shared) negotiation_module (shared) reqtimeout_module (shared) setenvif_module (shared) socache_shmcb_module (shared) status_module (shared)
You can also use the -M option instead which is just a shortcut to the above command.
$ apachectl -M
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
$ sudo a2enmod ssl [sudo] password for user: Considering dependency setenvif for ssl: Module setenvif already enabled Considering dependency mime for ssl: Module mime already enabled Considering dependency socache_shmcb for ssl: Module socache_shmcb already enabled Enabling module ssl. See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates. To activate the new configuration, you need to run: systemctl restart apache2
Options | Debian, Ubuntu | openSUSE and SLES | Fedora Core, CentOS, RHEL | macOS | homebrew | xampp |
---|---|---|---|---|---|---|
a2enmod support | yes | yes | no | no | no | no |
Loadmodule directive | n/a | LoadModule <module_name>_module <module_location>/mod_<module_name>.so |
Related: How to manage Apache service
$ apachectl -M Loaded Modules: core_module (static) so_module (static) watchdog_module (static) http_module (static) log_config_module (static) logio_module (static) version_module (static) unixd_module (static) access_compat_module (shared) alias_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) filter_module (shared) mime_module (shared) mpm_event_module (shared) negotiation_module (shared) reqtimeout_module (shared) setenvif_module (shared) socache_shmcb_module (shared) ssl_module (shared) status_module (shared)
#LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
Users of Ubuntu and other Debian derivatives along with openSUSE and SLES can use a2dismod utility to disable Apache modules.
$ sudo a2dismod ssl [sudo] password for user: Module ssl disabled. To activate the new configuration, you need to run: systemctl restart apache2
Comment anonymously. Login not required.