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:
- To re-enable the module, type:
- 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:
- To re-enable the module, rename the .bak file back to .conf: