Upgrade phpmyadmin

Go to http://www.phpmyadmin.net/home_page/ and download the latest stable version.
Backup the config.inc.php file currently on the server.
Use the configuration values from your old config.inc.php file to correctly configure the new config.inc.php
Re-name your existing “PhpMyAdmin” directory something like “PhpMyAdmin.old”
Create a new “PhpMyAdmin” directory.
Upload the new files into the new “PhpMyAdmin” directory
Copy the .htaccess file from the old directory and use it for the new directory
Log into your new phpMyAdmin.

Resize /tmp in cpanel servers

service chkservd stop
service httpd stop
service mysql stop
service postgresql stop

lsof | grep /tmp

kill the process

umount /var/tmp

umount /tmp

vi /scripts/securetmp

replace “256000” with “512000”

rm -rf /usr/tmpDSK
/scripts/securetmp –auto

cd /tmp

ln -s /var/lib/mysql/mysql.sock

service postgresql start
service mysql start
service httpd start
service chkservd start

Change Mail Server IP

Sometimes your server’s IP address may get black listed by most of RBLs. In such situation a quick solution is to route the emails through a secondary IP address on the same server which is not black listed. There are two options to switch the mail server IP.

1. In Cpanel:

Login to WHM

Click Exim Configuration Editor

Check the box next to:
“Send outgoing mail from the ip that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface)”

Save Changes

Then edit the file /etc/mailips
vi /etc/mailips

and add:

*: newIP

Restart exim

or

2. Through Shell

vi /etc/exim.conf

Locate remote_smtp

Change as per below:

remote_smtp:

driver = smtp

#interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch{/etc/mailips}{$value}{}}}{}}
#helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_ho stname}}

interface = 111.222.333.444 # Change to your server IP address.

Save changes and exit.

Restart Exim

The perl module Encode::Detect::Detector could not be installed

Change the current cpanel version to stable :

vi /etc/cpupdate.conf
CPANEL=stable

/scripts/upcp –force

/scripts/perlinstaller –force Encode::Detect::Detector

If that doesn’t work, please try

/scripts/autorepair encodedetectfix

No luck? then do:

type cpan and from cpan mode type below.

install Detect::Module

If none of the above solution worked, then  there is a temp workaround for manual install.

wget http://search.cpan.org/CPAN/authors/…ct-1.00.tar.gz
unpack it
perl Makefile.PL
vi Detector.xs

Add this patch to Detector.xs

*** 38,43 ****
#define PERL_NO_GET_CONTEXT /* we want efficiency */
#include .EXTERN.h.
#include .perl.h.
+ #undef HASATTRIBUTE_UNUSED
#include .XSUB.h.
}

Then run Build, make etc.

Script used to transfer account from cpanel server

#!/bin/bash

ls -1 /var/cpanel/users > /root/user_list

PORT="22"

ssh-keygen -t dsa

KEY=`cat /root/.ssh/id_dsa.pub`

ssh $1 -p$PORT "mkdir -p /root/.ssh;echo ${KEY} >> /root/.ssh/authorized_keys" 2>&1
scp /var/cpanel/packages/* $1:/var/cpanel/packages/

for user in $(cat /root/user_list);do /scripts/pkgacct $user;done
scp /home/user_list $1:/home
scp /home/cpmove* $1:/home

Script used to correct permission of files after suphp

#!/bin/bash

# For some stupid reason, cPanel screws up the directory permissions.
chmod 755 /opt/suphp
find /opt/suphp -type d -exec chmod 755 {} \;

# Ensure that the permissions are sane and won’t cause a 500 error.
for user in `/bin/ls /var/cpanel/users`; do

chown -R ${user}:${user} /home/${user}/public_html
chmod 755 /home/${user}/public_html
find /home/${user}/public_html -name “*.php” -exec chmod 644 {} \;
find /home/${user}/public_html -type d -exec chmod 755 {} \;

# Comment out Joomla-installed PHP overrides that are not compatible with suPHP.
find /home/${user}/public_html -name ‘.htaccess’ -exec sed -i -e ‘s/php_value/#php_value/’ {} \;
find /home/${user}/public_html -name ‘.htaccess’ -exec sed -i -e ‘s/php_flag/#php_flag/’ {} \;
done

# Delete former session variables due to suPHP no longer having permission to them.
rm -rf /tmp/sess_*