Archive for the “Cpanel” Category

EasyApache is a pre configured script that allows you to easily update Apache Web server through WHM or SSH.
In this tutorial we will show you how to update apache using SSH /scripts/easyapache.

Requirements:
Root SSH access to your server

Login as root through SSH.
1) Login to your server and su - to root.

Run EasyApache
2) /scripts/easyapache
3) Now once you are logged in and have ran the script, you will be presented with an option to choose a profile. Seeing that this is your first time (or not) you will want to choose “Start customizing based on profile” and hit enter. You move by using the arrow keys and using the space bar or mouse to choose and option if you need to fill one out (later in the tutorial).

easyapache11

4) Your next screen will to choose what version of apache you wish to run. Depending on what version of cpanel you are running, your options will be different. In my instance, I am using 11.24, so I have the option for Apache 1.3, 2.0 or 2.2. Your choose will depend on if you need certain features of that version of Apache. However when in doubt, google it my friends. I’ll choose 2.0 for this instance.

easyapache2

5) The next step will to choose what version of php you wish to use. Keep in might that Apache is constantly upgraded, so it’s usually best to go with the newest version.

easyapache3

6) After you choose your php version, you will be presented with what revision you want. Once again, rule of thumb is the newest should be the one you choose, unless your program requires a specific version of php.

easyapache4

7) Now we get to choose several options for apache / php. Assuming that you don’t need frontpage for example, or you do want mod perl or Zend, you would choose what options you need. These are not the final options for apache / php however, this will be done on the next screen. Unlike the other screens where you selected next step to move on, here you can either finish the build by choosing save and build (which will use previous settings) or you can choose exhaustive options list, where you can customize apache /php. Choose the later to continue.

easyapache5

8) Finally, we can choose what options are available for apache / php. This can be several screens long, so make sure you scroll up and down to view all the options. Once you have selected what you need, hit the next step.

easyapache6

9) Now, after choosing all your options, you have the ability to either save the build but not running it or save the build and running it. Once you decide to save and build, this process takes 15-30 minutes to complete. Once it does complete, httpd will restart and the new settings will take place.

easyapache7

That’s it. Take note that you can also run Apache from inside of WHM/CP, but it uses more memory due to the GUI, so t’s recommended to do this via SSH, esspecially if you are on a VPS with less than 512MB of memory or a heavily trafficed server.

Tags: , , ,

Comments 1 Comment »

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 [email protected] with the following…

To: [email protected]
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.

Tags: ,

Comments No Comments »

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.

Tags: , ,

Comments No Comments »

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.

Tags: , , , ,

Comments No Comments »

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.

Tags: , ,

Comments No Comments »