Where Does cPanel Put It?
Posted by Nessa | Posted in apache,cpanel,exim,linux | Posted on 17-12-2008
4
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 <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













Wow. I feel more like a command line guru just by having read the above info. This’s why I check in every so often– good posts like this. 8D
Slight correct to the Apache templates. There are two different template systems in use ( we are in the process of transitioning to a single system ). When domains are created, the templates used are in:
/usr/local/cpanel/etc/httptemplates
When httpd.conf is rebuilt the templates used are those in /var/cpanel/templates.
Each uses a different markup syntax. Also, there is no easy method of preserving changes to the templates in /usr/local/cpanel/etc/httptemplates
Nice information about cpanel.
GREAT article. I work as a senior sysadmin for a web hosting company, and even though I work with cPanel on a daily basis, in such a fast-paced environment it can be easy to forget things like this from time to time. I’ll be passing this along as well to our junior support staff as a refresher/crash course reference, should they ever need it. Well done!