- understand How Apache works first
- Apache and keepalive issue - reduce keepalive value to 2 seconds to allow Apache to terminate the connection soon enough, also
If there's no keepalive, each connection will only serve one file which needs to be downloaded for browser display, this is not efficient method since normally a website page contains a few files in order to be properly displayed.
You can reduce the KeepAlive timeout to 2 seconds (do not turn if off). 2 seconds is enough to let the client has the enouchg time to request all the files needed for a page display, also without having to open more than one connection, also let Apache to terminate the connection soon enough so that it can handle more clients then normal.
- use a worker threaded MPM
- Some other tips
HostnameLookups off
Setting Options -Indexes FollowSymLinks (so Apache doesn't have to check if the file is symbolic link or not, it just follow)
reasonable connection timeout value than 300 (use 30 seconds or less to avoid those modem user hog the connection)
- use thttpd for static files
- Apache is the only service on the web server
You can have a big StartServers value and MinSpareServer(0) and MaxSpareServers value the same as StartServers value.
If you trust your application, you can set MaxRequestPerClient a very big value.
- hardening
use 'TraceEnable Off' to disable trace/track in main httpd.conf
use
ServerTokens Prod