This article briefly introduces several tips for optimizing Apache, which are very useful in actual combat.
Upgrade Apache to the latest version, which often contains performance improvements and security updates.
Set "HostNameLookups off" in httpd.conf to avoid reverse lookups of each visitor's DNS name.
For busy sites, set "MaxClients 230" or higher in httpd.conf. This setting allows more httpd processes to respond to requests simultaneously and avoids processor queuing.
Use another server to process image files.
Default guarantee Your web pages and CGI pages use browser caching technology. For specific articles, please refer to this site: Use mod_gzip to speed up Zope and Apache
Keep your Apache slim, compile those modules that are only needed, modify the srcDownloadFilesConfiguration file before compiling, and comment out the unnecessary modules with a # sign .
If you do not need traffic logs, then point the TransferLog in httpd.conf to /dev/null/
Unless you are sure to use .htaccess files to control the permissions of some directories, set "AllowOverride None" so that Save Apache the labor of searching for .htaccess files in every directory.
Don’t let unnecessary background processes run.
Never write pages or log files to network disks, such as NFS.
Do not run Apache (httpd) in inetd mode.
Don’t let X Windows run on your web server, use Ctrl-Alt-Backspace to turn off X.
Avoid using SSI tags.
In CGI scripts:
File I/O: The fewer open files the better.
Shell command: Use the full path to call the shell command.
If your site is primarily CGI driven, use mod_perl.
In your web page directory, do not let the number of files exceed 1,000. The more files you have, the more time you will spend on positioning.