How to enable apache modules? (a2enmod)

Ubuntu upgrade / update package patch using apt-get install

How to enable apache modules? question is very common among system administrators. You can easily enable necessary apache / apache2 modules by using the linux command “a2enmod”.

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.

Developer need some additional modules to be installed / enabled based on project requirements. Apache provides easiest way to enable and disable apache modules by using simple commands.

Note: These commands only accessible for sudo privilege users

How to enable apache modules? (a2enmod):

sudo a2enmod [module name]

a2enmod is an inbuilt script that enabling the given module in 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

After enabling apache modules you should reload your apache to initialize given changes in the server.

Sample

To enable ‘ssl’ module

sudo a2enmod ssl

You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *