Differences
This shows you the differences between two versions of the page.
centos_apache_optimization [2011/10/13 15:28] |
centos_apache_optimization [2011/10/13 15:28] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== CentOS: Apache Optimization ====== | ||
+ | |||
+ | * [[Apache]] | ||
+ | * [[Apache Tuning]] | ||
+ | * [[CentOS]] | ||
+ | * [[CentOS Apache]] | ||
+ | |||
+ | ==== Modules ==== | ||
+ | |||
+ | 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: | ||
+ | |||
+ | * mod_autn_anon | ||
+ | * mod_authn_dbm | ||
+ | * mod_authz_owner | ||
+ | * mod_authz_groupfile | ||
+ | * mod_authz_dbm | ||
+ | * mod_ldap | ||
+ | * mod_authnz_ldap | ||
+ | * mod_usertrack | ||
+ | * mod_dav | ||
+ | * mod_dav_fs | ||
+ | * mod_actions (CGI support) | ||
+ | * mod_speling | ||
+ | * mod_proxy | ||
+ | * mod_proxy_balancer | ||
+ | * mod_proxy_ftp | ||
+ | * mod_proxy_http | ||
+ | * mod_proxy_connect | ||
+ | * mod_cgi (CGI support) | ||
+ | |||
+ | ==== Features ==== | ||
+ | |||
+ | CentOS ships with a lot of features enabled by default that are probably not necessary. | ||
+ | |||
+ | == Documentation Manual == | ||
+ | |||
+ | 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. | ||
+ | |||
+ | <code> | ||
+ | rm -fv /etc/httpd/conf.d/manual.conf | ||
+ | /etc/init.d/httpd restart | ||
+ | </code> | ||
+ | |||
+ | == AJP Proxy == | ||
+ | |||
+ | * [[http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html|mod_proxy_ajp]] | ||
+ | |||
+ | Proxy module for AJP backend servers (such as Tomcat). The module is loaded by default. | ||
+ | |||
+ | <code> | ||
+ | rm -fv /etc/httpd/conf.d/proxy_ajp.conf | ||
+ | /etc/init.d/httpd restart | ||
+ | </code> | ||
+ | |||
+ | == Perl == | ||
+ | |||
+ | Mod_perl incorporates a Perl interpreter into the Apache web server, so that the Apache web server can directly execute Perl code. | ||
+ | |||
+ | <code> | ||
+ | rm -fv /etc/httpd/conf.d/perl.conf | ||
+ | /etc/init.d/httpd restart | ||
+ | </code> | ||
+ | |||
+ | == Python == | ||
+ | |||
+ | Mod_python is a module that embeds the Python language interpreter within the server, allowing Apache handlers to be written in Python. | ||
+ | |||
+ | <code> | ||
+ | rm -fv /etc/httpd/conf.d/python.conf | ||
+ | /etc/init.d/httpd restart | ||
+ | </code> | ||
+ | |||
+ | == Squid == | ||
+ | |||
+ | Squid is installed by default, and you can remove the package from CentOS directly, or just remove the configuration file. | ||
+ | |||
+ | <code> | ||
+ | yum -y remove squid | ||
+ | /etc/init.d/httpd restart | ||
+ | </code> | ||
+ | |||
+ | Uninstalling squid will remove the squid.conf as well. Or you can do it manually. Either way, be sure to restart the web server. | ||
+ | |||
+ | <code> | ||
+ | rm -fv /etc/httpd/conf.d/squid.conf | ||
+ | /etc/init.d/httpd restart | ||
+ | </code> | ||
+ | |||
+ | == Webalizer == | ||
+ | |||
+ | Webalizer is also installed by default, and you can remove the package from CentOS directly, or just remove the configuration file. | ||
+ | |||
+ | <code> | ||
+ | yum -y remove webalizer | ||
+ | /etc/init.d/httpd restart | ||
+ | </code> | ||
+ | |||
+ | Uninstalling squid will remove the webalizer.conf as well. Or you can do it manually. Either way, be sure to restart the web server. | ||
+ | |||
+ | <code> | ||
+ | rm -fv /etc/httpd/conf.d/webalizer.conf | ||
+ | /etc/init.d/httpd restart | ||
+ | </code> | ||