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 […]

Change All Folders To 755 And Files To 644

How to reset file/folder permissions to folder to 755 and files to 644? Run the following command from an SSH session: chmod -R ugo-x,u+rwX,go+rX,go-w <path> Where <path> is the physical path of the folders/files you wish to change