Where Does cPanel Put It?

I can think of a few things that are wrong with that title but in all seriousness…don’t you ever wonder where cPanel stores the config changes that you make in WHM?  Automation is the key nowadays, and lately that’s required me to get a little down and dirty with cPanel to find its deepest secrets. *This information is not official documentation, nor is it backed up by cPanel or set in stone.  In other words, don’t blame me if you mess up your server.

These are files that store the information read and used by WHM (as of 11.23.6)

IP addresses: /etc/ips

  • Reserved IPs: /etc/reservedips
  • Reserved IP reasons: /etc/reservedipreasons
  • IP address pool: /etc/ipaddrpool
  • Access hash (WHM remote access key): /home/user/.accesshash or /root/.accesshash
  • cPanel update preferences: /etc/cpupdate.conf
  • Basic cPanel/WHM setup:  /etc/wwwacct.conf
  • System mail preferences: /etc/localaliases
  • Exim open relay list: /etc/alwaysrelay
  • Server-wide max emails per hour: /var/cpanel/maxemailsperhour
  • Tweak settings: /var/cpanel/cpanel.config
  • Packages: /var/cpanel/packages/
  • Features: /var/cpanel/features/
  • User data: /var/cpanel/users/ and /var/cpanel/userdata
  • Apache templates: /var/cpanel/templates/apache(1,2)
  • Exim config template: /etc/exim.conf.localopts
  • Exim mail IPs: /etc/mailips
  • rDNS for mail ips: /etc/mail_reverse_dns
  • Clustering: /var/cpanel/cluster/root/config
  • Service manager: /etc/chkserv.d
  • Users and their domains: /etc/userdomains
  • Users and their main domains: /etc/trueuserdomains
  • Users and their owners: /etc/trueuserowners
  • Main cPanel IP: /var/cpanel/mainip
  • cPanel version: /usr/local/cpanel/version
  • Resellers: /var/cpanel/resellers
  • Reseller nameservers: /var/cpanel/resellers-nameservers
  • These are a few scripts that you can use to achieve the same  results of their WHM equivalents:

    • Initialize quotes: /scripts/initquotas
    • Compile Apache: /scripts/easyapache  (you can pass additional options – see EasyApache 2 docs)
    • Update cPanel: /scripts/upcp
    • Enable/disable tweak settings: /scripts/smtpmailgidonly on|off
    • Change PHP API and suExec settings: /usr/local/cpanel/bin/rebuild_phpconf
    • Suspend an account: /scripts/suspendacct <user> <reason>
    • Terminate an account: /scripts/killacct <user>

    Obviously there are a ton more, and just about anything done in WHM can be done directly on the server.  The main things to remember:

    Scripts are mainly stored in /scripts and /usr/local/cpanel/bin

    Data files are in /var/cpanel

    Config files are in /etc/ and /usr/local/cpanel

    • 1 Users Found This Useful
    Was this answer helpful?

    Related Articles

    How to Move Accounts From One cPanel Server To Another ?

      This tutorial explains a simple, straightforward method for migrating cPanel accounts from...

    How do I set the Primary Interface in WHM?

    Under Basic cPanel/WHM Configuration, there is an area called Primary Interface. By default, if...

    How to install cPanel on CentOS

    Installation Notes A CentOS or Red Hat server that is going to have cPanel installed needs a...

    Why is cPanel/WHM not loading?

    There are two main reasons why cPanel/WHM isn't loading that we've seen.Brand New ServerIf you...

    How to Configure WHM / CPANEL with a Valid SSL Certificate

    Fix a Broken SSL Certificate for WHM port 2087 and cPanel port 2083Improve your Server Security -...