cPanel Log Locations

  cPanel All cPanel logs are located in the folder: /usr/local/cpanel/logs The access_log contains all traffic to WHM, cPanel, and Webmail: /usr/local/cpanel/logs/access_log The error_log contains all errors when accessing a cPanel related site: /usr/local/cpanel/logs/error_log   Apache On cPanel servers each site has its own traffic log, but Apache's main access log can be viewed here: /usr/local/apache/logs/access_log To view […]

Manually Export MySQL Database

How do I manually export or "dump" a MySQL database from command line or SSH? You can dump a MySQL database to the current folder from an SSH session using the following command: mysqldump –no-create-db=true -uUSERNAME -pPASSWORD DATABASE > filename.sql So if your database name is "USER_MYDATABASE" and your database username is "USER_USER1" and the […]

Search For Specific Text In File

How can I find a specific text string in a file or multiple files from an SSH session? You can use the grep command to easily find text within files. From an SSH session, run the following command: grep -H -r "<Text-To-Find>" <search-location> Where <Text-To-Find> would be replaced with the text you want to search […]

Bulk Edit DNS Zone On cPanel

How do I bulk edit a DNS zone on cPanel? Changed nameserver name and need to update all the DNS zones on your cPanel server? Using the replace command from an SSH session will make it simple. Just use the following command: replace "<old-nameserver>" "<new-nameserver>" — /var/named/*.db Where <old-nameserver> is the hostname of the old […]

Explanation Of Cron Times

New to setting up cron jobs and need to know what each digit means? The following is an example of each digit and its function: *    *    *    *    *        command to be executed |     |     |    |    | |     |     |    |    +—– day of week (0 – 6) (Sunday=0) |     |     |    […]

Find And Remove Old cPanel Backups

How do I find and remove old cPanel backups? Use the following command from an SSH session to find all backups that are older than 60 days and delete them: find /backup/weekly/incremental/accounts -maxdepth 1 -type d -ctime +60 -exec rm -rf {} \; In the above example we find all weekly incremental backups that are […]

Rebuild Named.conf

How do I fix my cPanel DNS configuration or rebuild named.conf? Running the following script from an SSH session will fix most issues when your named.conf file becomes corrupt: cd /etc;mv named.conf named.old;/scripts/rebuilddnsconfig;service named restart    

cPHulk Whitelist IP Address From SSH

How to whitelist IP address in cPHulk from the command line? From an SSH session, run the following command: /scripts/cphulkdwhitelist <ipaddress> Where <ipaddress> is the IP address you wish to whitelist.      

CloudLinux Lvestats Not Working

How to fix CloudLinux Lvestats when they stop working? Run the following command from an SSH session; service lvestats stop;killall -9 lvestats-server;rm -rf /var/lve/lveinfo.db;service lvestats start If you receive a sqlite error, then run: yum reinstall sqlite3 And then run first command again.