How to restore a crashed directadmin server

Please follow the procedure to restore a crashed directadmin server. It is based on Centos.

1) Install direactadmin and configure apache, php, mysql with same version/settings as in old server

2) Mount the old HDD under /old . If you have /home or any other partition in old server , please mount it under /old/

cp -avprf  /old/etc/passwd  /etc/
cp -avprf  /old/etc/group /etc/
cp -avprf  /old/etc/shadow /etc/
cp -avprf  /old/etc/gshadow /etc/
cp -avprf  /old/etc/my.cnf /etc/
cp -avprf  /old/etc/exim*  /etc/
cp -avprf  /old/etc/hosts  /etc/
cp -avprf  /old/etc/httpd/conf/* /etc/httpd/conf/
cp -avprf  /old/etc/named.conf /etc/
cp -avprf  /old/etc/proftpd.conf /etc/
cp -avprf  /old/etc/proftpd.passwd /etc/
cp -avprf  /old/etc/proftpd.vhosts.conf /etc/
cp -avprf  /old/etc/resolv.conf /etc/
cp -avprf  /old/etc/system_filter.exim  /etc/

cp -avprf  /old/usr/local/directadmin/conf  /usr/local/directadmin/
cp -avprf /old/usr/local/directadmin/plugins /usr/local/directadmin/
cp -avprf /old/etc/mail  /etc/
cp -avprf /old/etc/virtual /etc/
cp -avprf  /old/var/named /var/
cp -avprf  /old/var/spool/cron /var/spool/
cp -avprf  /old/var/spool/virtual /var/spool/
cp -avprf  /old/var/www /var/
cp -avprf  /old/usr/local/directadmin/data /usr/local/directadmin/

cp -avprf /old/var/lib/mysql  /var/lib/
cp -avprf /old/home/*  /home/

3) Now compile apache and php using the directadmin custom build script

4) Test your websites

How to install Cloud Linux In Centos cPanel Server

How to Convet Centos to Cloud Linux In cPanel Servers

Options 1 : IP address-based CloudLinux license

If your server have an IP based Licenses. Then you need to run the following script .

# /usr/local/cpanel/scripts/upcp -- force

This will automatically convert your Centos to Cloud Linux

Now reboot your server into Cloud liunx

# reboot

Option 2 : CloudLinux license key

If you own a key based license from Cloud linux then you need to do it as follows,

# wget
# sh cldeploy -k $key     #Replace $key with your license key. 
# /usr/local/cpanel/scripts/upcp -- force
# reboot

Memcached Server Installation for Vbulletin and wordpress

Memcached is a memory caching system. This will help to increase speed of your vbulletin or wordpress wesites. You can install it easily as follows,

Download the memcached server from

 wget -c
 tar -xzf  memcached-1.4.15.tar.gz
 cd memcached-1.4.15/
 yum -y install libevent libevent-devel
 ./configure --prefix=/opt/memcached
 make install

Now install init script . I wrote an init script for redhat and centos servers , you can use it to start/stop memcached.

 wget -c
 mv -f memcached.redhar.rc.txt /etc/init.d/memcached
 chmod 750 /etc/init.d/memcached
 mkdir /var/run/memcached
 /etc/init.d/memcached start
 chkconfig --add memcached
 chkconfig memcached on

Install php-pecl memcache

Download the latest stable memcached from

wget -c
 tar -xzf  memcache-2.2.7.tgz
 cd memcache-2.2.7/
 make install

Now restart apache and create a phpinfo page and test whether the memcache options is showing or not. If it is there then you installed php module . If not you need to check your php.ini settings and enable memcache module

Vbulletin Configuration

Edit the Vb configuration file includes/config.php and uncomment the following lines

$config['Datastore']['class'] = 'vB_Datastore_Memcached';
$i = 0;
// First Server
$config['Misc']['memcacheserver'][$i]           = '';
$config['Misc']['memcacheport'][$i]                     = 11211;
$config['Misc']['memcachepersistent'][$i]       = true;
$config['Misc']['memcacheweight'][$i]           = 1;
$config['Misc']['memcachetimeout'][$i]          = 1;
$config['Misc']['memcacheretry_interval'][$i] = 15;

Now restart apache server . Your vbulletin now works with memcached. You can see the performance difference within 1 to 2 hours.

WordPress Configuration

You may just install the wordpress memcached plugin and configure it from wordpress admin panel

how to disable open_basedir protection in plesk control panel

This small article tell you how to disable open_basedir protection in your plesk server. For example you own a domain say in your plesk server. Then do the following steps,

1) Create a vhost.conf as follows,

 touch  /var/www/vhosts/

2) Now edit this vhost.conf and add the following lines.

php_admin_value open_basedir none

3) Now tell psa to reconfigure httpd settings and restart httpd

   /usr/local/psa/admin/sbin/websrvmng -v -a

Now you can create a phpinfo page and test it .

How to upgrade php in plesk

It is easy to upgrade php in plesk as follows,

wget -q -O - |sh
yum upgrade php-cli -y
yum upgrade php-devel -y
/etc/init.d/psa stop
/etc/init.d/psa start
/etc/init.d/httpd restart

Thats it 😀

cPanel + ERROR: This RRD was created on another architecture

Your will get this error during cpanel account transfer time  or with cpanel package account script. To fix this issue do the following bash script

cd /var/cpanel/bandwidth
for i in `/bin/ls ./*.rrd`

/usr/local/cpanel/3rdparty/bin/rrdtool dump $i > $i.xml

if [ -s "$i.xml" ]
        echo "$i.xml have valid  data."
        /usr/local/cpanel/3rdparty/bin/rrdtool restore -f $i.xml $i

        echo "$i.xml is empty. So not possible to restore"    
        rm -vf $i $i.xml