Configuration that matches your resources.
APACHE
The main tuning is the process or thread model and how many workers run. Too many exhaust memory, too few queue requests.
Calculate from the memory each worker uses and the memory available, leaving room for the database and everything else.
Enable compression and caching headers for static files.
NGINX
Worker processes usually set to the core count, with worker connections set generously since Nginx handles connections efficiently.
Enable compression and static file caching.
PHP-FPM
Pool sizing is the critical setting. Choose the process manager mode deliberately, and calculate maximum children from available memory divided by per-process usage.
Set a request limit so processes recycle and leaked memory is reclaimed.
WHAT TO MEASURE FIRST
Do not tune blind. Check actual memory per process and actual concurrency before changing anything.
WITH A CONTROL PANEL
Sensible defaults are applied. Tune only if you have identified a specific problem.