June 27, 2010 | Posted by
admin | Category: cPanel Management
cPanel sometimes displays the mysql database size as 0MB in the Mysql Databases section of a client and the reason is the database cache file of the user is not updated.
To make sure cPanel displays the correct database size, follow the below steps:
1) SSH to the server and edit the cpanel.config file
# pico /var/cpanel/cpanel.config
search for
disk_usage_include_sqldbs=0
and change to
disk_usage_include_sqldbs=1
If the parameter is not present, add it. Save the file and execute the following command:
# /scripts/update_db_cache
OR
2) Login to the WHM, goto SQL section under Tweak Settings and enable the following option:
When displaying disk usage in cpanel/WHM include Postgresql and MySQL.
This will fix the issue.
Comments Off on cpanel: mysql database size 0MB
May 23, 2010 | Posted by
admin | Category: cPanel Management
You can perform a full backup of your account/domain from cPanel >> “Backups” option under the Files section. The full cPanel backup is very useful when migrating an account from one server to another.
1) Login to cPanel at http://yourdomainname.tld:2082 click the “Backups” option as shown in the screen below
2) On the next screen, cPanel will offer you various option to generate a full backup, i.e. to backup a home directory, databases, emails etc. Click on “Download or Generate a Full Website Backup” as shown in the following screen.
3) Here you will have to decide where you need to save the copy of the backup file by selecting the appropriate option from the “Backup Destination” drop down list.
a) “Home Directory” to keep the backup under your home directory itself i.e. /home/username. Click “Generate Backup” button to start the backup process and the backup file will be visible on the same screen once the process completes.
b) “Remote Ftp Server” if you want to send the backup file to a remote server in which case, you need to mention the Remote Server IP, Ftp user/password, port and directory. Click “Generate Backup” button and the backup file will be copied to the remote server once the process completes.
In either of the above case, you can specify an email address in the “Email Address” field to receive a notification.
Note: This cPanel generated backup cannot be restored from the cPanel interface. It can only be restored from shell as root OR from WHM interface.
Comments Off on How to generate a full backup of an account/domain from cPanel?
May 7, 2010 | Posted by
admin | Category: cPanel Management
When Apache is compiled as CGI/SuPHP, it allows users to create their own php.ini file under their home directory and modify the php values as per their wish.
This may increase security concerns on the server and hence to protect/secure php.ini in SuPHP enabled servers, force every user to use a common php.ini file.
This can be achieved by defining the path of server side php.ini file using suPHP_ConfigPath directive. To force users to use server side php.ini file, create suphp_configpath.conf
# pico /usr/local/apache/conf/userdata/suphp_configpath.conf
and add the following lines
<IfModule mod_suphp.c>
<Location />
suPHP_ConfigPath /usr/local/lib/
</Location>
</IfModule>
Once done, save the file and rebuild the Apache configuration so it picks up the changes.
# /usr/local/cpanel/bin/apache_conf_distiller --update --main
# /usr/local/cpanel/bin/build_apache_conf
To verify the include files, execute:
# /scripts/verify_vhost_includes
It will display the path of the .conf file you created. Restart the Apache service once
# /scripts/restartsrv httpd
This will ensure all the users use the server side php configuration file. If you wish to keep the php.ini elsewhere, just change the value of “suPHP_ConfigPath” and follow the above steps.
Comments Off on How to protect/secure php.ini with SuPHP?
March 20, 2010 | Posted by
admin | Category: cPanel Management
Quite often you see the “lowest numbered MX record points to localhost: rejected RCPT error” error message in ‘exim_mainlog’ on a cPanel server. The error message appears while sending/receiving emails and it looks something like:
temporarily rejected RCPT <email@domainname.tld>: lowest numbered
MX record points to local host
The problem occurs when the domain name is missing from the /etc/localdomains file on the cPanel server. The difference between the /etc/localdomains and /etc/remotedomains files is that, they decide whether the emails for the domain is hosted locally OR on a remote server respectively.
To fix the issue, edit the file:
# pico /etc/localdomains
and add the domain name in the file. There is no need to restart the ‘exim’ service.
Comments Off on lowest numbered MX record points to localhost
March 14, 2010 | Posted by
admin | Category: cPanel Management
The “hostname resolves to. It should resolve to xx.xx.xx.xx” alert is received from a cPanel server if the hostname of your server is not resolving to your server IP. The message received from the server is:
IMPORTANT: Do not ignore this email. The hostname (server.domain.tld
resolves to. It should resolve to xx.xx.xx.xx. Please be sure to
correct /etc/hosts as well as the 'A' entry in zone file for domain.
Some are all of these problems can be caused by /etc/resolv.conf
being setup incorrectly. Please check this file if you believe
everything else is correct.
You have to set an ‘A’ record for the hostname in your domains DNS zone file. The ‘A’ record will point the server hostname to your server IP and server will stop sending you the alert messages.
For example, if the hostname of your server is server.abc.com. You have to add an ‘A’ record for server in the DNS zone file of abc.com. The DNS zone file of abc.com resides on the server where the name servers of abc.com are pointing.
If the name servers for abc.com are resolving to your server, you need to edit the dns zone file of abc.com from
WHM >> DNS Functions >> Edit a DNS Zone"
and add an ‘A’ record for ‘server’ to point to your server IP.
If you are using your domain registrar’s name servers for abc.com, then you have to set an ‘A’ record in the domain registrar panel. But make sure it is set correctly on your server as well.
Next step is to see if the hostname is properly set in the /etc/hosts file of the server. SSH to your server as root and make sure the hostname is set as follows:
ServerIP server.abc.com server
If you still continue to receive the alert message even if hostname is resolving to your server IP, disable the IP DNS check option in WHM.
WHM >> Server Contacts >> "IP Address DNS Check"
NOTE: If the hostname is resolving properly to your server, it is safe to ignore/disable these alerts. It is not going to effect the working of your server/websites in any ways.
Comments Off on cPanel server: “hostname resolves to” alert email