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.

cPanel

Plesk

DirectAdmin

H-Sphere

Webmin

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.

Directory Structure

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

  • Apache – /usr/local/apache
  • bin- apache binaries are stored here: httpd, apachectl, apxs
  • conf – configuration files are stored here.– httpd.conf: php.conf
  • domlogs – domain access and stat log files for all domains are stored in this location
  • htdocs – The default apache DocumentRoot location
  • include – Here the header files are stored.
  • libexec – shared object (.so) files 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) files 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

 

Exim

  • Conf : /etc/exim.conf – exim main configuration file 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 file – /etc/valiases/domainname.com
  • Email filters file – /etc/vfilters/domainname.com
  • POP user authentication file – /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
  •  

ProFTPD

  • 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 file – /etc/proftpd/$username -all ftp accounts are stored here

 

Pure-FTPD

  • Program : /usr/sbin/pure-ftpd
  • Init Script :/etc/rc.d/init.d/pure-ftpd : /scripts/restartsrv_ftpserver
  • Conf: /etc/pure-ftpd.conf
  • Accounts file: /etc/proftpd/$username (all ftp accounts are stored here)
  • Anonymous ftp document root – /etc/pure-ftpd/ip-address

 

Mysql

  • 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 file – /var/lib/mysql/mysql.sock, /tmp/mysql.sock

 

SSHD

  • Program :/usr/local/sbin/sshd
  • Init Script :/etc/rc.d/init.d/sshd – /scripts/restartsrv_sshd – service sshd restart
  • Conf: /etc/ssh/sshd_config
  • Log: /var/log/messages

 

Perl

  • 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
  •  

Named(BIND)

  • Program: /usr/sbin/named
  • Init Script: /etc/rc.d/init.d/named
  • Config: /etc/named.conf
  • Zone files:/var/named/
  • Log: /var/log/messages: /var/named/data/named.run

 

Courier

  • Program: /usr/lib/courier-imap/libexec/couriertcpd
  • Init Script: /etc/init.d/courier : /scripts/restartsrv_courier
  • Config: /usr/local/libexec/courier-imap
  • Log: /var/log/maillog

 

Dovecot

  • Program: /usr/sbin/dovecot
  • Init Script: /etc/init.
  • Config: /etc/dovecot.conf
  • Log: /var/log/maillog

 

EasyApache

  • /var/cpanel/easy/apache
  • /var/cpanel/userdata
  • /usr/local/apache/conf/
  • /var/cpanel/templates/apache2
  • /usr/local/cpanel/src/templates/apache2
  • /home/cpeasyapache
  • /opt
  • /usr/local/cpanel/logs/easy/apache

 

cPanel

  • cPanel installation directory structure – /usr/local/cpanel
  • 3rdparty/ – tools like fantastico, mailman files are located here
  • addons/ – AdvancedGuestBook, phpBB, etc.
  • base/ – phpmyadmin, squirrelmail, skins, webmail, etc.
  • bin/ – cpanel binaries
  • cgi-sys/ – cgi files such as cgiemail, formmail.cgi, formmail.pl, etc.
  • logs/ – cpanel access_log, error_log, license_log, stats_log
  • whostmgr/ – whm related files
  • base/frontend – cPanel related files – themes+ perl/ – internal Perl modules for compiled binaries are here.
  • etc/init – init files for cPanel services are stored here.

 

WHM

  • WHM related files – /var/cpanel – whm files are present here.
  • bandwidth/ – rrd files 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 file: theme, bwlimit, addon, parked, sub-domains all are listed here
  • zonetemplates/ – dns zone template files are taken from here

 

Important cPanel/WHM files (& Config files)

  • /usr/local/apache/conf/httpd.conf – This is the apache configuration file.
  • /etc/exim.conf – This is the email server configuration file.
  • /etc/named.conf – This is the name server (named) configuration file
  • /etc/proftpd.conf – This is the proftpd server configuration file
  • /etc/pure-ftpd.conf – This is the pure-ftpd server configuration fileetc/valiases/domainname (catchall and forwarders are set here)
  • /etc/vfilters/domainname – email filters are set here
  • /etc/userdomains – all domains are listed here addon, parked, subdomains, and the usernames
  • /etc/localdomains – exim related file all domains should be listed here to be able to send/receive emails
  • /etc/cpbackup-userskip.conf
  • /etc/sysconfig/network – Networking Setup
  • /etc/hosts
  • /etc/resolv.conf – Networking Setup–> Resolver Configuration
  • /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 Configuration » Service Manager
  • /etc/ipaddrpool – free IP addresses
  • /etc/ips.dnsmaster – nameserver IP’s
  • /etc/domainips –  dedicate IPʼs set for specific domains
  • /etc/wwwacct.conf – account creation defaults file in WHM (Basic cPanel/WHM Setup)
  • /etc/cpupdate.conf – This is the Update Config file
  • /etc/cpbackup.conf – Configure Backup
  • /etc/clamav.conf – clamav (antivirus configuration file )
  • /etc/my.cnf – This is the mysql configuration file
  • /usr/local/lib/php.ini – This is the php configuration file
  • /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 file that defines account settings
  • /var/cpanel/users.cache – user cache files that are read by cPanel
  • /var/cpanel/cpanel.config – cpanel configuration file ( Tweak Settings )
  • /var/cpanel/Counters – To get the counter of each users.
  • /var/cpanel/bandwidth – To get bandwith usage of domains
  • /var/cpanel/userdata – Defines parked, addon, subdomains as well as VirtualHost
  • /var/cpanel/logs – transfer logs
  • /var/cpanel/easy/apache – easyapache build files/profile
  • /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 file, backups and logs are stored here
  • /var/cpanel/roundcube – version file, backups and logs stored here
  • /var/cpanel/squirrelmail – version file stored here
  • /var/cpanel/packages – default and custom packages created herevar/cpanel/databases – dbmapping files
  • /var/cpanel/cpanelsync – DNS Clustering files

If you need any further assistance please reach our support department.

Was this answer helpful? 0 Users Found This Useful (0 Votes)