Roundcube : failed to open log file /var/log/httpd/suexec_log

While working on a issue for one of the client, I found that the Webmail link was giving 500 internal server error for Roundcube and checking the apache error logs I was getting the below errors ::

failed to open log file /var/log/httpd/suexec_log
fopen: Permission denied
[Mon Aug 18 16:50:08 2014] [warn] [client x.x.x.x] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Mon Aug 18 16:50:08 2014] [error] [client x.x.x.x] Premature end of script headers: index.php

Further checking , I’ve found that the below file was missing ::

/var/www/cgi-bin/cgi_wrapper/cgi_wrapper

So, I’ve copied that file from one of my other server and restarted apache service and this fixed the issue with  500 internal error for roundcube.

Note :: The cgi_wrapper file should have 755 permission with ownership of root:root.

Easy isn’t it.

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