1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Configuring Servers - WHM (Part 2)

Configuring Servers - 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.

Click on the below link to jump into a section:


Skeleton directory

  1. Click the Account Functions icon.
  1. Click the Skeleton Directory icon- The skeleton directory is the default directory structure (files and folders) that is used to create the structure of the accounts you create

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

Example:  /root/cpanel3-skel

 

To modify the skeleton directory:

  1. Create the directories
  2. Upload the files you want to be 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

How to 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.
    Note: When we clicked on the username field, WHM auto-populates the field with a value-based off on the domain.  We can change it to an alternate username of our choice.
  5. Enter a Password.
  6. Enter an Email address.
  7. Select a Package.
  8. If you wish to Overwrite an existing DNS zone, check the box next to Overwrite any existing DNS Zones for the account.
  9. 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.

How to remove preconfigured zones

  1. Click the Home link.
  2. Click the DNS Functions icon.
  3. Click the Delete a DNS Zone icon.
  4. Select the Zones to Delete. (Hold the CTRL key to add additional zones to the selection.)
  5. Click the Delete button.

Example zones to remove:

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

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.

How to add DNS records 

  1. Click the Home link.
  2. Click the DNS Functions icon.
  3. Click the Edit DNS Zone icon.
  4. Select the Zone to Edit.
  5. Click the Edit button.
  6. Change the A records for ns1 and ns2 to have the correct IP addresses.

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 to the IP addresses that they will be registered to when we update the nameserver registration through our registrar.

Adding an A record

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 (for example, "domain.tld" or "www.domain.tld" should be terminated with a dot "." following the top-level domain.  Names entered without a terminating "." following the top-level domain (for example," 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.

Adding an SPF records

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

If you remember from part 1 of our tutorial, 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 the replaying server isn't explicitly authorized in an SPF record for the sender's domain.

TXT records are used for SPF.

Accept local email

  • Always set email to 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.

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. The primary provider maintains reverse DNS records (PTRs), so you must contact your provider to request it.

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


Server Contacts

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.

Nobody's mail

Apache (the webserver) 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 are 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.

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.

How to update server contacts

  1. Click on the 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

Here, you can configure 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 Contact Manager link.
  1. Click the Save button to save any changes.

SQL services

Now, let's set up 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 Home link.
  2. Click the SQL Services icon. 
  3. Click the MySQL Root Password icon.
  4. Click the Generate Password button.
  5. Click the Regenerate button.
  6. Click the Use Password button.
  7. Click the Close button.
  8. Click the Change Password button.

Under normal circumstances, we will not need to remember this password to be able to connect 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.


Server IP addresses

How to check the IP addresses associated with this server. 

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

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.

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