You can remove certain Apache modules from loading simply by editing httpd.conf
and commenting out the unwanted modules starting with the LoadModule
directive, and then restarting Apache.
Some common modules to disable that are rarely used, include:
CentOS ships with a lot of features enabled by default that are probably not necessary.
Apache will show the server documentation by default at the /manual
URL of the server. You can remove this simply by deleting the manual.conf
file and restarting apache.
rm -fv /etc/httpd/conf.d/manual.conf /etc/init.d/httpd restart
Proxy module for AJP backend servers (such as Tomcat). The module is loaded by default.
rm -fv /etc/httpd/conf.d/proxy_ajp.conf /etc/init.d/httpd restart
Mod_perl incorporates a Perl interpreter into the Apache web server, so that the Apache web server can directly execute Perl code.
rm -fv /etc/httpd/conf.d/perl.conf /etc/init.d/httpd restart
Mod_python is a module that embeds the Python language interpreter within the server, allowing Apache handlers to be written in Python.
rm -fv /etc/httpd/conf.d/python.conf /etc/init.d/httpd restart
Squid is installed by default, and you can remove the package from CentOS directly, or just remove the configuration file.
yum -y remove squid /etc/init.d/httpd restart
Uninstalling squid will remove the squid.conf as well. Or you can do it manually. Either way, be sure to restart the web server.
rm -fv /etc/httpd/conf.d/squid.conf /etc/init.d/httpd restart
Webalizer is also installed by default, and you can remove the package from CentOS directly, or just remove the configuration file.
yum -y remove webalizer /etc/init.d/httpd restart
Uninstalling squid will remove the webalizer.conf as well. Or you can do it manually. Either way, be sure to restart the web server.
rm -fv /etc/httpd/conf.d/webalizer.conf /etc/init.d/httpd restart