You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 40 Next »

Table of Contents

About cPanel

cPanel/WHM is a popular and widely used web hosting control panel. Learn more about cPanel/WHM on their website at http://www.cpanel.net/.

Supported Features

CreateCancelSuspendUnsuspendManagementConfig Options
YESYESYESYESYESNO

Management Features

This module supports the following management features within the client area:

  • Change cPanel Password
  • View Disk and Bandwidth usage

 

 

Installing cPanel

To install the cPanel module, visit [Settings] > [Company] > [Modules] > Available, and click the "Install" button for cPanel.

A message will be displayed, indicating that the module was successfully installed. Then click the "Add Server" button.

Enter the details for your cPanel/WHM server.

Field NameDescription
Server LabelEnter a label for this cPanel/WHM server, it can be anything you like.
HostnameEnter the FQDN hostname for your cPanel/WHM server, ie "server1.domain.com".
User NameEnter your WHM username. This is the username you would log into WHM with.
Remote Key

Enter your WHM server remote key. This can be obtained in WHM under "Setup Remote Access Key".

Use SSL when connecting to the APICheck this option to use SSL for all API requests to your WHM server. This is highly recommended.
Account LimitEnter the maximum number of accounts that should be added to this cPanel/WHM server.
Name ServersEnter the name servers that should be used for this server. These will be available to the package welcome email to the client.
NotesEnter any notes that pertain to this server for future reference.

After filling out these options, click "Add Server" to add your cPanel/WHM server.

Server Groups

Server groups are useful for categorizing cPanel servers. When creating a Package, a specific server, or a server group may be selected for provisioning. Blesta will automatically select a cPanel server to provision with when a server group is chosen.

To add a server group, from the cPanel overview at  [Settings] > [Company] > [Modules] > cPanel, click "Add Server Group", then enter the details.

OptionDetails
Group Name

Enter the name for this server group.

Add OrderChoose how servers in this group will be selected for provisioning. Currently, first non-full server is the only add order.
Assigned ServersSelect servers under "Available Servers" and click to move them to the left column to add them to the group.

Creating Packages

Packages define the pricing, welcome email, module and more. Packages can be assigned to Package Groups, and added to Order Forms. To create a Package, visit [Packages] > Browse, and click the "Create Package" button.

Creating a Package consists of several sections:

Basic

The Basic section consists of the following options:

Field NameDescription
Package NameEnter the name of this Package, it will be visible wherever services are listed and on any order forms.
Status"Active" is the default, "Inactive", and "Restricted" are also available.
Quantity AvailableIf this Package has a limited quantity available, enter the quantity, or leave it as "Unlimited".
DescriptionEnter a Description for this Package. HTML is allowed, and descriptions appear on order forms.
Configurable OptionsA Configurable Option Group may be selected if previously created, but this module does not support configurable options during provisioning.
ModuleSelect "cPanel" for the module.

Module Options

The Module Options section consists of the following options, which are specific to cPanel:

Field NameDescription
Server GroupSelect "Any" if you wish to specify a specific server, or select the Server Group to provision from. Selecting a group means that accounts will be provisioned from the group. Selecting a group is recommended.
ServerIf "Any" is selected above, select the server this package will use to provision accounts.
cPanel PackageSelect the cPanel Package to use when configuring accounts. These values are pulled from "Packages" created in WHM and specify resources for the plan.
Account TypeSelect "Standard" if this is a standard cPanel account, or "Reseller" if it's a reseller account. If selecting Reseller, you'll be asked also to select an ACL as configured in WHM.

Pricing

Field NameDescription
TermEnter the term for the desired pricing option. For example, if you wish to create a 3 month pricing option, enter 3 here.
PeriodSelect the period for this pricing option. "Day", "Week", "Month", "Year", and "One time" are options. The client will be invoiced every "term period", for example every 3 months if 3 is entered for term, and Month is selected for period.
CurrencySelect the currency this pricing option is available for.
PriceEnter the price for this pricing option.
Setup FeeIf there is a setup fee, enter it here.
Cancellation FeeIf there is a fee to cancel early, enter it here.

Click the "Add Additional Price" to add more pricing options. It's common for people to create 1 Month, 3 Month, 6 Month, and 1 Year price options. There are many possible combinations.

Welcome Email

The "Tags" section describes tags that may be used in the welcome email. The welcome email content is inserted into the "Service Creation" email template under [Settings] > [Company] > [Emails] > Service Creation. Only details unique to this service should be entered into the welcome email section for the package.

Sample Email

This sample email could be used in the Package Welcome Email section to help you get started. Be sure to enter content for your welcome email in both the HTML and Text sections.

Your cPanel account is now active, details below:

Domain: {service.cpanel_domain}
Username: {service.cpanel_username}
Password: {service.cpanel_password}

To log into cPanel please visit https://{module.host_name}:2083.
Please update your name servers as soon as possible to the following:

{% for name_server in module.name_servers %}
Name server: {name_server}{% endfor %}

Thank you for your business!

When creating or editing a package that uses this module, the following tags will be available:

TagsDescriptionNotes
{module.host_name}The host name of the server that the service was provisioned one.g. "domain.com"
{module.name_servers}An array of available name servers for this module

Array elements must be looped over in the email template. See below for an example.

{package.type}The package meta typee.g. "standard", "user", "reseller", etc.
{package.package}The package meta package namee.g. "Bronze"
{package.acl}The package meta access control list 
{service.cpanel_username}The service field for the cPanel account username 
{service.cpanel_password}The service field for the cPanel account password 
{service.cpanel_domain}The service field for the cPanel domaine.g. "domain.com"

Due to the nature of tag objects containing several fields, many of which are likely irrelevant for use in email templates, but may be useful to you in certain circumstances, a dump of the tags are shown below.

The {module} object
stdClass Object
(
    [host_name] => domain.com
    [name_servers] => Array
        (
            [0] => ns1.domain.com
            [1] => ns2.domain.com
		)
 )
The {package} object
stdClass Object
(
    [id] => 32
    [id_format] => {num}
    [id_value] => 12
    [module_id] => 4
    [name] => Package Name
    [description] => Package Text Description
    [description_html] => <h1>Package HTML Description</h1>
    [qty] => 3
    [module_row] => 6
    [module_group] => 
    [taxable] => 0
    [status] => active
    [company_id] => 1
    [id_code] => 12
    [email_content] => Array
        (
            [0] => stdClass Object
                (
                    [lang] => en_us
                    [html] => <p>Welcome email html</p>
                    [text] => Welcome email text
                )
        )

    [pricing] => Array
        (
            [0] => stdClass Object
                (
                    [id] => 43
                    [term] => 123
                    [period] => day
                    [price] => 3.0000
                    [setup_fee] => 0.0000
                    [cancel_fee] => 0.0000
                    [currency] => AUD
                )

            [1] => stdClass Object
                (
                    [id] => 42
                    [term] => 0
                    [period] => onetime
                    [price] => 2.0000
                    [setup_fee] => 0.0000
                    [cancel_fee] => 0.0000
                    [currency] => USD
                )

        )

    [meta] => stdClass Object
        (
            [package] => Bronze
            [type] => standard
        )

    [groups] => Array
        (
            [0] => stdClass Object
                (
                    [id] => 2
                    [name] => Standard Group
                    [type] => standard
                )

        )

    [package] => Bronze
    [type] => standard
)
The {service} object
stdClass Object
(
    [id] => 124
    [parent_service_id] => 
    [id_format] => {num}
    [id_value] => 119
    [pricing_id] => 42
    [client_id] => 3
    [module_row_id] => 6
    [coupon_id] => 
    [qty] => 1
    [status] => active
    [date_added] => 2013-03-07 18:57:45
    [date_renews] => 
    [date_last_renewed] => 
    [date_suspended] => 
    [date_canceled] => 
    [id_code] => 119
    [fields] => Array
        (
            [0] => stdClass Object
                (
                    [key] => cpanel_domain
                    [value] => domain.com
                    [serialized] => 0
                    [encrypted] => 0
                )

            [1] => stdClass Object
                (
                    [key] => cpanel_password
                    [value] => password
                    [serialized] => 0
                    [encrypted] => 1
                )

            [2] => stdClass Object
                (
                    [key] => cpanel_username
                    [value] => domainco
                    [serialized] => 0
                    [encrypted] => 0
                )

        )

    [package_pricing] => stdClass Object
        (
            [id] => 42
            [package_id] => 32
            [term] => 0
            [period] => One time
            [price] => 2.0000
            [setup_fee] => 0.0000
            [cancel_fee] => 0.0000
            [currency] => USD
        )

    [package] => stdClass Object
        (
            [id] => 32
            [id_format] => {num}
            [id_value] => 12
            [module_id] => 4
            [name] => Package Name
            [description] => Package Text Description
            [description_html] => <h1>Package HTML Description</h1>
            [qty] => 3
            [module_row] => 6
            [module_group] => 
            [taxable] => 0
            [status] => active
            [company_id] => 1
        )

    [name] => domain.com
    [cpanel_domain] => domain.com
    [cpanel_password] => password
    [cpanel_username] => domainco
)
Displaying Name Servers in the Welcome Email

The {module.name_servers} tag must be iterated over to display the name servers. Email tag usage is elaborated upon on the Customizing Emails page.

Consider an example where the module has two name servers set, named "ns1.domain.com" and "ns2.domain.com". The following can be added to the email template to output the name servers:

{% for name_server in module.name_servers %}
Name server: {name_server}{% endfor %}

The welcome email will display this as:

Name server: ns1.domain.com
Name server: ns2.domain.com

Group Membership

If this is the first Package you are creating with this module, select the "Create a New Group" option, and enter a Group name. If you are adding a subsequent Package and wish for it to be part of the same group, select "Select from Available Groups", and move the group from the right to the left of the multi-select box.

When finished, click "Create Package" to create this package.

Final Steps

The only thing left to do is to add this Package Group to an order form so clients may place orders for your cPanel servers. See Creating an Order Form for more details.

Moving cPanel Accounts

If you need to move one or more cPanel accounts to a new or different server, follow these steps:

  1. Use the copy account feature in WHM to move the account to the new server.
  2. Make sure the new server has been added to the module under Settings > Company > Modules > cPanel and that the new server and the old server are in the same server group.
  3. Update your packages so that they are using this server group if they are not already.
  4. Click to "Manage" each affected service, and an option should appear to change the server to another server in the same server group. This option will only appear if the packages are set up to use a server group rather than a specific server.
  5. Repeat step 3 until all affected cPanel accounts have been updated to the new server.
  6. You may remove the old server from the server group, but you should leave it in the module.
  7. You may update the packages to use the new server specifically, rather than the group if you wish. This will remove the option for changing the server when managing a service, but it will remain attached to the correct server.

Importing cPanel Accounts

It's sometimes necessary to add cPanel accounts to Blesta that were created manually in WHM/cPanel, or in another system. To do so, follow these steps for each account:

  1. Go to the profile for the client you want to add the cPanel account to [Clients] > [Browse] and click on the client ID, or perform a search.
  2. Click Add Service under Account Actions on the left, or click the [+] button in the Services widget.
  3. Select the correct Package for the plan you are adding, and Continue.
  4. Select the Term, and uncheck the "Send order confirmation" and "Provision using the cPanel module" boxes. You may also wish to select "Do not Invoice" for Invoice method, but this will depend on whether you'd like to create an invoice now or not.
  5. Enter the domain name and click "Continue".
  6. The service should be added, now click the Manage icon next to the service on the client's profile page.
  7. Enter the correct username under the "Username" field, uncheck the "Use module" option, and save.
  8. If you need to sync the renew date to a specific day, click on the Manage link for the service again, and select "Change Renew Date" under the Actions drop down. Set the nex renew date, uncheck the "Prorate" option, and Save.
  9. Repeat for each account.

 

 

  • No labels