Reply
Old April 14th, 2007 Last edited by LordOfLA; May 25th, 2007 at 6:09am. Reason: Left my grammar and punctuator at home that day... | Top | #1

OSNN Subscriber  
LordOfLA's Avatar
Godlike!
Joined: February 2004
Location: Birmingham, UK
Posts: 6,818
Blog Entries: 5
Reputation: 3651
Power: 179

Talking How to restore cPanel on your dedicated server!

I offered in the frontpage team to come up with some hosting targeted guides, so here's one I worked with on one of the customers of the datacentre I work at here in London.

This will help you out in a number of ways.

If your server has been hacked (very likely with the current favourite combo of Centos 4.4/cPanel neither of which are very good with security updates and running current patched builds).

Your disk failed and ext3 keeps locking the machine up.

I will assume you either have no backup, or an out of date backup or some critical work was recently performed.

You will see alot of the so-called "third party managment" companies offering this service for around $50 a pop. Now based on what I have seen of the abilities of the so called "leaders" of this industry I think a newborn would stand a strong chance of doing a better job so be careful if you have a dedicated server and you are looking for a third party to assist with the day to day operations of your server.

Most datacentres will do day to day managment for you but you are looking at a price at least 3 times higher than when left to fend for yourself.

Any way on to the guide.

You will need your datacentre to clean install your OS and cpanel on a new disk and install the original as a second disk (if you already have an additional disk they can remove it as you can repurpose your existing disk after following through with this.)

If you are doing this as a result of a disk failure and the filesystem was ext3, you should mount the partition as ext2 to avoid having the ext3 journal code triggereing a kernel panic and killing the machine.

The rest is just simple copy and paste (check man pages on commands for a detailed explanation of the options, for this guide I will simply say that the commands perform a recursive copy, overwriting existing files, maintaining permissions and ownership while forcing a yes reply to all "are you sure" prompts)

First backup existing data

cp -Rfpv --reply=yes /etc /etc_backup
cp -Rfpv --reply=yes /home /home_backup
cp -Rfpv --reply=yes /var /var_backup
cp -Rfpv --reply=yes /usr/share/ssl /usr/share/ssl_backup
cp -Rfpv --reply=yes /usr/local/apache /usr/local/apache_backup
cp -Rfpv --reply=yes /usr/local/cpanel /usr/local/cpanel_backup
cp -Rfpv --reply=yes /usr/local/cpanel-rollback /usr/local/cpanel-rollback_backup

Now restore cpanel. /old_disk/ is assumed to be where to old disk is mounted adapt accordingly

cp -Rfpv --reply=yes /old_disk/etc /
cp -Rfpv --reply=yes /old_disk/home /
cp -Rfpv --reply=yes /old_disk/var /
cp -Rfpv --reply=yes /old_disk/usr/share/ssl /usr/share/
cp -Rfpv --reply=yes /old_disk/usrlocal/apache /usr/local/
cp -Rfpv --reply=yes /old_disk/usr/local/cpanel /usr/local/
cp -Rfpv --reply=yes /old_disk/usr/local/cpanel-rollback /usr/local/

Check that /usr/local/apache/conf/httpd.conf has all the virtual hosts listed. If not run the following:
/scripts/rebuildhttpdconf >> /usr/local/apache/conf/httpd.conf
Then do the following:

/scripts/upcp --force
/scripts/fixeverything
/etc/init.d/ipaliases restart
Login to whm and rebuild apache.

Check everything works


You have now saved yourself $50 or you can pay me $50 to perform the same copy and paste job that you can



If HK-47 and GLaDOS had a child, the character they create would cause the video game world to overdose on awesome. -sheridanmovieguy: Dragon age forum user.
LordOfLA is offline   Reply With Quote
Old April 15th, 2007 Top | #2

OSNN Folding Team  
Grandmaster's Avatar
Electronica Addict
Joined: February 2002
Location: Santa Clara, CA
Posts: 10,692
Reputation: 2960
Power: 234

Default Re: How to restore cPanel on your dedicated server!

Great start Mark

I'm sure there are many people that there that will find this very useful.


Grandmaster is offline   Reply With Quote
Old April 28th, 2007 Top | #3

OSNN Subscriber  
LordOfLA's Avatar
Godlike!
Joined: February 2004
Location: Birmingham, UK
Posts: 6,818
Blog Entries: 5
Reputation: 3651
Power: 179

Default Re: How to restore cPanel on your dedicated server!

Glued for easy access in the event the frontpage gets its guides section



If HK-47 and GLaDOS had a child, the character they create would cause the video game world to overdose on awesome. -sheridanmovieguy: Dragon age forum user.
LordOfLA is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
read only files after restore (server 2003) Mainframeguy Windows Server Systems 11 July 4th, 2007 5:09pm
What is needed for a Halo Dedicated Server, or a CSS dedicated server? Vanquished PC Gaming 10 January 26th, 2007 5:43pm
[Wanted] Dedicated Server Host kcnychief Web Design & Coding 27 June 28th, 2006 11:48pm
Counter-Strike Dedicated Server Lag When I join _DM_ PC Gaming 6 June 29th, 2003 11:12pm
Statsme without dedicated server adamg PC Gaming 3 June 23rd, 2003 5:58am