Posts Under Category: cPanel

If phpMyAdmin is not working properly on your cPanel server, like blank phpmyadmin page. In such case, you should consider updating phpmyadmin.

Login to your server via SSH as root user. Now run following command:

/usr/local/cpanel/bin/updatephpmyadmin --force

Note:
This works on a cPanel server / VPS only.

Our Recommended Dedicated Server

When you try to add / create an addon domain in cPanel, but you get following error message:

Using nameservers with the following IPs: xxx.xxx.xxx.xx,xxx.xxx.xxx.xx Sorry, the domain is already pointed to an IP address that does not appear to use DNS servers associated with this server. Please transfer the domain to this servers nameservers or have your administrator add one of its nameservers to /etc/ips.remotedns and make the proper A entries on that remote nameserver.

Cause of Error message

The server administrator has disable creation of parked/addon domains that resolve to other servers. This is done for security reason.

How to solve

Login in root WHM and navigate to:

WHM Home >> Server Configuration >> Tweak Settings >> Domains >> Allow Remote Domains

And set this option to ON.

Done!!!

Don’t mess with server security

It is highly recommended to keep Allow Remote Domains to Off for security reason. So, after adding your addon domain, set this option back to Off

What if I don’t have root access of server

If you don’t have root access of server, please contact your hosting provider. Send them your addon domain, and your cPanel username. They should add domain name in your account.

Our Recommended Hosting

When you run cPanel Security Advisor, and if you get kernel out of date warning message, you need to update server kernel. The warning message may be something like below:

Current kernel version is out of date. current: 2.6.32-358.2.1.el6, expected: 2.6.32-358.23.2.el6 Update current system software in the “Update System Software” area, and then reboot the system in the “Graceful Server Reboot” area.

Updating from WHM may not solve this problem. This tutorial explains how to update kernel and solve this warning.

Login to your server as root via SSH and run following command:

yum update

Accept kernel upgrade when asked. Reboot server after update.

Done!!

Our Recommended VPS Hosting

This tutorial explains how you can optimize your cPanel powered website by compressing content.

How it work

Apache will automatically compress content when that content is requested by visitors. And will send compressed content to browser. Thus it will reduce load time and optimize your website. This feature is available in Apache 2.0 and later.

How to compress content on cPanel

Login in cPanel of your website and navigate to:

Home >> Software/Services >> Optimize Website

Here you can enable this feature. By default it is disabled.
cpanel-compress-content

Optimize Website is not in my cPanel

This features requires mod_deflate Ask your hosting provider to enable/ install mod_deflate on the server.

Our Recommended Hosting

If you are selling shared hosting or reseller hosting on your server, you must set a limit of number of mails that a website / domain / account can send per hour.

You can set this limit easily on a cPanel server. Please follow below steps.
Login in WHM as root user and navigate to:

Main >> Server Configuration >> Tweak Settings >> Mail >> Max hourly emails per domain

Here you can set the limit of number of mails per hours per domain name. It is advised to set this value to 200-500
cpanel-mail-limit

Our Recommended VPS Hosting

cPanel offers you to schedule backup and retain backup of server and accounts. But if you need to run backup manually, you can do it from SSH. Login to your server as root via SSH and run following command.

For cPanel new Backup system

/usr/local/cpanel/bin/backup

If the backup is up-to-date, you can force to run backup using below command

/usr/local/cpanel/bin/backup --force

For cPanel Legacy backup system

/scripts/cpbackup

If the backup is up-to-date and you wish to run backups anyway, use:

/usr/local/cpanel/scripts/cpbackup --force

Our Recommended Dedicated Server

cPanel default backup system may fail to create and save backup of your server and send you following message:

The backup was not able to be completed because timed out waiting for /bin/backup to finish

 

Possible cause of the problem

Any old backup process is still running in background on the server.

Confirm the cause

Login to your server as root via SSH and execute following command

/usr/local/cpanel/bin/backup --force

Most probably it will show you following type message:

Backup process currently running. Pid: 5378
Backup log file: /usr/local/cpanel/logs/cpbackup/1377934812.log

Solution

We need to kill the current running backup process. Note the Pid from above and run following command. Change xxxx to Pid number that you have got from above.

kill -9 xxxx

cPanel backup should now run normally. You can force to start a new fresh backup process using below command:

/usr/local/cpanel/bin/backup --force

Our Recommended Dedicated Server

This tutorial explains how you can change or move MySQL /tmp directory to a new location on a server / VPS. Login as root to your server via SSH.

Step 1: Open /etc/my.cnf file for editing

nano /etc/my.cnf

Step 2: Add below line under the [mysqld] section and save the file.

tmpdir=/home/mysqltmp

To save file press: Ctrl + O
To exit from nano editor press: Ctrl + X

This will set new location of MySQL tmp to /home/mysqltmp. You may change to any different location.

Step 3: Create new directory

mkdir /home/mysqltmp
chmod 1777 /home/mysqltmp

Step 4: Restart MySQL

/etc/init.d/mysql restart

Step 5: Check new location

mysqladmin var | grep tmpdir

This should show following return.

| slave_load_tmpdir                       | /home/mysqltmp
| tmpdir                                  | /home/mysqltmp

Done!!

Our Recommended Dedicated Server

Many server / VPS have very small /tmp partition like 500 MB. It is recommended to have /tmp partition of minimum 2GB.
If you server is facing issue of /tmp partition filling-up quickly, here is how you can increase its size.

This tutorials explains how easily you can increase size of /tmp partition on a cPanel server / VPS.
Login as root via SSH to your server, and follow below steps / commands.

Step 1: Stop services

Before you start resizing, you should stop cpanel, apache and mysql. Run following command to stop these services

/etc/init.d/cpanel stop
/etc/init.d/httpd stop
/etc/init.d/mysql stop

Step 2: Umount /tmp and /var/tmp

umount -l /tmp
umount -l /var/tmp

Step 3: edit /scripts/securetmp

vi /scripts/securetmp

And change value of my $tmpdsksize For making size of /tmp partition to 2GB change its value to 2048000. After making change save this file. It should be like this:

$tmpdsksize = 2048000

Step 4:Run these commands to resize /tmp partition

rm -fv /usr/tmpDSK
/scripts/securetmp

Step 5: Start services

/etc/init.d/httpd start
/etc/init.d/mysql start
/etc/init.d/cpanel start

Done!!! The /tmp partition on your cPanel server is now of 2GB

This tutorial is applicable only for cPanel Server / VPS

Our Recommended Dedicated Server

By default all MySQL database on a server is saved in /var/lib/mysql directory. If you don’t have enough space left in /var directory or if its filling up quickly, you can move your MySQL directory to /home partition.

Assuming you have enough space in /home partition, follow below steps to move MySQL to a new location in /home/var_mysql directory.

Login in server as root via SSH and run following command:

mysqldump --all-databases | gzip > /home/alldatabases.sql.gz
/etc/init.d/mysql stop
mkdir /home/var_mysql
mv /var/lib/mysql /home/var_mysql
chown -R mysql:mysql /home/var_mysql/mysql
ln -s /home/var_mysql/mysql /var/lib/mysql
/etc/init.d/mysql start

Done!!!
You should now have your MySQL at a new location /home/var_mysql

Explanation of above commands

mysqldump --all-databases | gzip > /home/alldatabases.sql.gz

This will create a full backup of all MySQL database. If anything goes wrong, you can restore all MySQL database using this backup file. Name of this file will be alldatabases.sql.gz and it will be saved in /home directory.

/etc/init.d/mysql stop

This will stop mySQL.

mkdir /home/var_mysql

This will create a new directory var_mysql in /home

mv /var/lib/mysql /home/var_mysql

This will move /var/lib/mysql to /home/var_mysql

chown -R mysql:mysql /home/var_mysql/mysql

This will give ownership of /home/var_mysql/mysql directory to user mysql.

ln -s /home/var_mysql/mysql /var/lib/mysql

This will symlinking the old /var/lib/mysql to the new location.

/etc/init.d/mysql start

This will start the MySQL.

What if anything goes wrong

We have create a full MySQL backup in our first step. If anything goes wrong, you will always have the full mysql backup to restore all database. Please refer to below tutorial to restore your databases using the full MySQL backup file.
http://www.lophost.com/tutorials/ssh/how-to-create-and-restore-mysql-backup-of-all-accounts/

Our Recommended Dedicated Server