a2enmod
Enable Apache modules
TLDR
Enable a module
Don't show informative messages
SYNOPSIS
a2enmod [-q] module [module ...]
PARAMETERS
-q
Suppress informative status messages (quiet mode)
DESCRIPTION
a2enmod is a shell script designed for Debian-based Linux distributions (like Ubuntu) to simplify enabling Apache2 HTTP server modules. It creates symbolic links in the /etc/apache2/mods-enabled/ directory pointing to the corresponding module files in /etc/apache2/mods-available/. This modular approach allows easy enabling/disabling of features like rewrite rules, SSL, or CGI without altering core config files.
Typically invoked with sudo, it verifies the module's existence before linking. If already enabled, it notifies but does not error out unless other issues arise. Multiple modules can be specified at once, e.g., sudo a2enmod rewrite ssl. Post-enabling, Apache must be reloaded (systemctl reload apache2) for changes to take effect.
This tool is part of Apache2's Debian packaging, promoting configuration management best practices. It integrates with apache2-maintscript-helper for version handling during upgrades, preventing symlink breakage.
CAVEATS
Requires root privileges (use sudo). Limited to Debian-packaged Apache2; not available on RPM-based systems. Does not auto-reload Apache or handle custom module paths. Fails if module absent from mods-available.
KEY DIRECTORIES
/etc/apache2/mods-available/: Module .load/.conf files.
/etc/apache2/mods-enabled/: Active symlinks loaded by Apache.
EXIT STATUS
0: Enabled successfully.
1: No modules specified.
2: Already enabled.
3: Module does not exist.
Other: Errors (e.g., permissions).
HISTORY
Developed for Debian's Apache2 package in early 2000s (circa 2004) alongside the mods-available/enabled directory structure, replacing manual symlink management. Evolved with Apache2 transitions and systemd integration.
SEE ALSO
a2dismod(8), a2ensite(8), a2dissite(8), apache2ctl(8)


