cPanel Apache Tuning

One of the first things I do is run /scripts/easyapache and rebuild my PHP / Apache configuration.
I usually select Apache 2.2 and PHP 5.2.9. At the time of writing I stay away from the 5.3 versions as they aren’t supported by programs and programmers enough yet.

Although this guide was originally inspired from a cPanel install, its Apache specific and doesn’t require cPanel.

  1. Enable ModSuPHP
  2. Disable FrontPage
  3. Enable Mod Bandwidth
  4. Enable Mod Security
  5. Enable mo_userdir tweak

Only enable the the options you know you need. Only enable the PHP option

TraceEnable Off
This directive sets the behavior of TRACE requests for both the core server and mod_proxy.

FileETag None
‘None’ means that if a document is file based, no ETag field will be included in the response.

MaxRequestsPerChild 0
This directive sets the limit on the number of requests that an individual child server process will handle. After MaxRequestsPerChild requests, the child process will die. If MaxRequestsPerChild is 0, then the process will never expire.

Post VirtualHost Include

Entering information in this text area will add content to the Apache configuration file (httpd.conf) right after the last VirtualHost entry.

Theres also some little know Apache features that are a little hard to understand. They also depend on your OS.

RLimitCPU Limits the memory consumption of processes launched by Apache children
RLimitNPROC limits the number of processes that can be launched by processes launched by Apache children.

They both take two parameters, first is the soft limit and second is the hard limit.

I wish to edit the Post VirtualHost configuration include file for:
Filename: post_virtualhost_global.

RLimitCPU 8 16
RLimitNPROC 8 16

Author: Kieran Barnes

Kieran is a PHP developer with 15 years commercial experience. Specialist in WordPress, CakePHP, CubeCart and all things PHP.

Leave a Reply

Your email address will not be published. Required fields are marked *