a2dismod is a command used to disable an Apache2 module in Ubuntu. Apache is a popular web server software that is often used to host websites on Linux servers. The a2dismod command is used to disable a specific Apache2 module. For example, if you wanted to disable the mod_rewrite module, you would run the command:
$ sudo a2dismod rewrite
This would disable the mod_rewrite module and prevent it from being loaded when Apache starts. To enable a disabled Apache2 module, you can use the a2enmod command. For example, to enable the mod_rewrite module, you would run:
$ sudo a2enmod rewrite
Keep in mind that you will need to restart Apache for the changes to take effect. You can do this by running the following command:
$ sudo service apache2 restart
If you encounter the below error while running the a2dismod command:
a2dismod: command not found
you may try installing the below package as per your choice of distribution:
OS Distribution | Command |
---|---|
Debian | apt-get install apache2 |
Ubuntu | apt-get install apache2 |
Alpine | apk add apache2 |
Kali Linux | apt-get install apache2 |
Raspbian | apt-get install apache2 |
a2dismod Command Examples
1. Disable a module:
$ sudo a2dismod {{module}}
2. Don’t show informative messages:
$ sudo a2dismod --quiet {{module}}