PART B SHOWS YOU HOW TO UPGRADE CPANEL TO WORK WITH REDHAT 9
Last updated: 6th December 2003
This How-To is based on newuser's one here:
http://forum.rackshack.net/showthread.php?...?threadid=29540
and nuclear's one here:
http://forum.rackshack.net/showthread.php?...?threadid=24433
All credit goes to the both of them. My How-To uses the methods of both of them, and it is working brilliantly for myself. I thought I would share my hybrid method as well, since there is some interest from some members. I apologize if I am repeating a few things of what has already been said. It is noted that the above 2 How-To's do not describe all the necessary steps, which I will try to include here. My How-To therefore incorporates the 2 How-To's above, by including steps from both of them in a sequential manner that works, as well as documenting steps that were not mentioned in either of them, as well as mentioning potential errors that may arise and how to fix them.
Before you start, remember:
1) You need to BACK UP all data before attempting this, in case you do something irreversible.
2) You need to give yourself at least 4 hours just in case. If all goes well this should not take more than 2 hours. It took me 4 hours as I had to do things by trial and error.
3) If something goes wrong, DO NOT GIVE UP. I encountered at least 20 errors, and had to repeat certain steps at least 5 times to get it right. AS LONG AS YOU HAVE SSH ACCESS, YOU CAN FIX IT. Do not be too quick to order a restore - keep persisting if you encounter an error. I will try to document all the errors I came across.
4) If you are a newbie, don't try this. This is not for the novice, as errors WILL happen - it's a matter of fixing them.
At the end of this:
You should be running RH 9 with the latest version of cPanel.
Let's begin...
PART A: UPGRADING REDHAT FROM 7.3 TO 9 - THIS APPLIES TO ANY SERVER
1) Log in as root in SSH
2) Move your Apache log directory by running this command - we will be moving it back at the end (REMEMBER to move it back or apache won't restart):
mv /etc/httpd/logs /etc/httpd/logs2
3) Download and install apt - we will use this to upgrade from 7.3 to 9.0 - (alternatively, you can use up2date or yum, but apt worked for me - apt is a cool app ported from Debian) I found that it is possible to go straight from 7.3 to 9.0:
wget http://www.oktagone.net.au/files/apt-0.5.5...rh73.2.i386.rpm
rpm -i apt-0.5.5cnc5-fr0.rh73.2.i386.rpm
4) Edit the apt source list:
pico /etc/apt/sources.list
Comment out the 7.3 bits, and uncomment the 9 bits so that RH 9 will be installed. Save the file.
5) Upgrade using apt now by running the following commands:
apt-get update
apt-get dist-upgrade
You may need to run this to fix dependency problems as per instructions given to you by apt:
apt-get -f install
Only run it if you are told to do so.
If you get this error:
file /usr/bin/pear from install of php-4.2.2-17.2 conflicts with file from package php-devel-4.1.2-7.3.6
E: Sub-process /bin/rpm returned an error code (156)
Run this:
rpm -e php-devel-4.1.2-7.3.6
Then run this again:
apt-get -f install
It should now work. Once you have run it, run the first 2 commands again:
apt-get update
apt-get dist-upgrade
You may need to do the above a couple of time. When you get no errors, and start downloading between 100-250 Mb of RPMs for RH 9, that's when apt is upgrading your box. This can take 30-60 minutes.
6) Okay, your box now has Red Hat 9 on it. However, your kernel is still 7.3. So what do we do? We upgrade our kernel using up2date. At the same time, we make sure we have all the latest RPMs etc. for RH 9 from RHN as well.
You must first import the RHN security key with this command:
rpm --import /usr/share/rhn/RPM-GPG-KEY
7) Now, configure up2date to enable kernel upgrades by running this:
service named start
up2date --configure
Look for "pkgSkipList" and remove "kernel" from it by pressing on "C" to clear it so that kernel is NOT skipped.
up2date -uv
up2date -p (Do not skip this command to update packages list, or else cPanel will not upgrade properly I found to my detriment)
up2date -uv
lilo -v -v
sync
9) Okay, time to reboot the box! Here's where you start praying.
reboot
10) Okay, that was the EASY bit. Your box now should be running RH 9 with the latest kernel. To check, log back in as root in SSH and run the following:
uname -r
2.4.20-24.9smp
cat /etc/redhat-release
Red Hat Linux release 9
CONGRATULATIONS - Your box now has Red Hat 9 installed! However, this is just the halfway mark.
PART B: UPGRADING CPANEL ON YOUR REDHAT 9 BOX
11) Time to upgrade cPanel, and recompile Apache. Here is where the headaches will begin. If you follow the following method, I hope you get less problems than I had to overcome.
ln -s /usr/lib/libpng.so.3 /usr/lib/libpng.so.2
rm /etc/httpd/logs
mv /etc/httpd/logs2 /etc/httpd/logs
You are basically fixing linbpng so that linuxconf/linuxhooks works, and moving the Apache log directly back to where it belongs. It is important to do these things first.
12) Upgrade cPanel. Using /scripts/upcp did not work for me, so it's best to use the following method instead:
wget layer1.cpanel.net/latest
sh latest
The above should start installing cPanel. This will also install a basic Apache, PHP setup. IT WILL NOT REPLACE YOUR CPANEL SETTINGS. So don't worry.
If the above starts installing cPanel 7.3 components instead of cPanel 9 components, run this again:
up2date -uv
up2date -p
up2date -uv
Then run step 12 again.
If that doesn't work, then try running this again:
apt-get update
apt-get dist-upgrade
Then run step 12 again.
If that still doesn't work, edit the redhat-release file and change:
Red Hat Linux release 9 (Shrike)
to:
Red Hat Linux release 9
In other words, remove (Shrike).
Then run step 12 again.
If that still doesn't work, then run this:
/scripts/distupgrade
Cpanel should then be upgraded properly.
13) Recompile Apache by running the following, and choosing your Apache and PHP modules:
/scripts/easyapache
Apache should restart automatically. If it doesn't start again, we are faced with an error.
a) libssl error
One error that I kept getting was this:
error while loading shared libraries: libssl.so.2: cannot open shared object file: No such file or directory
To fix this, I had to run apt again:
apt-get update
apt-get dist-upgrade
This will only reinstall mod_ssl again. Once this is done, try restarting apache first:
service httpd restart
If that didn't work, recompile apache:
/scripts/easyapache
If that still doesn't work, try running up2date:
up2date -uv
up2date -p
up2date -uv
That should fix it. If that still doesn't work, the you need to reinstall modssl manually by installing this file:
openssl096b-0.9.6b-6.i386.rpm
Another error:
b) httpd logs not found etc.
This should not happen if you delete the log directory and move the original log directory back.
14) Once cPanel and Apache are done, you can access your WHM. If you cannot access WHM in secure mode, but you are able to in unsecure mode, then you need to do this:
a) Run WHM in unsecure mod
b) Reset SSL for WHM/ cPanel by clicking the option in the left column
c) WHM should run now in secure mod again
d) Change your Root password just in case
15) IMAP may refuse to start for you. If this is the case, this is how to fix it:
edit /etc/xinetd.d/imap
Replace this line:
server = imapd
With this line:
server = /usr/sbin/imapd
Then restart IMAP:
service xinetd restart
16) EXIM may not restart at the end of all this. It was fine for me, but for some users it did not start up properly or was not installed. If this is the case for you, run this:
/scripts/exim4
Okay, that should be it. If I can remember anything else, I will post it here. I hope this helps someone else. The above did work for me.
Remember, as long as you have SSH access, NEVER GIVE UP.
I will keep updating this first post as other members post their tips and ways to fix their own errors in this thread.