Simple shell script to check if a Host is UP

If you work on multiple servers and want to check what hosts are up/down then you can use the below shell script to  test multiple servers  connectivity ::

#!/bin/bash
# test1.txt should contain a list of IP's to be tested
for i in `cat test1.txt`;
 do
ping -c 1 -W 1 $i &> /dev/null
if [ $? -ne 0 ]; then
#use if [ $? -eq 0 ]; then to test the up IP's
echo "$i is down"
fi
 done

That’s all.

Install PDFlib-Lite and PDFlib on cPanel

PDFLIB is a freely available library, used for creating and manipulating files in  Portable Document Format [PDF].
Using PDFLIB you can create ynamic PDF documents on your webserver.

Follow the below simple steps to install PDFlib-Lite and PDFlib ::
Continue reading Install PDFlib-Lite and PDFlib on cPanel

mcrypt installation on php5.3.x

If you want to install PHP-mcrypt extension with PHP 5.3.3 or PHP 5.3.x version then follow the below simple steps ::

 root@server[#] yum install php-devel libmcrypt libmcrypt-devel gcc gcc-c++
 or
 root@server[#] yum install php53-devel libmcrypt libmcrypt-devel gcc gcc-c++
 root@server[#] cd /usr/local/src/
 root@server[#] wget http://museum.php.net/php5/php-5.3.3.tar.gz
 root@server[#] tar -zxvf php-5.3.3.tar.gz
 root@server[#] cd php-5.3.3/ext/mcrypt/
 root@server[#] phpize
 root@server[#] aclocal
 root@server[#] ./configure
 root@server[#] make
 root@server[#] make test
 root@server[#] make install

Continue reading mcrypt installation on php5.3.x

Multiple Shared IPs in WHM

As we all know that there is no  direct option available in cPanel/WHM  to create multiple shared IP’s and assigning dedicated IP for each domain is not feasible as it will cost you a lot of money.

So, you need to create multiple shared IP’s to  distribute 1 IP  between  many domains and here is how you can achieve this with cPanel  servers ::

Create a directory called /var/cpanel/mainips/, if it doesn’t exist
Continue reading Multiple Shared IPs in WHM

Base class package Cpanel::Easy::Utils::CloudLinux is empty

While executing EasyApache on one of my servers, I  was getting the error “Base class package “Cpanel::Easy::Utils::CloudLinux” is empty”  and I tried executing upcp  and /scripts/checkperlmodules –full –force but of no avail.

Further investigating on this, I have found that the file /var/cpanel/perl/easy/Cpanel/Easy/Utils/CloudLinux.pm was empty and hence EasyApache throwing the error “Base class package “Cpanel::Easy::Utils::CloudLinux” is empty”.

This can be easily fixed by following  the below simple steps ::
Continue reading Base class package Cpanel::Easy::Utils::CloudLinux is empty