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
</IfModule>
AXISHKAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
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?
1
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.