The Apache HTTP Server is the world’s most widely used web server software. Apache is developed and maintained by an Open community of Apache Software Foundation. Apache is free and open-source software and it is available for a wide variety of operating systems, including Unix, Linux, Microsoft Windows, OS X, OS/2, Solaris, TPF, OpenVMS, NetWare, FreeBSD, and eComStation.
Developers need some additional modules to be installed/enabled based on project requirements. Apache provides the easiest way to enable and disable apache modules by using simple commands.
Note: These commands are only accessible for Sudo privilege users
Enabling apache module:
sudo a2enmod [module name]
a2enmod is an inbuilt script that enables the given module in an apache configuration file by creating symlinks.
a2enmod: enable/disable an apache module in APACHE_MODULES in /etc/sysconfig/apache2
usage: a2enmod [-d] module
a2enmod -l list modules
a2enmod -q module query if module is installed
HTTPD_INSTANCE=<instance_name> environment variable can be used to specify apache instance
Disabling apache module:
sudo a2dismod [module name]
a2dismod is an inbuilt script that disables the given module from an apache configuration file by removing symlinks.
a2dismod: enable/disable an apache module in APACHE_MODULES in /etc/sysconfig/apache2
usage: a2dismod [-d] module
a2dismod -l list modules
a2dismod -q module query if module is installed
HTTPD_INSTANCE=<instance_name> environment variable can be used to specify apache instance
After enabling or disabling apache modules you should reload your apache to initialize given changes in the server.
Example:
To enable ‘SSL module
sudo a2enmod ssl
To disable ‘SSL modules
sudo a2dismod ssl
Comments