Apache
is a modular system in a sense that its functionality could be extended by using modules. A module could be installed into the system and Apache
would then be configured to load the module during its startup.
Some of the mostly used modules are PHP
and SSL
which is to enable support for hosting PHP
applications and provide encrypted web traffic respectively.
Apache
modules could be enabled and disabled where and when required.
Apache
module if not not already installed.$ 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
Apache
configuration file using the LoadModule
directive. LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
Ubuntu
and other Debian
derivatives along with openSUSE
and SLES
has a2enmod
utility installed and could be used to easily load Apache
modules without having to manually configure the LoadModule
directive.$ 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 |
Apache
service for the modules to be loaded. $ 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
directive or comment out the line by adding #
at the beginning to disable loading the module. #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
Apache
service for the modules to be unloaded.Guide compatibility:
Operating System |
---|
Ubuntu 16.04 LTS (Xenial Xerus) |
Ubuntu 16.10 (Yakkety Yak) |
Ubuntu 17.04 (Zesty Zapus) |
Ubuntu 17.10 (Artful Aardvark) |
Ubuntu 18.04 LTS (Bionic Beaver) |
Ubuntu 18.10 (Cosmic Cuttlefish) |
Ubuntu 19.04 (Disco Dingo) |
Comment anonymously. Login not required.