Loading...

Knowledge Base

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 what is shown in this video above, depending on the WHM/cPanel version, theme, and operating system you are using. However, their functionalities should still be the same.

This tutorial continues with the initial configuration of a cPanel server. Here are the topics discussed in this article.

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. It allows you to copy the same files into every new cPanel account's /public_html and /public_ftp directories when you create the account.

View the Skeleton Directory

In cPanel & WHM version 116 and later, WHM doesn't have a Skeleton Directory tool. For the root user, the skeleton directory is the /root/cpanel3-skel folder on the server, which only root can open. To see it, connect to your server over SSH as root. For the steps, see How do I Get and Use SSH Access? Then run these commands:

cd /root/cpanel3-skel
ls -la

The output lists the default files and folders. For example:

total 20
drwxr-xr-x   4 root root 4096 Oct 30  2024 .
drwxr-x---. 22 root root 4096 Nov 16 13:27 ..
-rw-r--r--   1 root root  319 Sep  4  2024 .bashrc
drwxr-xr-x   2 root root 4096 Oct 30  2024 public_ftp
drwxr-xr-x   2 root root 4096 Oct 30  2024 public_html

Files in public_html are copied to each new account's public_html directory, and files in public_ftp are copied to each new account's public_ftp directory.

Modify the Skeleton Directory

If you need to modify the skeleton directory:

  1. Plan and create the directories.
  2. Upload the files that you want to copy to new accounts into /root/cpanel3-skel/public_html or /root/cpanel3-skel/public_ftp. Use an SCP or SFTP program, such as FileZilla, or use the shell.

The system copies these files to the new accounts' directories when it creates the accounts.

Unlike skeleton directories for resellers, the skeleton directory for the "root" user is not accessible via the File Manager. For security reasons, it is recommended that FTP access be disabled for the "root" user. It is also recommended that you use a client that supports SCP to transfer files to directories that are only accessible to the "root" user, such as this one.

Add the Account for the Primary Domain

WHM allows you to create an account for the primary domain. For detailed instructions on creating a cPanel account in WHM, see the following article.

When you create the account, the optional DNS Settings section has these options:

  • Enable DKIM on this account: Selected by default.
  • Enable SPF on this account: Selected by default.
  • Enable DMARC on this account: Selected by default. DMARC requires DKIM and SPF to be enabled.
  • Use the nameservers specified at the Domain's Registrar: Ignores locally specified nameservers.
  • Overwrite any existing DNS zones for the account: Select this if you want to overwrite an existing DNS zone.

The section also lists the nameservers for the account.

WHM - Create a New Account - DNS Settings

DNS Settings and Email

The Sender Policy Framework (SPF) is a system developed for mail servers. With it, DNS administrators define which servers are authorized to deliver mail for a particular domain. Email servers that are configured to check SPF often reject email from a source if the relaying server isn't explicitly authorized in an SPF record for the sender's domain. Because Enable SPF on this account is selected by default, new accounts get an SPF record.

You will also want the pointer (PTR) record for your primary IP address to point to your hostname. This is also called a "reverse DNS" record. The primary provider maintains reverse DNS records, so you must contact your provider to request it.

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

Server Contacts

The server sends system messages to three system users. You can forward each user's messages to an email address that you can check.

Root's Mail

Many services run on the server as the "root" user, so system messages related to those services are typically sent to a mailbox for this user. The mailbox for this account is not accessible via webmail or by using a mail client. Configure the system to forward these messages to an email account on your domain, so that you can check them via webmail or a client-side application.

Nobody's Mail

Apache (the web server) runs as the user "nobody," so system messages are typically sent to that user. By default, WHM forwards these messages to the "root" user. Because you are forwarding the "root" user's email to a new address, update the "nobody" user's email to forward directly to that same address, instead of being forwarded twice.

cPanel's Mail

cPanel runs under the "cPanel" user, so system messages related to that service are sent to that user. Forward these messages to the same address that you used for the "root" and "nobody" users.

Update the Server Contacts

To update the server contacts in WHM:

  1. In the left-side panel of WHM, expand the Server Contacts section. You can also type Edit System Mail Preferences in the search box.
  2. Click Edit System Mail Preferences.

    WHM - Edit System Mail Preferences

  3. For each system user, enter an email address in Forward mail for.

    WHM - Edit System Mail Preferences, forward mail

  4. Click Update.

Contact Manager

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

To update the Contact Manager in WHM:

  1. In WHM, go to the Server Contacts section and click Contact Manager.

    WHM - Server Contacts - Contact Manager

  2. The Contact Manager page has two tabs where you can make updates: Communication Type and Notifications.

    WHM - Contact Manager tabs

  3. Click Save to save your changes.

Database Services

Next, set the password for the "root" MySQL user. This user has full access to all databases on the server, so use a strong password.

To set the root password in WHM:

  1. In WHM, expand the Database Services section in the left-side panel. You can also type Change Database Root Password in the search box.
  2. Select Change Database Root Password from the list.

    WHM - Database Services - Change Database Root Password

  3. Click Generate Password, and then select I have copied this password in a safe place.

    WHM - Use Password

  4. Click Use Password.
  5. Click Change Password.

cPanel & WHM stores this password in the /root/.my.cnf file. Do not edit this file manually. To change the password, use this WHM interface. If you need to access the database as the "root" user later, you can reset the password the same way.

Server IP Addresses

Your hosting provider assigns the IP addresses, usually 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 you order will likely not be in the same contiguous block as the original set.

To check the IP addresses in WHM:

  1. Log in to WHM.
  2. In the left-side panel, expand the IP Functions section. You can also type Show or Delete Current IP Addresses in the search box.
  3. Select Show or Delete Current IP Addresses.

    WHM - IP Functions - Show or Delete Current IP Addresses

  4. The IP addresses that are associated with your server are displayed.

    WHM - Current IP addresses list

You now know how to complete the initial configuration of a new cPanel server.

Frequently Asked Questions (FAQs)

Q: Where is the Skeleton Directory in WHM?

A: In cPanel & WHM version 116 and later, WHM doesn't have a Skeleton Directory tool. For the root user, the skeleton directory is the /root/cpanel3-skel folder on the server. To see it, connect over SSH as root. For the steps, see Skeleton Directory.

Q: Can I use File Manager to edit the skeleton directory for the root user?

A: No. The skeleton directory for the "root" user is not accessible via the File Manager. Use a client that supports SCP, or use the shell.

Q: Does a new account get an SPF record automatically?

A: Yes. Enable SPF on this account is selected by default in the DNS Settings section when you create an account, so new accounts get an SPF record.

Q: Why should I forward the system mail?

A: The mailbox for the "root" user is not accessible via webmail or by using a mail client. Forward its messages to an email account that you can check. Forward the messages for the "nobody" and "cPanel" users to the same address.

Q: Where is the MySQL root password stored?

A: cPanel & WHM stores it in the /root/.my.cnf file. Do not edit this file manually. To change the password, use Change Database Root Password in WHM.

Q: What is a PTR record, and why does it matter for email?

A: A pointer (PTR) record, also called a "reverse DNS" record, points your primary IP address to your hostname. Some email hosts reject emails from mail exchangers where the PTR does not resolve back to the hostname of the relaying server. The primary provider maintains reverse DNS records, so you must contact your provider to request it.

How can we help you? Please contact us via phone or chat if you need assistance.

Loading...