Have a Question?

If you have any question you can ask below or enter what you are looking for!

Common Paths and Utilities in cPanel and WHM

For users of cPanel/WHM on virtual or dedicated servers, the following article describes common system paths and utilities.

Paths of Base Modules

PHP
/usr/bin/php

MySQL
/var/lib/mysql

Sendmail
/usr/bin/sendmail

ImageMagick
/usr/local/bin/convert or /usr/bin/convert

Tomcat
/usr/local/jakarta/tomcat

Perl
/usr/bin/perl

Ruby
/usr/lib/ruby

Ruby Gems
/usr/lib/ruby/gems

FFMPEG
/usr/bin/ffmpeg

Mplayer
/usr/bin/mplayer

LAME
/usr/local/bin/lame

FLV Tool
/usr/local/bin/flvtool2

User Directories

Document Root
/home/username

WWW Directory
/home/username/public_html

CGI Directory
/home/username/public_html/cgi-bin

cPanel / WHM Core Directories and Files

/usr/local/cpanel/bin
It only contains scripts and binaries which provide installation and configuration of many cPanel services.

/var/cpanel
Accommodates proprietary configuration data for cPanel:

  • Primary cPanel configuration
  • User configurations
  • Reseller configurations
  • Accounting, conversion, and update logs
  • Bandwidth data
  • Customized service templates

/var/cpanel/cpanel.config
Primary cPanel configuration file.

Each variable influences the behaviour of cPanel. Variables are delimited and separated by an equal sign. If this file does not exist, cPanel falls back to defaults.

/var/cpanel/resellers
Lists each reseller with a comma-delimited list of WHM resources that a reseller can access.

/var/cpanel/accounting.log
It contains a list of accounting functions performed through WHM like account removal and creation.

/var/cpanel/bandwidth
Files contain a list of bandwidth history for each account named after their respective users. History files are stored in human-readable format. Meanwhile, actual bandwidth data are stored in round-robin databases.

/var/cPanel/features
File name is inherited from the feature list name. It contains a line delimited list of feature variables and zero or one value. Variables control cPanel resources available to users.

/var/cPanel/packages
It contains a list of packages. If a package belongs to resellers, the file name is prefixed with reseller username. Each of these values determines the value created in cPanel user file.

/var/cPanel/users
It contains a list of cPanel user configuration files named after the user. Variables define account resources, themes, and domains, among others.

Other /var/cPanel Directories

LOGS
This directory contains logs from account copies/transfers.

UPDATELOGS
It contains the output of each cPanel update executed on the server.

MAINIPS
It is named after the respective reseller users they represent. Each contains only the IP address which should be used as resellers main shared IP.

ZONETEMPLATES
It contains customized DNS zone templates created in WHM.

/scripts
This directory holds a large number of scripts serving as building blocks for many cPanel/WHM features.

These scripts are used to:

  • Update cPanel and many of its services
  • Customise account creation routines
  • Perform backups of cPanel accounts
  • Install and update cPanel managed services

cPanel Maintenance Scripts

By default cPanel applies updates at 2:13 AM (server time through root crontab).
/scripts/upcp sends out these updates through the key components:

  • /scripts/updatenow– Synchronises /scripts directory
  • /scripts/sysup– Updates cPanel managed rpms
  • /scripts/rpmup– Updates all other system updates

Updates are logged to time-stamped files in /var/cPanel/update logs. Update configuration is stored in /etc/cpupdate.conf.

Account Management Scripts

/scripts/wwwacct (account creation)
/scripts/removeacct (account termination)
/scripts/suspendacct (account suspension)
/scripts/unsuspendacct (account resuming)
/scripts/addpop (create pop account)
/scripts/updateuserdomains

Updates the user:owner and user:domain tables stored in:

/etc/userdomains
/etc/trueuserdomains
/etc/trueuserowners

These tables enumerate and keep track of accounts as well as their owners.

Package Management

/scripts/ensurerpm
Takes argument list of rpms, then passes these on to the underlying package manager.

/scripts/ensurepkg
The equivalent of ensurerpm for FreeBSD. Updates specified packages from ports.

/scripts/realperlinstaller
Takes argument list of perl modules to install via CPAN. Each of the aforementioned scripts can accept an argument of ‘–force’ to force package installations.

/scripts/mysqlup
Can be called to apply MySQL updates independent of upcp.

/scripts/cleanupmysqlprivs
Cleans up the default MySQL privilege tables by installing a more restrictive privilege schema.

/scripts/mysqlconnectioncheck
Will verify that mysql is accessible with password stored in /root/.my.cnf and force a reset with a random 16 character string if inaccessible.

/scripts/eximup
Can be called to apply exim updates independent of upcp.

/scripts/buildeximconf
Will rebuild exim.conf, and merge local, distribution, and cPanel configurations.

/scripts/rebuildnamedconf
Rebuild named.conf based on existing zone files.

/scripts/easyapache
Download, extract, and execute apache build script.

/scripts/rebuildhttpdconf
Rebuilds httpd.conf based on DNS entries found in each cPanel user configuration.

Other cPanel Scripts

/scripts/restartsrv_{servicename}
The majority of cPanel managed service can be scripts named appropriately.

/scripts/makecpphp
Will rebuild the PHP interpreter used internally by cpsrvd.

/usr/local/cpanel/bin/checkperlmodules
Will scan for and install any Perl modules required by cPanel.

/scripts/fullhordereset
Updates horde and resets the horde mysql user password.

/scripts/fixquotas
Will attempt to rebuild quota database per information stored in /etc/quota.conf.

Leave a Reply

You must be logged in to post a comment.