↑ ↓ select, Enter open, Esc close

Disable an Apache module and reload the configuration

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
root@server
a2dismod autoindex && apache2ctl configtest && systemctl reload apache2

Removes the module’s symlinks from /etc/apache2/mods-enabled/ and reloads Apache, provided the configuration test still passes afterwards. Useful for slimming down or hardening, for example turning off autoindex (directory listings). If the test fails, some configuration still uses directives from the module.

Note: For dependent or essential modules, a2dismod asks interactively. a2enmod with the same name reverts it.

Also searched as

  • disable apache module
  • a2dismod autoindex
  • remove unused apache modules
  • disable mod_status apache

Related one-liners

All in Apache

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.