Servers

From WHMCS Documentation

Revision as of 16:50, 29 June 2023 by SarahK (talk | contribs) (Logging In)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In WHMCS, server modules allow you to quickly enable and configure automation on many popular server control panels. You can add each of your servers in order to assign sales to them and perform other important tasks.

You can access this feature at Configuration () > System Settings > Servers or, prior to WHMCS 8.0, Setup > Products/Services > Servers.

Watch the video tutorial for this feature.  

Add a Server

You can add servers to WHMCS using either simple or advanced mode.

To add a new server to your WHMCS installation:

  1. Click Add New Server.
  2. Choose one of the following server configuration methods:
    • For Advanced mode, click Go to Advanced Mode. Advanced mode allows you to manually provide the full list of server details.
    • For Simple Mode, perform the following steps. Simple mode accesses your server to retrieve some or all server information from the server itself.
      1. Select a module from the Module menu. The settings below this change for the module you select.
      2. Enter your server's details.
      3. Click Test Connection to ensure that WHMCS can successfully connect to this server.
      4. If the test succeeded, the server configuration page will appear.
      5. If the test failed, check and update the details you entered and try again. To ignore the failure and continue, click Continue.
  3. Provide the desired server information. For more information, see the sections below.
  4. Click Test Connection to ensure that WHMCS can successfully connect to this server.
  5. Click Save Changes.

Server Settings

For each server, you can configure:

  • Name — Enter a unique name to identify this server.
  • Hostname — Enter the primary domain of the server. The system uses this to link to the server with certain modules.
  • IP Address — Enter the primary IP address of the server. The system uses this to connect to the server.
  • Assigned IP Addresses — Enter the other IP addresses for the server here. The system uses them in conjunction with Utilities > Domain Resolver to check which domains in WHMCS are pointing to your server.
  • Monthly Cost — Optionally enter the monthly server cost. The system uses this in reports to calculate profit.
  • Datacenter/NOC — Optionally, enter the datacenter for the server. The system only uses this to help you keep records of where servers are.
  • Maximum No. of Accounts — Enter the maximum number of accounts to add to the server. The system uses this to find the server's use percentage and determine when the default server is full. Once the selected server is full the default is updated so accounts can be provisioned on the next server with available space.
  • Primary/Secondary/Tertiary/Quaternary Nameservers — Enter the nameservers for this server (for example, ns1.example.com and ns2.example.com). The system uses them in the welcome email and when registering domains.
  • Primary/Secondary/Tertiary/Quaternary Nameserver IPs — Enter the IP addresses for each of the nameservers. The system may use this in emails.
  • Server Type, Username, Access Hash, and Password — Enter the root or reseller login details for your server. For cPanel & WHM servers, you can also enter a username and access hash.
  • Server Status URL — Enter the URL for the status folder. See the Status Monitoring section below.

If this is the only server for the selected module, click on the name and ensure it results in an asterisk (*) next to it. This ensures it is the default. The system will use it when any other non-specific configuration (like a server group) doesn't apply.

Deleting a Server

To delete a server, click the red X icon on the same row as the server you wish to delete. If the deletion succeeds, a message will appear confirming whether you want to delete it. Click OK to remove it.

You cannot delete a server with assigned accounts. This includes terminated and cancelled accounts.

Server Groups

Server groups allow you to configure servers into sets in which you can assign products automatically, based on your requirements and provisioning settings. For example, you may want shared accounts on certain servers and resellers on others, with accounts being distributed evenly between all the servers you have.

Creating a Group

To create a group:

  1. Click Create New Group under the Options heading.
  2. Enter a name for your group.
  3. Choose whether to assign new orders to the least-full server (based on the percentage of accounts available within the Maximum No. of Account value) or fill the default server until it reaches the limit for accounts, and then move to the next server.
  4. Select the servers you want to assign to this group in the box on the left.
  5. Click Add to move them to the box on the right, which contains the servers for this group. If you only assign one server to a group, select the Add to the least full server fill type.
  6. Click Save Changes to complete the process.

Assigning Products to a Group

You can assign products to groups when you edit them at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Products/Services > Products/Services in the Module Settings tab.

Editing/Deleting a Group

You will see the same interface and options when you edit a group as when you create one.

  • You can add or remove servers from a group at any time.
  • You can set the maximum number of accounts to assign to a server when editing the setup of the individual server.

Logging In

Some server modules support logging in to the control panel directly from WHMCS. Click the appropriate button to do this.

Sync Accounts

The Server Sync Tool replaced the cPanel/WHM Import tool in WHMCS 7.8.

When you add a new server, it may already have accounts on it that you want to import to WHMCS. The Server Sync Tool can help you resolve the following issues:

  • Accounts that exist on the remote system (typically a web server) but that do not exist within WHMCS.
  • Service records that are active within WHMCS but that do not exist on the remote system.
  • Service records that exist within WHMCS but have differing info to the remote system.

Performing a Sync

To perform a sync:

  1. Click Sync Accounts for the server you wish to analyse. WHMCS will fetch an up-to-date list of account records from the server. This may require a few seconds. Upon completion, an analysis summary report will display.Server sync analyse.png
  2. Review the displayed report. The report displays two columns containing the data retrieved from the remote system (left) and the service record matches in WHMCS (right).
    • The system highlights differences in red and highlights exact matches in green.
    • Use the ID column in the WHMCS service record to go to the manage service screen for those records and make manual edits.
  3. To update services, check Import/Sync for the desired service. The type of record determines how the system updates the service (see below).
  4. Click Continue.
    Server sync review.png
  5. If you want to make any changes, click Back. Otherwise, click Continue. A summary of the sync process will display.

To view more information about the updated records and other changes, check the activity log at Configuration () > System Logs or, prior to WHMCS 8.0, Utilities > Logs.

Sync Report

Auto-imported services will be created under an existing client with a matching email address, or a newly created client where no existing match exists. Since most web server control panels do not track end customer details, we can usually import only an email address and other details must be populated manually. In cases where even an email address is not available, a placeholder email address of {domain}@example.com will be used for the client in WHMCS.

Partial Match

Service record exists in WHMCS but there are some discrepancies in data.

Checking Import/Sync for a service like this will result in the service being modified to match the information returned from the remote system. This can include updating any of the following: domain, primary IP, username, product, status and/or creation date.

Missing within WHMCS

This occurs when an account exists on the remote system, but no matching service record can be found within WHMCS.

Selecting Import/Sync for a record like this will result in a new service record being created. WHMCS will attempt to use an existing product if a match is found, otherwise it will create a new product also.

Missing on Remote System

This occurs when a service record exists within WHMCS but not on the remote system. You can resolve this using one of the following methods:

  • To terminate the service in WHMCS, check Import/Sync. The system will set the service to Terminated within WHMCS.
  • To create the service on the server, don't check Import/Sync. Instead, go to the service, ensure the details are set correctly, and click Create to provision it again.

Status Monitoring

Watch the video tutorial for this feature.  

Status monitoring allows you to view the load and uptime for each of your Linux-based servers from within the WHMCS Client Area or Admin Area.

To enable this, you must upload the status folder in the WHMCS ZIP file download to each of your servers. Then, enter the URL to that folder in the Server Status URL field. You can also leave the field blank, which disables monitoring for that server.

WHMCS disables PHP Info output by default for security reasons. To enable it, edit the index.php file and uncomment (remove the # character from) the line #phpinfo();.

Customising Ports

The ports that the server status page checks can be customised by editing the /templates/*your active template*/serverstatus.tpl template file. You will need to modify two parts of the template:

Near line 44:

<th class="text-center">HTTP</th>
<th class="text-center">FTP</th>
<th class="text-center">POP3</th>

These are the column headings. You can change them to describe the ports you will be monitoring.

Near line 73:

checkPort({$num}, 80);
checkPort({$num}, 21);
checkPort({$num}, 110);

Change the numbers (80, 21, and 110 by default) to change, add, or remove ports to check.

Status

Status is not the same as Status Monitoring, above. Servers can have one of two statuses: enabled and disabled, denoted by a green check or grey X respectively. During normal operations, a server would be active. However, if you will no longer use an old server and disconnect it, change the status to disabled.

Disabling a server removes it from the daily usage statistics update (which could fail if a disconnected server was active) and moves it to the bottom of all server menus.

To change the status of a server, click the status icon to toggle to the other status. For example, click the green checkmark icon on an active server to deactivate it.