Posts Under Category: cPanel

In this tutorial, I will explain how to update cPanel License key of a server / vps. cPanel license key can be updated from SSH. You need to update your server license key when you have a new licence key, or you want to upgrade from trail version to paid version.

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

/usr/local/cpanel/cpkeyclt

Done!!

Now try to login in WHM using URL: http://server-ip:2086 OR http://server-ip/whm

Our Recommended VPS Hosting

For security reason, it is recommended that you disable directory listings / indexing on your server. Apache default configuration comes with this feature enabled but its always a good idea to get it disabled unless you really need it.

When this option is enabled, user can see the list of files / folder of a directory when no index file is present.
apache-directory-index

With Apache listings / indexing option disabled, user will not be able to see content of a directory in absence of a index file.

Here is how you can disable this on a cPanel server.

Step 1

Login to your server WHM as root.

Step 2

Navigate to:
WHM Main >> Service Configuration >> Apache Configuration >> Global Configuration

Step 3

Under Directory ‘/’ Options >> uncheck Indexes >> Save >> Restart Apache

apache-directory-index-2

Done!!

Our Recommended VPS Hosting

MySQLTuner is great script to optimize mysql database of a server. It reports a large number of statistics and settings from your MySQL database engine, and then offers general recommendations to improve performance.

To run MySQLTuner on a serve / VPS with cPanel, run following command in SSH

/usr/local/cpanel/bin/mysqltuner.pl

Our Recommended VPS Hosting

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