Where Does cPanel Put Things?

From http://www.v-nessa.net/

(Sexy g33k chicks rock…)

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 scripst 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
* Terminate an account: /scripts/killacct

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


I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.