Everything about cPanel Directory Structure
cPanel is a web hosting control panel. It is one of the most popular control panels in the web hosting field. If you are using cPanel or planning to install it on your server, it is good that you know about the cPanel directory structure. Before moving to cPanel directory structure, let’s see an overview on what a web hosting control panel is.
What is a Web Hosting Control Panel?
A webhosting control panel is a web-based interface that allows customers to manage their websites easily even without technical knowledge. There are many types of control panels in the circle of web hosting. To use a control panel, you need to install it on the server. Various common web hosting control panels are described below.
In the above list, only Webmin is available for free of cost. Remember that once cPanel installed, you cannot remove it from the server. You need to reload the server itself to remove the cPanel.
What is cPanel
cPanel is a linux-based webhosting control panel. It provides a graphical interface and tools to manage your hosting products. It is one of the most popular web hosting control panel. The control panel is easy to use and does not require any technical expertise. cPanel comes in two faces, WHM and cPanel. The WHM gives the root level access and reseller privileges as well. cPanel control panels are available for each main accounts. Before moving to cPanel directory structure, let’s see what the directory structure means.
The organization of files into a hierarchy of folders is known as the directory structure. It describes how the files are arranged in the filesystem as contents of folders and for displaying the files. The directory structures will be in a hierarchical tree model.
cPanel Directory Structure
Now let’s see the cPanel Directory Structure in detail. The first directory we are going to see is Apache – /usr/local/apache. Let’s see the sub classifications.
- Apache – /usr/local/apache
- bin- apache binaries are stored here: httpd, apachectl, apxs
- conf – conﬁguration ﬁles are stored here.– httpd.conf: php.conf
- domlogs – domain access and stat log ﬁles for all domains are stored in this location
- htdocs – The default apache DocumentRoot location
- include – Here the header ﬁles are stored.
- libexec – shared object (.so) ﬁles are stored here: libphp4.so,mod_rewrite.so
- logs – apache logs: access_log, error_log, suexec_log
- man – apache manual pages
- icons – icon/jpg/gif images
- modules – shared object (.so) ﬁles are store here: Apache-2.x+
- Init Script :/etc/rc.d/init.d/httpd or /usr/local/apache/bin/apachectl: apache start script
- cPanel script to restart apache – /scripts/restartsrv_httpd
- /opt – Apache modules built here
- Conf : /etc/exim.conf – exim main conﬁguration ﬁle is stored here.
- /etc/localdomains – list of domains allowed to relay/receive mail
- Log : /var/log/exim_mainlog – incoming/outgoing mail logs
- Log : /var/log/exim_rejectlog – exim rejected mails are reported here
- Log : /var/log/exim_paniclog – exim errors are logged here
- Mail queue: /var/spool/exim/input
- Cpanel script to restart exim – /scripts/restartsrv_exim
- Email forwarders and catchall address ﬁle – /etc/valiases/domainname.com
- Email ﬁlters ﬁle – /etc/vﬁlters/domainname.com
- POP user authentication ﬁle – /home/username/etc/domainname/passwd
- Catchall inbox – /home/username/mail/new
- POP user inbox – /home/username/mail/domainname/popusername/new
- POP user spambox – /home/username/mail/domainname/popusername/spam• Program : /usr/sbin/exim (suid – -rwsr-xr-x 1 root root )
- Init Script: /etc/rc.d/init.d/exim : /scripts/restartsrv_exim : service exim restart
- Check queue: exim -bpc
- Program :/usr/sbin/proftpd
- Init Script :/etc/rc.d/init.d/proftpd : /scripts/restartsrv_ftpserver
- Conf: /etc/proftpd.conf
- Log: /var/log/messages, /var/log/xferlog
- Accounts ﬁle – /etc/proftpd/$username -all ftp accounts are stored here
- Program : /usr/sbin/pure-ftpd
- Init Script :/etc/rc.d/init.d/pure-ftpd : /scripts/restartsrv_ftpserver
- Conf: /etc/pure-ftpd.conf
- Accounts ﬁle: /etc/proftpd/$username (all ftp accounts are stored here)
- Anonymous ftp document root – /etc/pure-ftpd/ip-address
- Program : /usr/sbin/mysqld :/usr/bin/mysqld_safe
- Init Script : /etc/rc.d/init.d/mysql : service mysql start/stop : /scripts/restartsrv_mysql
- Conf : /etc/my.cnf, /root/.my.cnf
- Data directory – /var/lib/mysql (location for all database storage)
- Database naming convention- username_dbname (eg: john_sales)(DBMapping)
- Log: Startup errors – /var/lib/mysql/hostname.tld.err
- Socket ﬁle – /var/lib/mysql/mysql.sock, /tmp/mysql.sock
- Program :/usr/local/sbin/sshd
- Init Script :/etc/rc.d/init.d/sshd – /scripts/restartsrv_sshd – service sshd restart
- Conf: /etc/ssh/sshd_conﬁg
- Log: /var/log/messages
- Program :/usr/bin/perl or /usr/local/bin/perl
- Directory :/usr/lib/perl5/5.8.x/ or /usr/local/lib/perl5
- Version: perl -v
- Check: /scripts/checkperlmodules : /scripts/perlmods -s
- Installer: /scripts/perlinstaller : perl -MCPAN -e shell
- Build: /home/.cpan :/home/.cpcpan
- Program: /usr/sbin/named
- Init Script: /etc/rc.d/init.d/named
- Conﬁg: /etc/named.conf
- Zone ﬁles:/var/named/
- Log: /var/log/messages: /var/named/data/named.run
- Program: /usr/lib/courier-imap/libexec/couriertcpd
- Init Script: /etc/init.d/courier : /scripts/restartsrv_courier
- Conﬁg: /usr/local/libexec/courier-imap
- Log: /var/log/maillog
- Program: /usr/sbin/dovecot
- Init Script: /etc/init.
- Conﬁg: /etc/dovecot.conf
- Log: /var/log/maillog
- cPanel installation directory structure – /usr/local/cpanel
- 3rdparty/ – tools like fantastico, mailman ﬁles are located here
- addons/ – AdvancedGuestBook, phpBB, etc.
- base/ – phpmyadmin, squirrelmail, skins, webmail, etc.
- bin/ – cpanel binaries
- cgi-sys/ – cgi ﬁles such as cgiemail, formmail.cgi, formmail.pl, etc.
- logs/ – cpanel access_log, error_log, license_log, stats_log
- whostmgr/ – whm related ﬁles
- base/frontend – cPanel related ﬁles – themes+ perl/ – internal Perl modules for compiled binaries are here.
- etc/init – init ﬁles for cPanel services are stored here.
- WHM related ﬁles – /var/cpanel – whm ﬁles are present here.
- bandwidth/ – rrd ﬁles of domains
- username.accts – reseller accounts are listed here.
- packages – list of hosting packages are here
- root.accts – list of root owned domains are here
- suspended – list of suspended accounts are here
- users/ – cpanel user ﬁle: theme, bwlimit, addon, parked, sub-domains all are listed here
- zonetemplates/ – dns zone template ﬁles are taken from here
Important cPanel/WHM ﬁles (& Conﬁg ﬁles)
- /usr/local/apache/conf/httpd.conf – This is the apache conﬁguration ﬁle.
- /etc/exim.conf – This is the email server conﬁguration ﬁle.
- /etc/named.conf – This is the name server (named) conﬁguration ﬁle
- /etc/proftpd.conf – This is the proftpd server conﬁguration ﬁle
- /etc/pure-ftpd.conf – This is the pure-ftpd server conﬁguration ﬁleetc/valiases/domainname (catchall and forwarders are set here)
- /etc/vﬁlters/domainname – email ﬁlters are set here
- /etc/userdomains – all domains are listed here addon, parked, subdomains, and the usernames
- /etc/localdomains – exim related ﬁle all domains should be listed here to be able to send/receive emails
- /etc/sysconﬁg/network – Networking Setup
- /etc/resolv.conf – Networking Setup–> Resolver Conﬁguration
- /etc/nameserverips – Networking Setup–> Nameserver IPs ( for resellers to give their nameservers )
- /var/cpanel/resellers – For addpkg, etc permissions for resellers.
- /etc/chkserv.d – Main » Service Conﬁguration » Service Manager
- /etc/ipaddrpool – free IP addresses
- /etc/ips.dnsmaster – nameserver IP’s
- /etc/domainips – dedicate IPʼs set for speciﬁc domains
- /etc/wwwacct.conf – account creation defaults ﬁle in WHM (Basic cPanel/WHM Setup)
- /etc/cpupdate.conf – This is the Update Conﬁg file
- /etc/cpbackup.conf – Conﬁgure Backup
- /etc/clamav.conf – clamav (antivirus conﬁguration ﬁle )
- /etc/my.cnf – This is the mysql conﬁguration ﬁle
- /usr/local/lib/php.ini – This is the php conﬁguration ﬁle
- /etc/ips – IP addresses on the server (excluding shared IP’s) (IP Functions–>Show IP Address Usage )
- /var/run/chkservd – Main » Server Status » Service Status
- /var/log/dcpumon – top log process
- /root/cpanel3-skel – skeleton directory. Eg: public_ftp, public_html. (Account Functions)
- /var/spool/exim/input – Mail queue
- /var/spool/exim/msglog – email message logs
- /var/spool/cron – cronjobs are stored here for all users
- /var/cpanel/users – cpanel user ﬁle that deﬁnes account settings
- /var/cpanel/users.cache – user cache ﬁles that are read by cPanel
- /var/cpanel/cpanel.conﬁg – cpanel conﬁguration ﬁle ( Tweak Settings )
- /var/cpanel/Counters – To get the counter of each users.
- /var/cpanel/bandwidth – To get bandwith usage of domains
- /var/cpanel/userdata – Deﬁnes parked, addon, subdomains as well as VirtualHost
- /var/cpanel/logs – transfer logs
- /var/cpanel/easy/apache – easyapache build ﬁles/proﬁle
- /var/cpanel/userhomes – session home for cPanel, Horde, Roundcube, phpmyadmin
- /var/cpanel/serviceauth – chkservd service user/pass data
- /var/cpanel/updatelogs – upcp daily logs
- /var/cpanel/horde – version ﬁle, backups and logs are stored here
- /var/cpanel/roundcube – version ﬁle, backups and logs stored here
- /var/cpanel/squirrelmail – version ﬁle stored here
- /var/cpanel/packages – default and custom packages created herevar/cpanel/databases – dbmapping ﬁles
- /var/cpanel/cpanelsync – DNS Clustering ﬁles
If you need any further assistance please reach our support department.