Difference between revisions of "CPanel/WHM"

From WHMCS Documentation

(Add-On Features)
 
(74 intermediate revisions by 11 users not shown)
Line 1: Line 1:
== Adding a cPanel Server ==
+
== About this Module ==
  
[[File:Videotutorial.png‎|center|link=http://www.youtube.com/watch?v=LF51Fayo0YU|Watch Video Tutorial]]
+
The cPanel module allows you to add and manage cPanel & WHM servers in WHMCS.
  
 +
<div class="docs-alert-warning">
 +
* To use this module, the server must be a cPanel & WHM server that uses a valid cPanel license.
 +
* If you want to use a WP Squared server, you must use the separate '''[[WP Squared]]''' module.
 +
</div>
 +
{{Provisioning_Module
 +
| changepackage = Yes
 +
| changepw = Yes
 +
| usageupdates = Yes
 +
| clientarealink = Yes
 +
| port = 2086 & 2087}}
 +
 +
== Adding a cPanel & WHM Server ==
 +
 +
To set up a cPanel & WHM server in WHMCS:
 +
 +
# Go to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Servers]]''' or, prior to WHMCS 8.0, '''Setup > Products/Services > Servers'''.
 +
# Click '''Add New Server'''.
 +
# Select ''cPanel'' from the menu.
 +
# Enter the hostname or IP address.
 +
# Enter the username and password or API token.
 +
#* For the username and password, use your WHM account credentials.
 +
#* You can generate an API token in WHM at '''Development >> Manage API Tokens'''.
 +
# Click '''Test Connection'''.
 +
# Enter the desired additional server details.
 +
# Examine the displayed default port. If your server uses a different port, check '''Override with Custom Port''' and enter the correct port. For more information, see [[Server Port Overrides]].
 +
# Click '''Save Changes'''.
 +
# If this is the only cPanel & WHM server that is currently in WHMCS, click on the name and ensure that it results in an asterisk (*) next to it. This indicates that it is the default to use when any other non-specific configuration doesn't apply.
 +
 +
<div class="docs-alert-warning">
 +
If [[Two-Factor Authentication]] is enabled on your cPanel & WHM server, you must disable it for API requests. See below.
 +
</div>
 +
 +
=== Creating a cPanel Product === 
 +
 +
<html><a href="https://www.youtube.com/watch?v=0lqzsTSUGw0&hd=1" class="docs-video-tutorial"><em>Watch the video tutorial for this feature.</em><span> <img src="https://assets.whmcs.com/icons/youtube.png"> </span></a></html>
 +
 +
You can create a product that provisions accounts on your cPanel & WHM server at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Products_and_Services|Products/Services]]''' or, prior to WHMCS 8.0, '''Setup > Products/Services > Products/Services'''. 
 +
 +
You can then create a product using an existing WHM package or by defining custom options. You can also choose to create a reseller hosting product.
 +
 +
[[File:83WPInstallSetting.png|thumb|cPanel Module Settings]][[File:cpanel3.png|thumb|Adding a Package in WHM]]
 +
 +
===== Use an Existing WHM Package =====
 +
 +
<div class="docs-alert-success">
 +
We introduced this feature in WHMCS 7.0.
 +
</div>
 +
 +
To create a hosting product that uses an existing WHM package, use the following product configuration:
 +
 +
* For '''Product Type''', select ''Shared Hosting''.
 +
* For '''WHM Package Name''', select the desired hosting plan.
 +
 +
===== Defining Custom Options =====
 +
 +
<div class="docs-alert-info">
 +
To configure quotas on a per-account basis, you must have <tt>root</tt>-level access to the server.
 +
</div>
 +
 +
[[File:Cpanel advanced.png|thumb|Advanced Mode]]
 +
 +
To create a hosting product with a custom package, use the following product configuration:
 +
 +
* For '''Product Type''', select ''Shared Hosting''.
 +
* Do '''not''' select a package for '''WHM Package Name'''.
 +
* After clicking '''Switch to Advanced Mode''' on the right side of the page, enter the desired values for each package setting. If you do not enter a value, the quota will be unlimited.
 +
 +
==== Creating a Reseller Package ====
 +
 +
[[File:cpanel4.png|thumb|Creating an ACL List]][[File:83WPResellerAccount.png|thumb|cPanel Reseller Module Settings]]
 +
 +
To create a hosting product for a reseller account, use the following product configuration:
 +
 +
* For '''Product Type''', select ''Reseller Hosting''.
 +
* Do '''not''' select a package for '''WHM Package Name'''.
 +
* After clicking '''Switch to Advanced Mode''' on the right side of the page, enter the desired values for each package setting.
 +
** If you do not enter a value, the quota will be unlimited.
 +
** For '''Reseller ACL List''', make certain to enter the name of an ACL that already exists in WHM. You can create one at '''Resellers >> [https://docs.cpanel.net/whm/resellers/edit-reseller-nameservers-and-privileges/ Edit Reseller Nameservers and Privileges]'''.
 +
** Make certain to also configure:
 +
*** '''Limit Reseller by Number'''
 +
*** '''Limit Reseller by Usage'''
 +
*** '''Reseller Disk Space'''
 +
*** '''Reseller Bandwidth'''
 +
*** '''Allow DS Overselling'''
 +
*** '''Allow BW Overselling'''
 +
*** '''Configure Nameservers'''
 +
*** '''Reseller Ownership'''
 +
 +
Reseller usage limits and reporting are based on the behavior of reseller accounts in cPanel & WHM. The system will not aggregate use by resellers that the <tt>root</tt> user owns when making usage calculations.
 +
 +
===== Configuring Per-Account Billing =====
 +
 +
<div class="docs-alert-success">
 +
We added this feature in WHMCS 7.9.
 +
</div>
 +
 +
[[Usage_Billing|Usage billing]] allows you to bill resellers for the number of cPanel accounts they provision. You can choose whether to include a certain number of cPanel accounts in the price and only charge for exceeding a certain limit, offer tiered pricing, or charge for every cPanel account resellers create.
 +
 +
When a client orders a product, WHMCS will track the number of cPanel accounts that the reseller creates. On the service's next due date, the system records the current number of cPanel accounts and adds any additional cost to the service's renewal invoice.
 +
 +
<div class="docs-alert-info">
 +
We recommend only using this for products with a monthly billing cycle.
 +
</div>
 +
 +
[[File:Cpanel usage billing.png|thumb|Enable Usage Billing]]
 +
 +
To configure this:
 +
 +
# In the '''Metric Billing''' section of the '''Module Settings''' tab, toggle '''Sub-Accounts''' to '''On'''.<div class="docs-alert-info">This metric is separate from the cPanel Subaccount feature.</div>
 +
# Click '''Configure Pricing'''.
 +
# Enter the number of Sub-Accounts that you want to include in the base product in '''Quality Included'''.
 +
# Choose a pricing scheme.
 +
# Enter the pricing information for the chosen scheme. For help, see [https://help.whmcs.com/m/setup/l/1185956-billing-resellers-per-domain these pricing examples].
 +
# Click '''Save'''.
 +
 +
=== WHMCS Connect ===
 +
 +
WHMCS Connect allows you and your administrators to quickly and easily access the control panels of all the servers configured in your WHMCS installation that support Single Sign-On, enabling you and your staff to administer and make changes without ever needing to re-authenticate.
 +
 +
For information on the benefits of WHMCS Connect and how to configure this functionality [[WHMCS_Connect|refer to this page]].
 +
 +
== Log in to cPanel ==
 +
 +
The '''Log in to cPanel''' link in the Client Area and the '''Log in to Control Panel''' link in the [[Admin Area]] use the server hostname if it is available. If not, they use the IP address. The use of <tt>http</tt> or <tt>https</tt> login links depends on the '''Secure''' setting in the server configuration.
 +
 +
The link in the Admin Area uses the <tt>xfercpanel</tt> function. When the system prompts you, enter your WHM login details ('''not''' the client's cPanel details) to log in to the client's account with reseller privileges.
 +
 +
== API Token Permissions ==
 +
 +
API tokens in cPanel & WHM allow you to restrict the actions that an API token can perform. To do this, you must grant the following permissions in WHM at '''Development >> Manage API Tokens'''.
 +
 +
<table class="table table-striped">
 +
<tr>
 +
<td>basic-whm-functions</td>
 +
<td>basic-system-info</td>
 +
<td>cpanel-api</td>
 +
</tr>
 +
<tr>
 +
<td>create-acct</td>
 +
<td>create-user-session</td>
 +
<td>suspend-acct</td>
 +
</tr>
 +
<tr>
 +
<td>upgrade-account</td>
 +
<td>kill-acct</td>
 +
<td>passwd</td>
 +
</tr>
 +
<tr>
 +
<td>acct-summary</td>
 +
<td>list-accts</td>
 +
<td>show-bandwidth</td>
 +
</tr>
 +
<tr>
 +
<td>cpanel-integration</td>
 +
<td>list-pkgs</td>
 +
<td>ns-config</td>
 +
</tr>
 +
<tr>
 +
<td>edit-mx</td>
 +
<td>manage-api-tokens</td>
 +
<td>ssl-gencrt</td>
 +
</tr>
 +
</table>
 +
 +
=== root API Tokens ===
 +
 +
When creating an API token for the <tt>root</tt> user, you must also include the <tt>viewglobalpackages</tt> permission.
 +
 +
=== Configurable Package Addons ===
 +
 +
When using the Configurable Package Addon, you must also enable the <tt>edit-account</tt> permission.
 +
 +
=== Reseller Products ===
 +
 +
For reseller products, the "Everything" permission needs to be enabled as the reseller API functions on a cPanel & WHM server require root access to work.
 +
 +
== Keep DNS Zone on Termination ==
 +
 +
When terminating a cPanel & WHM account via the WHMCS Admin Area, you can select '''Keep DNS Zone''' in order to retain the associated DNS zone record.
 +
 +
You may wish to use this, for example, when performing an account migration with DNS forwarding.
 +
 +
<div class="docs-alert-warning">
 +
You cannot recreate a new account on the server using the same domain while the DNS zone exists. You must delete it before you can successfully provision a new account.
 +
</div>
 +
 +
== Disable Two-Factor Authentication (2FA) for the cPanel API ==
 +
 +
For the cPanel module to function when 2FA is enabled for your account, you must ensure that the 2FA requirement is disabled for API requests.
 
   
 
   
The following steps guide you through the process of setting up a server in WHMCS for cPanel Hosting Accounts.
+
To do this:
 +
 +
# Log in to WHM as the <tt>root</tt> user.
 +
# Go to '''Security Center > Configure Security Policies'''.
 +
# Uncheck '''API requests'''.
 +
# Click '''Save'''.
 +
 
 +
== Add-On Features ==
 +
 
 +
In WHMCS 8.2 and later, in addition to WHMCS's existing product addon functionality (now an '''Independent Product'''), you can create an '''Add-On Feature'''. These addons let you sell module-specific features that are available through cPanel & WHM and Plesk, like WP Toolkit or, in WHMCS 8.10 and later, Sitejet Builder.
 +
 
 +
For more information and steps to create an addon, see [[Product Addons]].
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Access Denied/Permission Denied ===
 +
 
 +
An Access Denied error indicates that the cPanel server denied WHMCS access to perform the requested action (eg. create or modify the account).
 +
 
 +
To investigate and resolve this issue:
 +
 
 +
# Go to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Servers]]''' or, prior to WHMCS 8.0, '''Setup > Products/Services > Servers'''.
 +
# Check whether the server settings, including the username and API token, are valid.
 +
# Check whether the API credentials for the server have the required permissions to perform the action.
 +
# Go to the client's profile and choose the '''Products/Services''' tab.
 +
# Check to ensure that the '''Username''' and '''Server''' values match the account records in cPanel & WHM.
 +
# Check whether the user has the required permissions to manage the cPanel hosting account.
  
# You need to begin by creating a Server for your cPanel products to be assigned to in WHMCS
+
<div class="docs-alert-success">
# To do this navigate to '''Setup > Products/Services > Servers''' and click on '''Add New Server'''[[File:cpanel1.png|thumb|WHM Access Hash Setup]]
+
Click '''Test Connection''' to confirm that the account has access.
# Enter the server name, IP address, select the server type "cpanel" from the dropdown menu and enter the username and password for cPanel/WHM
+
</div>
# Alternatively you can use the username + access hash combination. This is the more secure option and can be obtained via '''Cluster/Remote Access > Setup Remote Access Key''' in WHM. '''NB.''' The "WHM" login button will not function.
 
# Ticking the SSL Mode checkbox is also recommended, but all other fields are optional
 
#Click Create Server to complete the process and add your new cPanel Server
 
  
== Setting Up a cPanel Package ==
+
=== You do not have permission to use Selected Package ===
  
We have prepared a video tutorial for this section @ http://www.youtube.com/watch?v=LF51Fayo0YU&hd=1
+
If you receive this error when trying to create an account, correct the entered package name.  
  
[[File:cpanel2.png|thumb|cPanel Module Settings]][[File:cpanel3.png|thumb|Adding a Package in WHM]]
+
To do this:
To setup a cPanel package, go to '''Setup > Products & Services'''.  From there, you can create the product and configure the general settings and pricing info as normal. When it comes to the Module Settings tab, select "cpanel" in the module dropdown field and then for a shared hosting package:
 
  
#In most cases, you should create a package inside WHM itself (in '''Packages > Add a Package''') and then just enter the Package Name into WHMCS exactly as it appears in WHM (leaving all the other fields blank)
+
# Go to the '''Module Settings''' tab for the relevant product at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Products and Services|Products/Services]]''' or, prior to WHMCS 8.0, '''Setup > Products/Services'''.
# But there is also the option to define custom packages - you can do that by leaving the Package Name field blank and defining the individual limits into the fields the module settings page (You will need root access for this to work)
+
# Make certain that the set package name matches the name exactly as it appears in WHM. This should use the <tt>username_packagename</tt> format.
#Max Addon Domains is the last field that applies to shared hosting accounts in the list.
 
#And then finally as with all products you have the option of choosing the automatic setup option you want for new orders, be it immediately as soon as the order is placed, as soon as the initial payment has been received (recommended) or waiting until an admin manually reviews & accepts the pending orders
 
  
===For a reseller package===
+
=== Package Not Allowed or Exceeded Resource/Account Allocation ===
[[File:cpanel4.png|thumb|Creating an ACL List]]
 
#Set the settings for the resellers own hosting account as above
 
#The fields from "Limit Reseller by Number" onwards specify reseller settings so from there you can set the resellers limits by number or disk space, these are explained below.
 
#The Reseller ACL List is required and defines what features inside WHM the reseller is allowed to use.  To setup an ACL list, WHM doesn't offer a way without setting up a reseller so inside WHM go to the '''Reseller Center''' and activate a domain as a reseller, then proceed to the '''Edit reseller privileges & nameservers''' page and enter a name to save the feature selections before saving.
 
  
*Limit Reseller by Number - Specifies the maximum number of cPanel accounts the reseller can create or...
+
This error indicates that you only have reseller access to your server and are trying to create an account without a valid package name. Ensure that the WHM package name in the WHMCS product configuration and in WHM match exactly.
*Limit Reseller by Usage - Alternately limit the disk space and bandwidth the reseller has to assign to their customers using the following two options
 
*Reseller Disk Space - The disk space the reseller has to share amongst their accounts
 
*Reseller Bandwidth - The bandwidth the reseller has to share amongst their accounts
 
* Allow DS Overselling - Tick to allow resellers to assign more disk space to accounts than they actually have
 
* Allow BW Overselling - Tick to allow resellers to assign more bandwidth to accounts than they actually have
 
*Reseller ACL List - See below
 
*Add Prefix to Package - Add the username_ prefix to the package name when the account is created on the server.
 
*Configure Nameservers - Tick this option to give the reseller their own nameservers based upon their domain name instead of using your nameservers. Ie.
 
ns1.resellerdomain.com, ns2.resellerdomain.com
 
instead of
 
ns1.yourcompany.com. ns2.yourcompany.com
 
*Reseller Ownership - When ticked the reseller will own their own account.
 
  
==Common Problems==
+
=== Resellers are not permitted to create subdomains of the server's main domain ===
  
===You do not have permission to use Selected Package===
+
This indicates that the domain is missing. Ensure that you have entered a domain name for the product.  
If you receive this error when trying to create an account then you need to correct the Packages Name setting. To do this, go to '''Setup > Products/Services > Edit > Module Settings''' on the package where you are receiving the error. Where it asks for the WHM Package Name, you must enter this exactly as it appears in WHM - which should be in the format username_packagename.
 
  
===Package Not Allowed or Exceeded Resource/Account Allocation===
+
You may need to enable '''Require Domain''' at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Products and Services|Products/Services]]''' or, prior to WHMCS 8.0, '''Setup > Product/Services'''.
This error most likely means you only have reseller access to your server and are trying to create an account without a valid package name. You need to make sure the WHM Package Name in the product configuration of WHMCS matches exactly what is setup in your WHM.
 
  
===Resellers are not permitted to create subdomains of the server's main domain===
+
=== Unable to validate setting for language: english ===
This means no domain has been selected and is missing. Ensure the product has a domain name entered. You may need to enable Require Domain in '''Setup > Product/Services > Edit'''.
 
  
===Unable to validate setting for language: english===
+
Some cPanel & WHM API changes are not backwards compatible. You must use WHMCS 4.2 or later in order to use this module.
cPanel/WHM have made a number of changes to their API in the latest versions that are not backwards compatible. Therefore it is no longer possible to use an old version of WHMCS with the latest version of cPanel. You will need to upgrade your WHMCS install to version 4.2.1 or above.
 
  
===Sorry, that username is reserved===
+
=== Sorry, that username is reserved ===
cPanel/WHM does not allow usernames to contain the phrase "test" amongst others, so when this error occurs, simply change the username under the client's products/services tab and run the Create Module Command again.
 
  
===Sorry, a group for that username already exists===
+
cPanel & WHM does not allow usernames to contain several words, including <tt>test</tt>. Change the hosting account's username and run the '''Create''' command again.
An account with this username already exists on the server. This error can occur on shared servers even when you do not have an account with this username under your reseller account another reseller on the same server may be using it already.
 
  
To resolve, navigate to the client's Products/Services tab, change the Username, click Save Changes and finally click the "Create" Module Command button.
+
=== Sorry, a group for that username already exists ===
 +
 
 +
An account with this username already exists on the server. This error can occur on shared servers even when you do not have an account with this username under your reseller account another reseller on the same server may be using it already. Change the hosting account's username and run the '''Create''' command again.
 +
 
 +
=== Login Failed ===
  
===Login Failed===
 
 
There are two possible causes for this error:
 
There are two possible causes for this error:
  
# The login details under Setup > Servers > Edit are incorrect. Please ensure you are using either the username + access hash combination or the username + password combination and that the login details are correct.
+
* The login details under '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Servers]]''' or, prior to WHMCS 8.0, '''Setup > Products/Services > Servers''' are incorrect. Make certain that you are using either the username and API key or the username and password combination and that the login details are correct.
# The Brute Force Protection settings are preventing WHMCS from creating/suspending/terminating accounts via the cPanel API. Please adjust the BFP settings in WHM.
+
* The brute force protection settings are preventing WHMCS from creating, suspending, or terminating accounts via the cPanel API. Adjust these settings in WHM.
 +
 
 +
=== No user name supplied: "username" is a required argument ===
 +
 
 +
This indicates that the username under the client's '''Products/Services''' tab is empty.
 +
 
 +
Enter a username, save the changes, and then run the '''Create''' command again.
 +
 
 +
When you do this, also ensure that '''Require Domains''' is checked at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Products and Services|Products/Services]]''' or, prior to WHMCS 8.0, '''Setup > Products/Services > Products/Services'''.
 +
 
 +
=== Action Failed Unable to auto-login. Please contact support ===
 +
 
 +
This indicates that the username under the client's '''Products/Services''' tab is empty.
 +
 
 +
Enter a username, save the changes, and then run the '''Create''' command again.
 +
 
 +
When you do this, also ensure that '''Require Domains''' is checked at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Products/Services''' or, prior to WHMCS 8.0, '''Setup > Products/Services > Products/Services'''.
 +
 
 +
=== WHM Username is missing for the selected server===
 +
 
 +
This error indicates a server balancing misconfiguration (for example, you have not selected a server to use when creating the account).
 +
 
 +
For help, see  [[Provisioning_Issues#Server_Command_Error_-_Curl_Error_-_Couldn.27t_resolve_host_.286.29|Provisioning Issues]].
 +
 
 +
=== An Unknown Error Occurred after updating to cPanel 74 ===
 +
 
 +
If, after updating to cPanel & WHM version 74, every module command results in a "An unknown error occurred" message, check the [[Troubleshooting_Module_Problems|module debug log]]. This may indicate that the server is returning a 404 error page.
 +
 
 +
This is due to the [https://blog.cpanel.com/march-2017-development-update deprecation of the XML output from WHM API 1 and WHM API 0]. To resolve this, [[Updating|update]] to WHMCS 7.3 or higher.
 +
 
 +
=== WHM Package not shown in Module dropdown list when editing product ===
 +
 
 +
The WHM API only returns packages that you can provision for that reseller's WHM account. Packages may not display in this list if their use would exceed the reseller's quotas on their WHM account.
 +
 
 +
To confirm this:
 +
 
 +
# [[File:Whm_packages_list_limits.png|thumb|cPanel Package Limits]]In WHM, go to '''Account Functions » Create a New Account'''.
 +
# Select the desired package from '''Choose a Package'''. The package name will display with the message '''Cannot use due to limits'''.
 +
 
 +
You can use two methods to resolve this issue:
 +
 
 +
* Ensure that the WHM account has sufficient resources to provision the desired WHM package.
 +
* Enable [https://docs.cpanel.net/knowledge-base/cpanel-product/overselling/ overselling] on the reseller account. This requires <tt>root</tt> access.
 +
 
 +
=== Product attribute Package Name "Package Name" not found on server ===
 +
 
 +
There are two possible causes of this error:
 +
* The package name in WHMCS does not exactly match [[#Package Not Allowed or Exceeded Resource/Account Allocation|the package name in WHM]].
 +
* The server lacks [[#WHM Package not shown in Module dropdown list when editing product|sufficient resources to create the package]].
 +
 
 +
=== This module requires a cPanel & WHM server with a valid license and the 'Standard' server profile. ===
 +
 
 +
This error indicates that you are attempting to use a server that does not run cPanel & WHM or does not have a valid cPanel & WHM license. Make '''certain''' that your server has the correct cPanel & WHM license and uses the correct server profile.
 +
 
 +
To do this, you can:
 +
 
 +
* Check your license in the [https://store.cpanel.net/ cPanel Store].
 +
** If you are a cPanel Partner, you can also check your licenses in [https://docs.cpanel.net/manage2/licenses/list-licenses/ Manage2].
 +
** For steps to purchase a cPanel license, see [https://docs.cpanel.net/knowledge-base/cpanel-product/how-to-purchase-a-cpanel-license/ How to Purchase a cPanel License].
 +
* Check your server profile in WHM at '''[https://docs.cpanel.net/whm/server-configuration/server-profile/ WHM >> Server Configuration >> Server Profile]'''.
 +
* [https://cpanel.net/support/ Contact cPanel Customer Support].
 +
 
 +
<div class="docs-alert-danger">
 +
If you are using a [https://wpsquared.com/ WP Squared] server, you '''must''' use the '''WP Squared''' module. For more information, see [[WP Squared]].
 +
</div>
  
 
{{modules}}
 
{{modules}}

Latest revision as of 14:43, 18 March 2024

About this Module

The cPanel module allows you to add and manage cPanel & WHM servers in WHMCS.

  • To use this module, the server must be a cPanel & WHM server that uses a valid cPanel license.
  • If you want to use a WP Squared server, you must use the separate WP Squared module.

Supported Features

Create Suspend Unsuspend Terminate
Yes Yes Yes Yes
Change Package Change Password Usage Updates Client Area Link
Yes Yes Yes Yes

The following ports should be open for outbound connections from your WHMCS server: 2086 & 2087

Adding a cPanel & WHM Server

To set up a cPanel & WHM server in WHMCS:

  1. Go to Configuration () > System Settings > Servers or, prior to WHMCS 8.0, Setup > Products/Services > Servers.
  2. Click Add New Server.
  3. Select cPanel from the menu.
  4. Enter the hostname or IP address.
  5. Enter the username and password or API token.
    • For the username and password, use your WHM account credentials.
    • You can generate an API token in WHM at Development >> Manage API Tokens.
  6. Click Test Connection.
  7. Enter the desired additional server details.
  8. Examine the displayed default port. If your server uses a different port, check Override with Custom Port and enter the correct port. For more information, see Server Port Overrides.
  9. Click Save Changes.
  10. If this is the only cPanel & WHM server that is currently in WHMCS, click on the name and ensure that it results in an asterisk (*) next to it. This indicates that it is the default to use when any other non-specific configuration doesn't apply.

If Two-Factor Authentication is enabled on your cPanel & WHM server, you must disable it for API requests. See below.

Creating a cPanel Product

Watch the video tutorial for this feature.

You can create a product that provisions accounts on your cPanel & WHM server at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Products/Services > Products/Services.

You can then create a product using an existing WHM package or by defining custom options. You can also choose to create a reseller hosting product.

cPanel Module Settings
Adding a Package in WHM
Use an Existing WHM Package

We introduced this feature in WHMCS 7.0.

To create a hosting product that uses an existing WHM package, use the following product configuration:

  • For Product Type, select Shared Hosting.
  • For WHM Package Name, select the desired hosting plan.
Defining Custom Options

To configure quotas on a per-account basis, you must have root-level access to the server.

Advanced Mode

To create a hosting product with a custom package, use the following product configuration:

  • For Product Type, select Shared Hosting.
  • Do not select a package for WHM Package Name.
  • After clicking Switch to Advanced Mode on the right side of the page, enter the desired values for each package setting. If you do not enter a value, the quota will be unlimited.

Creating a Reseller Package

Creating an ACL List
cPanel Reseller Module Settings

To create a hosting product for a reseller account, use the following product configuration:

  • For Product Type, select Reseller Hosting.
  • Do not select a package for WHM Package Name.
  • After clicking Switch to Advanced Mode on the right side of the page, enter the desired values for each package setting.
    • If you do not enter a value, the quota will be unlimited.
    • For Reseller ACL List, make certain to enter the name of an ACL that already exists in WHM. You can create one at Resellers >> Edit Reseller Nameservers and Privileges.
    • Make certain to also configure:
      • Limit Reseller by Number
      • Limit Reseller by Usage
      • Reseller Disk Space
      • Reseller Bandwidth
      • Allow DS Overselling
      • Allow BW Overselling
      • Configure Nameservers
      • Reseller Ownership

Reseller usage limits and reporting are based on the behavior of reseller accounts in cPanel & WHM. The system will not aggregate use by resellers that the root user owns when making usage calculations.

Configuring Per-Account Billing

We added this feature in WHMCS 7.9.

Usage billing allows you to bill resellers for the number of cPanel accounts they provision. You can choose whether to include a certain number of cPanel accounts in the price and only charge for exceeding a certain limit, offer tiered pricing, or charge for every cPanel account resellers create.

When a client orders a product, WHMCS will track the number of cPanel accounts that the reseller creates. On the service's next due date, the system records the current number of cPanel accounts and adds any additional cost to the service's renewal invoice.

We recommend only using this for products with a monthly billing cycle.

Enable Usage Billing

To configure this:

  1. In the Metric Billing section of the Module Settings tab, toggle Sub-Accounts to On.
    This metric is separate from the cPanel Subaccount feature.
  2. Click Configure Pricing.
  3. Enter the number of Sub-Accounts that you want to include in the base product in Quality Included.
  4. Choose a pricing scheme.
  5. Enter the pricing information for the chosen scheme. For help, see these pricing examples.
  6. Click Save.

WHMCS Connect

WHMCS Connect allows you and your administrators to quickly and easily access the control panels of all the servers configured in your WHMCS installation that support Single Sign-On, enabling you and your staff to administer and make changes without ever needing to re-authenticate.

For information on the benefits of WHMCS Connect and how to configure this functionality refer to this page.

Log in to cPanel

The Log in to cPanel link in the Client Area and the Log in to Control Panel link in the Admin Area use the server hostname if it is available. If not, they use the IP address. The use of http or https login links depends on the Secure setting in the server configuration.

The link in the Admin Area uses the xfercpanel function. When the system prompts you, enter your WHM login details (not the client's cPanel details) to log in to the client's account with reseller privileges.

API Token Permissions

API tokens in cPanel & WHM allow you to restrict the actions that an API token can perform. To do this, you must grant the following permissions in WHM at Development >> Manage API Tokens.

basic-whm-functions basic-system-info cpanel-api
create-acct create-user-session suspend-acct
upgrade-account kill-acct passwd
acct-summary list-accts show-bandwidth
cpanel-integration list-pkgs ns-config
edit-mx manage-api-tokens ssl-gencrt

root API Tokens

When creating an API token for the root user, you must also include the viewglobalpackages permission.

Configurable Package Addons

When using the Configurable Package Addon, you must also enable the edit-account permission.

Reseller Products

For reseller products, the "Everything" permission needs to be enabled as the reseller API functions on a cPanel & WHM server require root access to work.

Keep DNS Zone on Termination

When terminating a cPanel & WHM account via the WHMCS Admin Area, you can select Keep DNS Zone in order to retain the associated DNS zone record.

You may wish to use this, for example, when performing an account migration with DNS forwarding.

You cannot recreate a new account on the server using the same domain while the DNS zone exists. You must delete it before you can successfully provision a new account.

Disable Two-Factor Authentication (2FA) for the cPanel API

For the cPanel module to function when 2FA is enabled for your account, you must ensure that the 2FA requirement is disabled for API requests.

To do this:

  1. Log in to WHM as the root user.
  2. Go to Security Center > Configure Security Policies.
  3. Uncheck API requests.
  4. Click Save.

Add-On Features

In WHMCS 8.2 and later, in addition to WHMCS's existing product addon functionality (now an Independent Product), you can create an Add-On Feature. These addons let you sell module-specific features that are available through cPanel & WHM and Plesk, like WP Toolkit or, in WHMCS 8.10 and later, Sitejet Builder.

For more information and steps to create an addon, see Product Addons.

Troubleshooting

Access Denied/Permission Denied

An Access Denied error indicates that the cPanel server denied WHMCS access to perform the requested action (eg. create or modify the account).

To investigate and resolve this issue:

  1. Go to Configuration () > System Settings > Servers or, prior to WHMCS 8.0, Setup > Products/Services > Servers.
  2. Check whether the server settings, including the username and API token, are valid.
  3. Check whether the API credentials for the server have the required permissions to perform the action.
  4. Go to the client's profile and choose the Products/Services tab.
  5. Check to ensure that the Username and Server values match the account records in cPanel & WHM.
  6. Check whether the user has the required permissions to manage the cPanel hosting account.

Click Test Connection to confirm that the account has access.

You do not have permission to use Selected Package

If you receive this error when trying to create an account, correct the entered package name.

To do this:

  1. Go to the Module Settings tab for the relevant product at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Products/Services.
  2. Make certain that the set package name matches the name exactly as it appears in WHM. This should use the username_packagename format.

Package Not Allowed or Exceeded Resource/Account Allocation

This error indicates that you only have reseller access to your server and are trying to create an account without a valid package name. Ensure that the WHM package name in the WHMCS product configuration and in WHM match exactly.

Resellers are not permitted to create subdomains of the server's main domain

This indicates that the domain is missing. Ensure that you have entered a domain name for the product.

You may need to enable Require Domain at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Product/Services.

Unable to validate setting for language: english

Some cPanel & WHM API changes are not backwards compatible. You must use WHMCS 4.2 or later in order to use this module.

Sorry, that username is reserved

cPanel & WHM does not allow usernames to contain several words, including test. Change the hosting account's username and run the Create command again.

Sorry, a group for that username already exists

An account with this username already exists on the server. This error can occur on shared servers even when you do not have an account with this username under your reseller account another reseller on the same server may be using it already. Change the hosting account's username and run the Create command again.

Login Failed

There are two possible causes for this error:

  • The login details under Configuration () > System Settings > Servers or, prior to WHMCS 8.0, Setup > Products/Services > Servers are incorrect. Make certain that you are using either the username and API key or the username and password combination and that the login details are correct.
  • The brute force protection settings are preventing WHMCS from creating, suspending, or terminating accounts via the cPanel API. Adjust these settings in WHM.

No user name supplied: "username" is a required argument

This indicates that the username under the client's Products/Services tab is empty.

Enter a username, save the changes, and then run the Create command again.

When you do this, also ensure that Require Domains is checked at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Products/Services > Products/Services.

Action Failed Unable to auto-login. Please contact support

This indicates that the username under the client's Products/Services tab is empty.

Enter a username, save the changes, and then run the Create command again.

When you do this, also ensure that Require Domains is checked at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Products/Services > Products/Services.

WHM Username is missing for the selected server

This error indicates a server balancing misconfiguration (for example, you have not selected a server to use when creating the account).

For help, see Provisioning Issues.

An Unknown Error Occurred after updating to cPanel 74

If, after updating to cPanel & WHM version 74, every module command results in a "An unknown error occurred" message, check the module debug log. This may indicate that the server is returning a 404 error page.

This is due to the deprecation of the XML output from WHM API 1 and WHM API 0. To resolve this, update to WHMCS 7.3 or higher.

WHM Package not shown in Module dropdown list when editing product

The WHM API only returns packages that you can provision for that reseller's WHM account. Packages may not display in this list if their use would exceed the reseller's quotas on their WHM account.

To confirm this:

  1. cPanel Package Limits
    In WHM, go to Account Functions » Create a New Account.
  2. Select the desired package from Choose a Package. The package name will display with the message Cannot use due to limits.

You can use two methods to resolve this issue:

  • Ensure that the WHM account has sufficient resources to provision the desired WHM package.
  • Enable overselling on the reseller account. This requires root access.

Product attribute Package Name "Package Name" not found on server

There are two possible causes of this error:

This module requires a cPanel & WHM server with a valid license and the 'Standard' server profile.

This error indicates that you are attempting to use a server that does not run cPanel & WHM or does not have a valid cPanel & WHM license. Make certain that your server has the correct cPanel & WHM license and uses the correct server profile.

To do this, you can:

If you are using a WP Squared server, you must use the WP Squared module. For more information, see WP Squared.

Server Modules
cPanel/WHM - DirectAdmin - Plesk - Helm 3 - Helm 4 - Ensim - InterWorx - WebsitePanel - Cloudmin
Lxadmin - Virtualmin Pro - XPanel - HyperVM - SolusVM - Cloudmin - WHMSonic - VPS.Net
CentovaCast - SCPanel - MediaCP - GameCP - TCAdmin - Reseller Central - Auto Release - Heart Internet

Registrar Modules
Enom - ResellerClub - Nominet - OpenSRS - ResellOne - OnlineNIC - PlanetDomain - Affordable Domains
TPP Wholesale - TPPInternet - Stargate - Namecheap - NetEarthOne - Bizcn - InternetBS - GMO Internet
12Register - Registercom - DotDNS - WebNIC - Dot.TK - HexoNet - Realtime Register - Registereu
RRPProxy - ResellerCamp - TransIP - Heart Internet - IPMirror - NetRegistry - OVH - VentraIP Wholesale
Email - 101Domain

Fraud Modules
MaxMind - VariLogiX FraudCall - Telesign

Gateway Modules
2CheckOut - AsiaPay - Auth.net Echeck - Authorize.net - Authorize.net CIM - Bank Transfer - BidPay
BluePay - BluePay Echeck - BluePay Remote - Boleto - CashU - CC Avenue - ChronoPay - Direct Debit
EMatters - E-Path - eProcessingNetwork - eWAY Tokens - F2B - Finansbank - GarantiBank - Gate2Shop
Inpay - InternetSecure - IP.Pay - Kuveytturk - Modulo Moip - Mail In Payment - Merchant Partners
Merchant Warrior - IDEALMollie - Moneris - Moneris Vault - Skrill 1-Tap - NaviGate - NETbilling
Netregistry Pay - NoChex - Offline Credit Card - Optimal Payments - PagSeguro - Payflow Pro - Pay Junction
Paymate AU and NZ - Payment Express - PayPal - PayPal Card Payments - PayPal Express Checkout
PayPal Payments - PayPal Payments Pro - PayPoint.net (SecPay) - Payson - Planet Authorize - ProtX VSP Form
PSIGate - Quantum Gateway - Quantum Vault - SagePay - SagePay Tokens v2 - SecurePay
SecurePay AU - Secure Trading - TrustCommerce - USA ePay - WorldPay - WorldPay Invisible