in Challenge, Performance, Security

The perfect cPanel shared host Web server configuration

In this post, we are going to share a list of software and configurations ideal for a cPanel shared hosting server. Should you be interested in having a fully managed server with us, we’ll be very happy to set all these measures up for you and maintain them. This configuration is ideal to:

  • Prevent server abuse
  • Maximize profitability
  • Provide memory, CPU, disk IO, and bandwidth fair share
  • Guarantee resources (SLA)
  • Maintain stability for all tenants
  • Provide all-aroud best performance
  • Improve security

Without further delay, here is our growing master list:

  • Nginx Varnish accelerator
    • Increase max_connections
    • Increase¬†thread_pools
    • Increase¬†thread_pool_min
    • Cookie based caching
  • cgroups and io-throttle
    • Put a memory limit per FCGI process per user
    • Put a CPU limit per FCGI process per user
    • Put disk IO limit per FCGI process per user
    • Limit disk IO for all Exim processes
    • Limit bandwidth IO for all Exim processes
    • Put each of Exim, MySQL, PHP, and HTTPD processes in their own group
  • Fast-CGI
    • Limit number of PHP process per user
    • Enable and configure SuEXEC
    • Limit number of PHP processes
    • Set number of minimum PHP processes per user to zero
    • Configure FCGI safe mode
  • Suhosin
    • Set maximum stack depth to prevent runaway processes
    • Disable eval execution to find out where eval is maliciously used
    • Run in simulation mode to see what Suhosin could break
    • Inject DB user prefix to DB queries
    • Add memory_limit measure
  • Eaccelerator
    • Enable opcode caching (complements Nginx caching above)
    • Set the cache directory to /dev/shm/eacclerator
  • MySQL
    • Limit SQL queries per user
    • Optional: put the MySQL data directory on SSD drives
    • Put MySQL tmpdir on /dev/shm (be cautious with this setting)
  • PRM
    • Put a ceiling on max memory usage per process (Exception: MySQL)
    • Put maximum amount of processes for httpd and exim only
  • CSF
    • Per-IP connection limit
    • Increase .htaccess failure detection and blocking
    • Enable port flooding protection
    • Enable RBL and other DNSBL filters
  • DCC
    • Become a participating agent node
  • ulimit
    • Put a hard limit on all resources

Stay tuned as we fine tune the list!

Write a Comment

Comment

Comment moderation is enabled. Your comment may take some time to appear.

Webmentions

  • Lingzhi Diet Tea

    Lingzhi Diet Tea…

    That really a nice video mentioned inside this paragraph regarding how to write a piece of writing, therefore i got clear idea from here….

  • - Maw New Super Affiliate Blog | Maw New Super Affiliate Blog

    […] The perfect cPanel shared host Web server configuration (unixy.net) […]