mods-enabled directory

The /etc/apache2/mods-enabled directory holds symlinks to the files in /etc/apache2/mods-available. When a module configuration file is symlinked, it will be enabled the next time Apache is restarted.

Installing a module makes it available to your server, but does not automatically activate the module in your Apache server. To activate the module, the a2enmod command is used. To disable a module, the a2dismod command is used. These commands work by adding or removing links for available modules in the /etc/apache2/mods-enabled directory.

Here is an example. Let’s install a new module for our web server (the MySQL Authentication module). We can do this using the sudo apt-get install libapache2-mod-auth-mysql command:

apache install new module

We can use the a2enmod command to enable the module:

apache enable module

Notice how the symlink to the auth_mysql module was created inside the mods-enabled directory.

Geek University 2022