How to Initially Configure Your Server via WHM (Part 2)

This is the continuation video on how to set up your server via whm. If you are new to WHM you may find yourself lost when trying to set up your server. This extensive video (2 of 2 parts) walks you through some of the most vital first steps and initial configurations for your server.

Your control panel interface may look or be organized differently than this video depending on the WHM/cPanel version and operating system you are using.

<< Back to Part 1


This tutorial will continue with the initial configuration of a cPanel server.


Skeleton Directory

  1. Click the Account Functions icon.

First, let's look at the Skeleton Directory.

The skeleton directory is the default directory structure (files and folders) that is used to create the structure of the accounts you create.

  1. Click the Skeleton Directory icon.

The system path to the location of the skeleton directory for the "root" user will be displayed on the top of the page.

Example:  /root/cpanel3-skel

To modify the skeleton directory, you simply create the directories, then upload the files you want copied to new accounts into this location by using either an FTP (or SCP) program or from the shell.

Unlike skeleton directories for resellers, the skeleton directory for the "root" user is not accessible via the file manager.  For security reasons, it is also recommended that FTP access be disabled for the "root" user.  It is recommended that you use a client that supports SCP to facilitate file transfers to directories that are only accessible to the "root" user such as the above.


Add the Account for the Primary Domain

Next, let's add the account for the primary domain.

  1. Click the Account Functions link.
  2. Click the Create a New Account icon.
  3. Enter the Domain.
  4. Enter a Username.

When we clicked on the username field, WHM autopopulates the field with a value based off of the domain.  We can change it to an alternate username of our choice.

  1. Enter a Password.
  2. Enter an Email address.
  3. Select a Package.

Reseller Privileges

Since we have access to WHM as the "root" user and can manage all accounts that way, we will not be granting reseller privileges to the domain user for our primary domain.

Overwrite any existing DNS zones for the account

Since this is a new server and due to the fact that there shouldn't be any existing zones for this domain, this option isn't necessary but we will enable it anyway.

  1. Check the box next to Overwrite any existing DNS Zones for the account.

Create the Account

  1. Click the Create button.

DNS Zone

Next, let's add the DNS records for our hostname and nameservers to the zone for our primary domain.

  1. Click the Home link.
  2. Click the DNS Functions icon.

Remove Preconfigured Zones

First, let's remove the separate zones that were preconfigured for these entries.

  1. Click the Delete a DNS Zone icon.

Because there was no zone for the domain when the server was provisioned, individual zones were created for the original hostname and the nameservers.  Since we now have a zone for the domain, we are going to remove these zones and then add the records we need to the zone for the domain to avoid conflicts.

Example zones to remove:

ns1.example.com
ns2.example.com
hostname.example.com

  1. Select the Zones to Delete. (Hold the CTRL key to add additional zones to the selection.)
  2. Click the Delete button.

It will list the DNS zones you are deleting.

  1. Click the Delete button.

Edit DNS Zone for Primary Domain

Now, let's add the records we need to our existing zone.

  1. Click the DNS Functions link.
  2. Click the Edit DNS Zone icon.
  3. Select the Zone to Edit.
  4. Click the Edit button.

Since our nameservers are currently registered to point to our previous nameservers, WHM automatically added A records to point them to the corresponding IP addresses.  After the site for our domain is migrated, we will be changing the registration to point IP addresses on this server.  Let's change the records to point the IP addresses that they will be registered to when we update the nameserver registration through our registrar.

  1. Change the A records for ns1 and ns2 to have the correct IP addresses.

Adding A Records

Now, let's add the A records for our Hostname.

When editing DNS records, fully qualified domain names that are meant to be absolute references (i.e. "domain.tld" or "www.domain.tld" should be terminated with a "." following the top level domain.  Names entered without a terminating "." following the top level domain (i.e. "www" or "mail") will be interpreted as relative references to the domain for the zone that contains it.

WHM will allow you to enter a name as the destination address for an A record.  This is bad form as relating one name to another name should be done by using a CNAME instead.

SPF Records

Now, let's add the record for SPF to our domain.

If you remember from part 1 of our tuntorial, the Sender Policy Framework (SPF) is a system developed for mail servers where DNS administrators can define what servers have been authorized to deliver mail for a particular domain.  Email servers that are configured to check SPF will often reject email from a source if they replaying server isn't explicity authorized in an SPF record for the sender's domain.

TXT records are used for SPF.

Accept Local Email

"Always accept mail locally even if the primary MX does not point to this server."

Since we will also be hosting email for this domain on this server, we will want to leave this checkbox checked.  If we were hosting email on a different server, we would uncheck it.

Save Changes

  1. Click the Save button.

DNS Setting and Email

In this demonstration, we added the records for SPF to our primary domain after the zone was created.  As we mentioned in part 1, since all of your domains will need SPF records, you will likely want to add the information to the zone template so that the record for SPF is created when each zone is created.

You will also want to have the pointer (PTR) record for your primary IP address set to point to your hostname.  There are also referred to as "reverse DNS" records.  Reverse DNS records (PTRs) are maintained by the primary provider so you will need to contact your provider to request it.

Some email hosts will also reject email from mail exchangers where the PTR does not resolve back to the hostname of the relaying server.


Server Contacts

  1. Click on Change System Mail Preferences link.

Root's Mail

Many services run on the server as the "root" user, so system messages related to those services will typically be sent to a mailbox for this user.  The mailbox for this account is not accessible via webmail or by using a mail client.  Let's configure the system to forward these messages to an email account on the domain so that we can check via webmail or a client-side application.

  1. Enter an email address where it says Mail should be forwarded to.
  2. Click the Change button.

Nobody's Mail

Apache (the web server) runs as the user "nobody", so system messages would be typically sent to that user.  By default, WHM is configured to forward the messages to the "root" user.  Since we forwarding the "root" user's email to a new address, let's update the "nobody" user's email to be forwarded directly to that same address, instead of being double-forwarded.

  1. Click on Change System Mail Preferences link.
  2. Enter an email address where it says Mail should be forwarded to.
  3. Click the Change button.

cPanel's Mail

cPanel runs under the "cpanel" user, so system messages related to that service will be sent to that user.  Let's configure those messages to be forwarded to the same address as used for the previous two users.

  1. Click on Change System Mail Preferences link.
  2. Enter an email address where it says Mail should be forwarded to.
  3. Click the Change button.

Contact Manager

  1. Click the Contact Manager link.

Here, you can configre what events trigger alert messages to be sent to a user.  These alerts will include information about that event, the methods enabled (if contact data for that method has been entered), and the priority given to the messages that are sent.

  1. Click the Save button to save any changes.

SQL Services

  1. Click the Home link.
  2. Click the SQL Services icon.

Now, let's setup the password for the "root" MySQL user.

Initially there is no password set for the "root" MySQL user.  As this user has full access to all databases on the server, leaving this blank is considered a security risk and therefore not recommended.

  1. Click the MySQL Root Password icon.

Under normal circumstances, we will not need to remember this password to be able to conntect to your SQL services.  Should you need to access the database as the "root" user, you can simply reset the password.  Let's use the password generation tool to generate a secure password for the "root" database user.

  1. Click the Generate Password button.

Here you can customize the criteria used to generate the password.

  1. Click the Regenerate button.
  2. Click the Use Password button.
  3. Click the Close button.
  4. Click the Change Password button.

Server IP Addresses

  1. Click the Home link.

Now, let's look at the IP addresses bound to this server.

  1. Click the IP Functions icon.
  2. Click the Show or Delete Current IP Addresses icon.

How you can see the IP addresses associated with this server.

IP addresses will be assigned by your hosting provider and are usually assigned in contiguous blocks.  Your server should be preconfigured with all of the IP addresses in the initial block already bound to the server.  Additional IPs that are ordered will likely not be in the same contiguous block as the original set.


  1. Click the Home link.

Congratulations!  You now know how to setup the initial configuration of a new cPanel server.