cPanel Config

Welcome to cPanelConfig the fastest growing cPanel configuration and troubleshooting guide on the internet. Please take the time and register. We would love to have your contribution to this completely free cPanel resource. We are updating this daily so be sure to visit us on a regular basis.

Backup partition table and bootloader

Posted by yolau

In this article I will be explaining how to backup the MBR record of a hard-drive.
The MBR record contains the partition table and bootloader.

Having a backup of the MBR is useful in case you want to copy data from an older drive to a new one or in case you want to restore data from [...]

mysql execute query from console and export to csv

Posted by copilas12

Hello. To dump a query to csv use this:

mysql  –database=database –execute=”select a from b where a>1;” | sed ’s/\t/”,”/g;s/^/”/;s/$/”/;s/\n//g’ > filename.csv
If you enjoyed this post, make sure you subscribe to my RSS feed!

exim commands

Posted by copilas12

Hello. I want to share some helpful exim commands for large mailservers:
1. froze messages to recipient root@host.localhost.com

/usr/sbin/exiqgrep -i -r root@host.localhost.com | /usr/bin/xargs exim -Mf
2. delete frozen messages
/usr/sbin/exiqgrep -z -i | /usr/bin/xargs exim -Mrm
3. delete messages older than X hours (X in seconds)
/usr/sbin/exiqgrep -o X -i | /usr/bin/xargs exim -Mrm
4. total messages in queue
/usr/sbin/exiqgrep | /usr/sbin/exiqsumm [...]

mysqldump without locking tables

Posted by copilas12

Hello. I had a trouble some time ago: i wanted to dump a large table (38 million rows, 5G size) without locking the table because the website can’t go down. So, here is the mysqldump command:

mysqldump –skip-add-locks –skip-lock-tables database > database.sql
or for just a table:
mysqldump –skip-add-locks –skip-lock-tables database table > database.table.sql

Hope this help.
If you enjoyed [...]

Cpanel /scripts folder with explanation of every script.

Posted by copilas12

Hello. I found this browsing. I think it will be helpful to post it in here.

Here it is:
adddns - Adds a DNS zone.
addfpmail - Add frontpage mail extensions to all domains without them.
addfpmail2 -Add frontpage mail extensions to all domains without them.
addnetmaskips - Add the netmask 255.255.255.0 to all IPs that have no netmask.
addnobodygrp - [...]

Change the default crontab editor

Posted by yolau

This is something that I recently come across and I thought that a tiny tutorial is needed here.
CentOS 5.x comes with vi as the default editor so when you run:
crontab -e
“Vi” is the editor that opens up.
I personally don’t like it and I wanted to change it to the good old nano.
If you are in [...]

Backup your data on a backup hdd with rsync

Posted by yolau

This tutorial has been requested by one of our readers that was having trouble with the default cPanel backup script.
It is something well known that the cPanel backup script takes a long time to finish and consumes a lot o resources.
This is not a big problem if you have 100 accounts on the server but [...]

Installing DomainKeys on a cPanel server

Posted by yolau

Delivering mail to yahoo and google is so hard those days. Almost every server has had this problem even if it is not used to relay spam.
Installing DomainKeys can help your server deliver “clean” emails directly to your user’s inbox.
What are DomainKeys?
Well you will find more information on this topic at: http://antispam.yahoo.com/domainkeys

Installation is simple and [...]

Fix cron problems on new cPanel 11.x servers

Posted by yolau

I’ve noticed that on some new installs of cPanel 11.x + CentOS 5.0 there is a problem with cron jobs where the crons are not saved at all with no apparent reason and with no errors.
After some investigations I’ve found out that this is do to the fact that crontab doesn’t have the correct permissions.
It’s [...]