apache tutorial - Disabling unnecessary modules in Apache - apache - apache web server - apache server - apache2




How to Disable Unnecessary Apache Modules ?

  • Apache HTTP Server is a robust choice for a web server because it is modular.
  • You can possibly add an unlimited number of modules to Apache to extend functionality, security, or added features.
  • Furthermore, many Linux distributions include numerous Apache modules by default. In some cases you might not even use them.
  • Modules that are not needed just make loading times longer and can occupy your dedicated server resources that you could otherwise divert elsewhere. Fortunately, disabling modules is not difficult.
  • Debian-based systems come with two useful scripts for enabling or disabling server modules.
    • a2enmod enables modules in apache2 by creating symlinks with /etc/apache2/mods-enabled
    • a2dismod disables the modules by removing the symlinks.
  • To disable a module called “mod_serverschool”, enter as root:
a2dismod mod_serverschool
  • To re-enable the module, type:
a2enmod mod_serverschool
  • In Red Hat Enterprise Linux (RHEL), CentOS, and other derivatives, you must edit the configuration file in /etc/httpd/conf.d/.
  • Each module’s conf file will be stored there.
  • Therefore, if you do not need the mod_serverschool module, you would rename “serverschool.conf” to “serverschool.bak” and then restart Apache:
mv serverschool.conf serverschool.bak
service httpd restart
  • To re-enable the module, rename the .bak file back to .conf:
mv serverschool.bak serverschool.conf
service httpd restart


Related Searches to Disabling unnecessary modules in Apache