Difference between revisions of "CPanel/WHM"

From WHMCS Documentation

(Adding a cPanel & WHM Server)
Line 1: Line 1:
 +
== About this Module ==
 +
 +
The cPanel module allows you to add and manage cPanel & WHM servers in WHMCS.
 
{{Provisioning_Module
 
{{Provisioning_Module
 
| changepackage = Yes
 
| changepackage = Yes
Line 12: Line 15:
 
# 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'''.
 
# 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'''.
 
# Click '''Add New Server'''.
# Enter the server name and IP address.
 
 
# Select ''cPanel'' from the menu.
 
# Select ''cPanel'' from the menu.
# Enter your WHM username.[[File:Whm_api_setup.png|thumb|WHM API Setup]]
+
# Enter the hostname or IP address.
# Log in to WHM.
+
# Enter the username and password or API token.
# Navigate to '''Development >> Manage API Tokens'''.
+
#* For the username and password, use your WHM account credentials.
# Click '''Generate Token'''.
+
#* You can generate an API token in WHM at '''Development >> Manage API Tokens'''.
# Enter a name for your token. For assistance configuring the WHM API token privileges, see [[#API_Token_Permissions|API Token Permissions]] below.
+
# Click '''Test Connection'''.
# Click '''Save'''.
+
# Enter the desired additional server details.
# Copy your API token.
 
# In WHMCS, paste in the newly-generated API token. We recommend that you check '''SSL Mode'''.  
 
 
# 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]].
 
# 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 '''Create Server'''.
+
# Click '''Save Changes'''.
# If this is the only cPanel 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 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-info"><i class="fa fa-info-circle"></i>  
+
<div class="docs-alert-warning">
If two-factor authentication is enabled on your cPanel & WHM server, [[CPanel/WHM#Disable_2FA_for_cPanel_API|you must disable it for API requests]].</div>
+
If Two-Factor Authentication is enabled on your cPanel & WHM server, you must disable it for API requests. See below.
 +
</div>
  
== Setting Up a cPanel & WHM Package ==
+
=== 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>
 
   
 
   
<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]]
 
[[File:83WPInstallSetting.png|thumb|cPanel Module Settings]][[File:cpanel3.png|thumb|Adding a Package in WHM]]
 
   
 
   
To set up a cPanel & WHM hosting product, follow the steps to create a 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 > Products/Services'''. When you do this, in the '''Module Settings''' tab, make sure to select '''cPanel''' from the menu and perform the appropriate steps below.
+
===== Use an Existing WHM Package =====
 
   
 
   
====Simple Mode====
+
<div class="docs-alert-success">
 +
We introduced this feature in WHMCS 7.0.
 +
</div>
 
   
 
   
'''<i class="fa fa-info-circle"></i> This section describes a feature available in version 7.0 and above.'''
+
To create a hosting product that uses an existing WHM package, use the following product configuration:
+
 
To create a hosting product that uses an existing WHM package, perform the steps in [[Products and Services]] using the following configuration:
+
* For '''Product Type''', select ''Shared Hosting''.
+
* For '''WHM Package Name''', select the desired hosting plan.
* Select '''Shared Hosting''' as the '''Product Type'''.
 
* Select '''cPanel''' as the '''Module Name'''.
 
* From the '''WHM Package Name''' menu, select the hosting plan to use when WHMCS provisions the account.
 
 
You can then configure the remaining settings as desired.
 
 
====Advanced Mode====
 
 
[[File:Cpanel advanced.png|thumb|Advanced Mode]]
 
 
Instead of using a preconfigured WHM package, you can choose to define custom package options.
 
 
   
 
   
 +
===== Defining Custom Options =====
 +
 
<div class="docs-alert-info">
 
<div class="docs-alert-info">
<i class="fa fa-info-circle"></i>
+
To configure quotas on a per-account basis, you must have <tt>root</tt>-level access to the server.
To configure quotas on a per-account basis, you will need <tt>root</tt>-level access to the server.
 
 
</div>
 
</div>
 +
 +
[[File:Cpanel advanced.png|thumb|Advanced Mode]]
 +
 +
To create a hosting product with a custom package, use the following product configuration:
 
   
 
   
To create a hosting product with a custom package, perform the steps in [[Products and Services]] using the following configuration:
+
* For '''Product Type''', select ''Shared Hosting''.
+
* Do '''not''' select a package for '''WHM Package Name'''.
* Select '''Shared Hosting''' as the '''Product Type'''.
+
* 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.
* Select '''cPanel''' as the '''Module Name'''.
 
* Do '''not''' select a package in the '''WHM Package Name''' menu.
 
* Click '''Switch to Advanced Mode''' on the right side of the page and enter the desired values for each package setting. If you do not enter a value, the quota will be unlimited.
 
 
You can then configure the remaining settings as desired.
 
 
   
 
   
===For a reseller package===
+
==== Creating a Reseller Package ====
 
   
 
   
 
[[File:cpanel4.png|thumb|Creating an ACL List]][[File:83WPResellerAccount.png|thumb|cPanel Reseller Module Settings]]
 
[[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, perform the steps in [[Products and Services]] using the following configuration:
+
To create a hosting product for a reseller account, use the following product configuration:
 
   
 
   
* Select '''Reseller Hosting''' as the '''Product Type'''.
+
* For '''Product Type''', select ''Reseller Hosting''.
* Select '''cPanel''' as the '''Module Name'''.
+
* Do '''not''' select a package for '''WHM Package Name'''.
* Do '''not''' select a package in the '''WHM Package Name''' menu.
+
* After clicking '''Switch to Advanced Mode''' on the right side of the page, enter the desired values for each package setting.  
* Click '''Switch to Advanced Mode''' on the right side of the page and enter the desired values for each package setting. If you do not enter a value, the quota will be unlimited.
+
** If you do not enter a value, the quota will be unlimited.
* Enter a '''Reseller ACL List'''.
+
** 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]]'''.
** This ACL '''must''' exist already in WHM.
+
** Make certain to also configure:
** WHM requires that you create a reseller in order to create an ACL list. To do this:
+
*** '''Limit Reseller by Number'''
**# In WHM, navigate to ''Resellers > [[https://docs.cpanel.net/whm/resellers/reseller-center/ Reseller Center]]''.
+
*** '''Limit Reseller by Usage'''
**# Activate an existing or test account as a reseller.
+
*** '''Reseller Disk Space'''
**# Navigate to ''Resellers > [[https://docs.cpanel.net/whm/resellers/edit-reseller-nameservers-and-privileges/ Edit Reseller Nameservers and Privileges]]''.
+
*** '''Reseller Bandwidth'''
**# Create and save your ACL list.
+
*** '''Allow DS Overselling'''
* 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''', and '''Reseller Ownership'''.
+
*** '''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 =====
  
====Per Account Billing====
+
<div class="docs-alert-success">
 +
We added this feature in WHMCS 7.9.
 +
</div>
  
<div class="docs-alert-info"><i class="fa fa-info-circle"></i> This section describes a feature available in version 7.9 and above.</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.
  
You can 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">
 
<div class="docs-alert-info">
We recommend only offering cPanel account usage billing on products with a monthly billing cycle.
+
We recommend only using this for products with a monthly billing cycle.
 
</div>
 
</div>
  
 
[[File:Cpanel usage billing.png|thumb|Enable Usage Billing]]
 
[[File:Cpanel usage billing.png|thumb|Enable Usage Billing]]
  
To use this feature:
+
To configure this:
# Toggle the '''Sub-Accounts''' billing metric to '''On'''. (Do not confuse this with cPanel Subaccounts, which cPanel accounts can create within cPanel.)
+
 
# Click the '''Configure Pricing''' link to set the pricing for the accounts the reseller consumes.
+
# 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'''.
 
# Click '''Save'''.
  
When a client orders this product, WHMCS will track the number of cPanel accounts that the reseller creates.
+
=== WHMCS Connect ===
On the service's '''Next Due Date''', the system records the current number of created cPanel accounts and adds the cost to the service's renewal invoice.
 
  
A guide with pricing examples [https://help.whmcs.com/m/setup/l/1185956-billing-resellers-per-domain is available here].
+
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.
 
+
Usage Billing is a powerful feature. For more information on the terms and possible configurations, see [[Usage_Billing|Usage Billing]].
+
For information on the benefits of WHMCS Connect and how to configure this functionality [[WHMCS_Connect|refer to this page]].
  
===Other Options===
+
== Log in to cPanel ==
*Add Prefix to Package - Add the username_ prefix to the package name when the account is created on the server. This is useful when using multiple servers with the same package name, but different username.
 
  
==Notes==
 
===Log in to cPanel Link===
 
 
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 '''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.
 
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.
  
===Reseller Usage Calculation===
+
== API Token Permissions ==
Reseller usage limits and reporting are based on the behaviour of WHM's design & implementation of a "Reseller" account type. Most notably, resellers owned by root will not have their own usage aggregated into such boundary calculations.
 
  
===WHMCS Connect===
+
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'''.
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]].
 
  
===API Token Permissions===
 
With API Tokens for cPanel & WHM, it is possible to restrict what actions an API Token can perform.  For WHMCS to be able to perform all the operations it supports, the following permissions must be granted in WHM at '''Development >> Manage API Tokens'''.
 
 
<table class="table table-striped">
 
<table class="table table-striped">
 
<tr>
 
<tr>
Line 164: Line 162:
 
</table>
 
</table>
  
When creating an API Token for the <tt>root</tt> user, the <tt>viewglobalpackages</tt> permission is also required.
+
=== root API Tokens ===
  
When using the Configurable Package Addon, the <tt>edit-account</tt> permission will need to be enabled.  
+
When creating an API token for the <tt>root</tt> user, you must also include the <tt>viewglobalpackages</tt> permission.
<div class="docs-alert-info">
+
 
<span class="title">Note for Reseller Accounts</span><br />
+
=== Configurable Package Addons ===
For reseller products, the "Everything" permission needs to be enabled as the reseller API functions on a cPanel server require root access to work.
+
 
</div>
+
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.
  
===Keep DNS Zone on Termination===
+
You may wish to use this, for example, when performing an account migration with DNS forwarding.
When terminating a cPanel & WHM account via the WHMCS admin area, an option is provided to "Keep DNS Zone".
 
  
Selecting this option will terminate the account on a cPanel & WHM server while preserving the DNS Zone Record. Use this option where you wish to terminate the account but preserve the DNS records. Common use cases for this include scenarios such as account migration where DNS forwarding is being used.
+
<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>
  
<div class="docs-alert-warning">'''Please Note:''' You will not be able to re-create a new account on the server using the same domain while a DNS Zone exists for it.  Attempting to provision the domain again will result in an error and you must delete the DNS Zone to be able to successfully provision a new account.</div>
+
== Disable Two-Factor Authentication (2FA) for the cPanel API ==
  
===Disable 2FA for 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.
 
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 facilitate this:
+
To do this:
 
   
 
   
# Log in to WHM as root
+
# Log in to WHM as the <tt>root</tt> user.
# Navigate to '''Security Center > Configure Security Policies'''
+
# Go to '''Security Center > Configure Security Policies'''.
# Uncheck ''API requests'' and click '''Save'''
+
# Uncheck '''API requests'''.
 +
# Click '''Save'''.
  
===Add-On Features===
+
=== 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 like WordPress® Toolkit offerings available through both cPanel and Plesk.
 
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 like WordPress® Toolkit offerings available through both cPanel and Plesk.
Line 194: Line 201:
 
For more information and steps to create an addon, see [[Product Addons]].
 
For more information and steps to create an addon, see [[Product Addons]].
  
==Common Problems==
+
== 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, ensure that:
 
  
#The server settings configured in WHMCS are valid
+
=== Access Denied/Permission Denied ===
#The API credentials have the required permissions to perform the desired action
 
#The ''Username'' and ''Server'' assignment under the client's Products/Services tab in WHMCS match exactly with the account records in cPanel
 
#The user specified on the server settings page is has sufficient permissions to manage the cPanel hosting account in question
 
  
 +
An Access Denied error indicates that the cPanel server denied WHMCS access to perform the requested action (eg. create or modify the account).
  
To check points 1 and 2, begin by navigating to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Servers'''.
+
To investigate and resolve this issue:
Edit the server in question, and ensure the Username and API Token are valid and match those currently configured in WHM.
 
Refer to [[#Adding_a_cPanel_.26_WHM_Server]] above for more detailed instructions
 
  
Ensure all the required permissions have been granted to the cPanel API token, these are itemised in the [[#API_Token_Permissions]] section above
+
# Go to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[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.
  
 
<div class="docs-alert-success">
 
<div class="docs-alert-success">
<span class="title">Tip</span><br />
+
Click '''Test Connection''' to confirm that the account has access.
Use the ''Test Connection'' button to confirm access granted.
 
 
</div>
 
</div>
  
===You do not have permission to use Selected Package===
+
=== You do not have permission to use Selected Package ===
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 '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Products/Services''' or, prior to WHMCS 8.0, '''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.
+
 
 +
If you receive this error when trying to create an account, correct the entered package name.  
 +
 
 +
To do this:
 +
 
 +
# Go to the '''Module Settings''' tab for the relevant product at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Products/Services''' or, prior to WHMCS 8.0, '''Setup > Products/Services'''.
 +
# 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.
  
===Package Not Allowed or Exceeded Resource/Account Allocation===
+
=== Package Not Allowed or Exceeded Resource/Account Allocation ===
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 Package Editor.
 
  
===Resellers are not permitted to create subdomains of the server's main domain===
+
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.
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 '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Products/Services''' or, prior to WHMCS 8.0, '''Setup > Product/Services'''.
 
  
===Unable to validate setting for language: english===
+
=== Resellers are not permitted to create subdomains of the server's main domain ===
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===
+
This indicates that the domain is missing. Ensure that you have entered a domain name for the product.  
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===
+
You may need to enable '''Require Domain''' at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > Products/Services''' or, prior to WHMCS 8.0, '''Setup > Product/Services'''.
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.
+
=== 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 <tt>test</tt>. 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 ===
  
===Login Failed===
 
 
There are two possible causes for this error:
 
There are two possible causes for this error:
  
# 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 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/Services''' or, prior to WHMCS 8.0, '''Setup > Products/Services > Products/Services'''.
  
===No user name supplied: "username" is a required argument===
+
=== Action Failed Unable to auto-login. Please contact support ===
This means the username under the client's Products/Services tab is empty.
 
  
You should enter a username, save changes and try module creation again. Also ensure that '''Require Domains''' is checked in '''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'''.
+
This indicates that the username under the client's '''Products/Services''' tab is empty.
  
===Action Failed Unable to auto-login. Please contact support===
+
Enter a username, save the changes, and then run the '''Create''' command again.  
This error also means the username under the client's Products/Services tab is empty.
 
  
You should enter a username, save changes and try module creation again. Also ensure that '''Require Domains''' is checked in '''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'''.
+
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===
 
=== WHM Username is missing for the selected server===
Seeing this error when attempting to provision a hosting account is caused by a server balancing misconfiguration. Ie. no server is selected upon which the account should be created. For troubleshooting steps for this particular issue,  [[Provisioning_Issues#Server_Command_Error_-_Curl_Error_-_Couldn.27t_resolve_host_.286.29|please refer to this article]]
 
  
===An Unknown Error Occurred after updating to cPanel 74===
+
This error indicates a server balancing misconfiguration (for example, you have not selected a server to use when creating the account).
After updating to cPanel 74, every module command performed results in a "An unknown error occurred" message.  Inspecting the [[Troubleshooting_Module_Problems|Module Debug Log]] reveals that a WHM 404 error page is being returned by the server.
+
 
 +
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.
  
This is caused by the [https://blog.cpanel.com/march-2017-development-update deprecation of the cPanel XML API] in version 74. To use the newer cPanel JSON API, it is necessary to [[Updating|update]] to WHMCS 7.3 or above.
+
To confirm this:
  
===WHM Package not shown in Module dropdown list when editing product===
+
# [[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'''.
  
The cPanel API only returns packages available to provision under the reseller's WHM account. This often means packages may not show in this list if it would exceed the reseller's allowances on their WHM account.
+
You can use two methods to resolve this issue:
  
Confirm this diagnosis by following these steps:
+
* Ensure that the WHM account has sufficient resources to provision the desired WHM package.
# [[File:Whm_packages_list_limits.png|thumb|cPanel Package Limits]]Log in to WHM and navigate to '''Account Functions » Create a New Account'''.
+
* Enable [https://docs.cpanel.net/knowledge-base/cpanel-product/overselling/|overselling] on the reseller account. This requires <tt>root</tt> access.
# Select the desired package from '''Choose a Package'''. The package name will display with the message <tt>Cannot use due to limits</tt>.
 
  
There are two ways to resolve this issue:
+
=== Product attribute Package Name "Package Name" not found on server ===
# Ensure that the WHM account has sufficient resources to provision the desired WHM package.
 
# Enable overselling on the reseller account.
 
#* This requires root access.
 
#* For more information, see the [https://docs.cpanel.net/knowledge-base/cpanel-product/overselling/| cPanel docs].
 
  
===Product attribute Package Name "Package Name" not found on server===
 
 
There are two possible causes of this error:
 
There are two possible causes of this error:
* [[#Package Not Allowed or Exceeded Resource/Account Allocation|Package name must be entered exactly as defined in WHM]]
+
* The package name in WHMCS does not exactly match [[#Package Not Allowed or Exceeded Resource/Account Allocation|the package name in WHM]].
* [[#WHM Package not shown in Module dropdown list when editing product|Insufficient resources to create the package]]
+
* The server lacks [[#WHM Package not shown in Module dropdown list when editing product|sufficient resources to create the package]].
 
 
  
 
{{modules}}
 
{{modules}}

Revision as of 20:05, 8 April 2022

About this Module

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

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-acct 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 like WordPress® Toolkit offerings available through both cPanel and Plesk.

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.
  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 [1] 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:

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