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_*

Recompile Perl in Cpanel servers

To check what is the perl version on your system, use:

perl -v

This is perl, v5.8.7 built for i686-linux

If you need to upgrade your perl installation without breaking your CPanel, please follow this method.

wget http://layer1.cpanel.net/perl588installer.tar.gz
tar xfz perl587installer.tar.gz
cd perl587installer
./install

After this is done, run:

/scripts/upcp

You can also run the following to ensure that all the necessary modules were reinstalled:

/usr/local/cpanel/bin/checkperlmodules

Once you have completed the upgrade, you can check again the perl version (perl -v) to ensure that this was properly installed.

Redirect Loop in Cpanel servers

It seems the issue is in the .htaccess file creation:

it looks like this:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^.*?$ "http\:\/\/domain\.com\/subdir" [R=301,L]

instead of this:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^/?$ "http\:\/\/domain\.com\/subdir" [R=301,L]

Stop Open Relay of Exim

Telnet to yourmailserver at port 25 and issue all the following commands:

——————————————————–

telnet hostname/ip 25

helo client.server.com

mail from: xxx@somedomain.com

rcpt to: yyy@somedomain.com

——————————————————–
If you are getting the error “554 : Relay access denied” then the server is not an open Relay

If not Just pass the command “DATA” sfter the recipient and then enter the message ending with a period ie : “.”

If you get the reply “SUCCESS Relay Accepted – final response code 550″

Then as you feared your server is subjected to open relay and if not enjoy………. It is not

I hope your server is not open relay supporting, but if it is so, as it is a Cpanel Server you can stop it normally using the below scripts

—————————————–

/scripts/fixrelayd

/etc/rc.d/init.d/antirelayd restart

service exim restart

—————————————–