Cpanel WHM: License expired error
If “License expired” error is encountered while accessing the cpanel/whm, it can be fixed by following below mentioned steps:
1. Check whether the license is expired.
This is the most obvious cause and simple to verify. Access the URL ‘http://verify.cpanel.net/’ and check the IP of the server.
2. If it is “active”, Run the following command:
$ /usr/local/cpanel/cpkeyclt
This should promptly return to the command line with no messages. If it takes a while, then there is likely a connectivity issue between your server and the licensing server.
3. In that case, check whether the firewall is blocking connections to the licensing server.
Verify that port 2089 TCP outgoing traffic is allowed in the firewall rules.
4. If you’re not sure that your firewall is properly configured, then the best thing to do is temporarily flush your firewall rules. Before flushing the firewall rules, you need to save the firewall rules enabled in the server.
$ /etc/init.d/iptables save
After that you can flush your firewall rules using the command
MySQL Socket Error in phpMyAdmin
While accessing phpMyAdmin, you may get the following error.
#2002 - The server is not responding (or the local MySQL server’s socket is not correctly configured)
This is due to the missing socket file in the location /tmp.
The socket path which is specified in the phpMyAdmin configuration file is /tmp/mysql.sock.
$ vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
cfg['Server']['socket'] = ‘/tmp/mysql.sock’;
If mysql.sock is missing in /tmp, then create a link to the mysql.sock file in /var/lib/mysql.
$ ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
There is also another fix for this issue.
1. Open the phpMyadmin config file “config.inc.php”.
vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
2.Locate the line:
$cfg['Servers'][$i]['host'] = ‘localhost’;
3.Replace ‘localhost’ with ‘127.0.0.1′ and save.
$cfg['Servers'][$i]['host'] = ‘127.0.0.1′;
This will also fix the issue.
Round Cube Installation
Remove the previous traces of Roundcube in the server.
cd /usr/local/cpanel/base
rm -rf roundcube*
mysql
mysql>drop database roundcube;
Before starting the installation, you need to know the root password of Mysql
cd /usr/local/cpanel/base
wget http://easynews.dl.sourceforge.net/sourceforge/roundcubemail/roundcubemail-0.1beta2.1.tar.gz
tar -zxvf roundcubemail-0.1beta2.1.tar.gz
mv -f roundcubemail-0.1beta2 roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs
Create the database. Find mysql root password from /root/.my.cnf.
Login as user, root.
mysql -u root -p
Password:
mysql>CREATE DATABASE roundcube;
mysql>use roundcube;
mysql>source SQL/mysql.initial.sql;
mysql>quit
Add the configuration:
cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php
Edit the configuration files
using your text editor edit db.inc.php
Find:
$rcmail_config[’db_dsnw’] = ‘mysql://roundcube:pass@localhost/roundcubemail’;
Replace with:
$rcmail_config[’db_dsnw’] = ‘mysql://root:rootpass@localhost/roundcube’;
#vi main.inc.php
Replace the corresponding root password
Find:
$rcmail_config[’default_host’] = ”;
Replace with:
$rcmail_config[’default_host’] = ‘localhost’;
Configure cPanel to show roundcube in the theme. X theme(default) only!!
cd /usr/local/cpanel/base/roundcube/skins/default/images/
cp roundcube_logo.png /usr/local/cpanel/base/frontend/x/images/roundcube_logo.png
cp roundcube_logo.png /usr/local/cpanel/base/webmail/x/images/roundcube_logo.png
wget http://www.yourserverguide.com/Files/HGpatch-roundcube-1.0BETA2.1
patch -p0 < HGpatch-roundcube-1.0BETA2.1
If you receive a message stating: Reversed (or previously applied) patch detected! Assume -R? Please press N for No as this is because you previously installed roundcube
This will auto do all the necessary changes to roundcube and the X theme. Once the patch is executed you may now access roundcube via http://yourdomain/webmail
Upgrade Perl to 5.8.8 (Cpanel 11.4.2)
The cpanel 11 requires perl version 5.8.8. To upgrade the perl version in the server you can use following steps:-
1. Download perl 5.8.8 using following link:-
# wget http://layer1.cpanel.net/perl588installer.tar.gz
2. Untar the tar package using following command
# tar -vzxf perl588installer.tar.gz
3. Then Install
# cd perl588installer
# ./install
Once this has completed, execute the following to ensure that all modules required by cPanel are installed, and restart cPanel:
/usr/local/cpanel/bin/checkperlmodules
/usr/local/cpanel/startup
4. Check and confirm the perl version using the command:
Alternative PHP cache (APC)
Alternative PHP Cache (APC) is a PHP extension for caching data and compiled code from php accelerator. It helps to improve the performance of the webserver. The steps to install APC in cpanel are as follows:
Get the latest version of APC from http://pecl.php.net/package/APC
# cd /usr/local/src
# wget http://pecl.php.net/get/APC-3.0.14.tgz
# tar -zxvf APC-3.0.14.tgz
# cd APC-3.0.14
You can find the path of phpize and php-config using which command.
#which phpize
#/usr/local/bin/phpize
#which php-config
#/usr/local/bin/php-config
Now use these details to complete installation.
# /usr/local/bin/phpize
# ./configure –enable-apc –enable-apc-mmap –with-apxs –with-php-config=/usr/local/bin/php-config
# make
# make install
Add the following lines within the Dynamic Extensions section of php.ini as given below.
extension=apc.so
apc.shm_size = 32
After make install, you will get the extension path like this,
extension=”/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so”
confirm whether extension directory is defined in php.ini.
extension_dir = “/usr/local/lib/php/extensions/no-debug-non-zts-20020429″
If not you should give the full path in php.ini instead of just ‘extension=apc.so’. Like this,
extension=”/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so”
Restart httpd. Now you can see the apc section enabled in phpinfo() page.