Archive for the ‘Cpanel’ category

Setting up Nameservers in cpanel.

November 27th, 2009

Seems like there are a lot of request for a HOW-To for Nameserver setup. This walk through will show you how to do this.

Special Notes:
Some version of WHM/CPanel come with broken NDC. To fix this:

SSH into your box as root.

(a) Type: cd /scripts
(b) Type: ./updatenow
(c) Type: ./fixndc
(d) Type: service named stop
(e) Type: service named start

********************************************

1. Setup Nameservers In WHM
Go into WHM (Web Host Manager) and select Edit Setup from the Server Setup menu on the left. Enter ns1.newdomain.com in the Primary Nameserver field. Hit ‘Assign IP Address’ (write the IP down or remember it for the next step). Then hit ‘Add an A Entry for this nameserver’.

Repeat this process for the Secondary Nameserver field.

2. Register Nameservers
Go to your domain registrar and register ns1.yourdomain.com (111.111.111.111) and ns2.yourdomain.com (222.222.222.222) as nameservers. 111.111.111.111 being the primary nameserver IP from step 1 and 222.222.222.222 being the secondary.

These registrations may take a few days to propagate (often as many as 3 days).

3. Reverse DNS
You may need Burstnet to enter a reverse DNS pointer (PTR Record) for your nameservers. You’ll need to let them know each nameserver and its IP address. Sometimes you can suffer non-delivery of mail if you don’t so this. Reverse DNS pointers can take a while to propagate. Send an email to support@burst.net with the following…

To: support@burst.net
From: <Your Address>
Subject: PTR Request

Please create the following PTR records.
123.123.123.123 – server.mydomain.com (Main Server IP)
111.111.111.111 – ns1.mydomain.com (This of course being your info)
222.222.222.222 – ns2.mydomain.com

4. Tidy Up Junk Nameservers
Go into WHM (Web Host Manager) and select Manage Nameserver IPs from the Server Setup menu on the left. Remove any nameservers you don’t recognise. This is just a tidy up exercise in case anyone’s set anything up on the box before you.

5. Initial Nameserver Setup
Go into WHM (Web Host Manager) and select Initial NameServer Setup from the Server Setup menu on the left.

6. Restart BIND
Restart BIND from SSH with (step 5 restarts BIND, but sometimes needs a proper stop and start for it to work):

service named stop
service named start

7. Manual Checks
This process doesn’t always work, so there are some things you can check manually via SSH.

pico or nano or vi /etc/wwwacct.conf
Check that the nameservers are correctly specified on NS1, NS2 etc.

pico or nano or vi /etc/resolv.conf
Check that there are nameserver entries for each IP. There may also be one for 127.0.0.1 – this is okay.

Should read as follows:

domain maindomain.com
search maindomain.com
nameserver 127.0.0.1
nameserver 111.111.111.111
nameserver 222.222.222.222

Where ‘maindomain.com’ is the main domain of my server, and ‘111.111.111.111′ and ‘222.222.222.222′ are the IP addresses of my primary and secondary nameservers.

pico or nano or vi or nano or vi /etc/nameserverips
Check that there are entries for each IP acting as a nameserver.

How to restore a Cpanel backup to a different server.

November 14th, 2009

This tutorial explains a simple, straightforward method for migrating cPanel accounts from one server to another. You can use this method to transfer accounts from an old server to a new one, help customers from another host move to your host, etc. This does not even require root access on one end of the migration. Basically, this is a more reliable method than the “Transfer Account from another Server” tool in WHM, which rarely works.

Requirements:
- cPanel on both servers
- WHM access on the new server (one that the accounts are being moved to)
- root access on the new server

Definitions
The server you are transferring the accounts from = “old server”
The server you are transferring the accounts to = “new server”

Instructions
1. Log into WHM of your new server and create a new account called “restore”, or anything you like for that matter. Remember the FTP address, username (‘restore’, in this example), and account password. We will need these for later.

2. Log into the cPanel account you are wanting to transfer on the old server.

3. Click on “Backup >> Generate/Download a Full Backup”.

4. Once here, select the backup destination to be “Remote FTP Server”.

5. Enter your email address for verification, followed by all of the FTP account information for “restore”, which we created on the new server.

-Remote Server: new server’s address
-Remote User: restore
-Remote Password: restore’s password
-Port: 21

Then, click “Generate Backup”. This may take some time to backup the files, depending on how large the account is. You should receive an email provided in the above info once it is complete.

6. Now, log into SSH on your new server.

7. Type in the following commands:

cd /home/restore/public_html

ls

After running the list command above (ls), you should see the tar file of the account on the old server. This means that you have successfully sent the file via FTP to your new server.

8. Now move the tar file to your new server’s /home directory with the following command:

mv tar_file_name /home

9. Now, log into WHM on your new server and navigate to “Backup >> Restore a Full Backup/cpmove file”

Once here, you should see the old account’s username under “Possible cpmove archives found:”.
If you do not, log back into SSH and be sure that the account’s tar file has been moved into /home.

10. Type in the account name in the text field in WHM, which is proceeded by “Enter the username for the account you wish to restore:”.

11. Click “Restore”.

12. Repeat process for additional accounts.

Correct Cpanel’s Easyapache Update Error

October 1st, 2009

If you’ve every attempted to upgrade / update cpanel via easyapache via the control panel or shell access and return the following erorr, changes are the rpm database is corrupt and needs to be rebuilt;

!! Package system can not be repaired automatically !!
!! Please visit http://www.cpanel.net/support/could_not_ensurepkgs.htm for help with this error. !!
!! Restoring original working apache !!

To correct this, you simply need to check to make sure that yum and any rpm’s are not running by doing the following;

ps auxwww | grep yum
ps auxwww | grep rpm

After that, you need to do the following;

rm /var/lib/rpm/__db.* -rf
rpm -rebuilddb

This will rebuilt the rpm database and depending on what needs to be updated it can take some time to update. Once this is done however you should be able to run easyapache without error.

Accounts missing from WHM (Cpanel)

July 14th, 2009

If you notice that an account is missing from your WHM instance and you’ve already attempted to fix this by running /scripts/rebuildcpusers (you have tried this, correct?), then the issue lies in the /etc/trueuserdomains file. To correct this you will need to manually edit this file (using VI, Nano, Pico) and add the domain and the user account assigned to that domain. For example;

My user is Myuser(it really isn’t) and the domain is Mywebsite.com. I would edit this in the file by added it as such:

Mywebsite.com: Myuser

Once this is done, save the file and restart cpanel. Once you access WHM, the directory will appear again.

Mysql fails to start on a Cpanel linux server.

February 7th, 2009

If mysql service is failing upon start, you will have to place the following code in /etc/my.cnf under ‘mysqld’ section and restart mysql service.

skip-innodb” (Do not add the quotes).