Apache Setup

How to estimate the following values put in my httpd.conf. I have recently setup a VM Centos server with 4GB RAM, 1 CPU.

Beside, any reference on hardening my php to minimize any attack / hacking ? Thx

<IfModule prefork.c>
    StartServers        4
    MinSpareServers     20
    MaxSpareServers     40
    MaxClients          200
    MaxRequestsPerChild 4500
Who is Participating?
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
About Apache Config - As arnold said, take defaults + then monitor your Apache error.log + Apache will emit messages if changes are required.

About Hardening PHP - PHP attacks are pretty simple right now because of the Ongoing Opcache Bug.

The absolute best way to attack PHP is to simply hit any PHP file repeatedly + way for system to fail + keep hitting it to keep a system down.

This becomes very easy when any CMS is involved, as 404 pages run all CMS code first, to check if the request can return content + then return the 404 as an uncached request. So each 404 reference, even just picking random ones, produces highest server load of any page request.

Simple attacks, from common IPs, can easily be caught + blocked by Fail2Ban.

Sophisticated attacks, where many unique IPs are used are tougher. In this case, you'll likely require a custom solution.

Normally the second case only occurs when you're generating massive amounts of conversions, where it becomes profitable for competitors to target you. To a certain amount, the first case has same feature.

Running attack traffic costs the attacker money, so until you're generating massive cash, Fail2ban processing of 404 pages is normally sufficient for most sites.
Standard are fine until you have data to see whether your per client request limit is too low.

Do you have existing stats for your site? Per second requests, unique users?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.