Servers

From WHMCS Documentation

Revision as of 09:08, 14 September 2021 by John (talk | contribs) (Syncing Accounts to WHMCS)

Adding a New Server

Watch the video tutorial for this feature.  

Adding a Server

WHMCS allows for quick and easy implementation of new servers.

To use this:

  1. Go to Configuration () > System Settings > Products/Services > Servers.
  2. Click Add New Server.
  3. Enter your server's details into the required fields.
  4. Click Test Connection. This ensures that WHMCS can successfully connect to this server. After testing, the server configuration page will appear.
  5. Add more information according to your requirements. For more information, see below.

Manually Adding a New Server

Advanced mode lets you add more details during the initial setup of a server. To access this, go to Configuration () > System Settings > Servers, click Add New Server, and then click Click here.

Make sure to enter a name and IP address for each server you add.

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.yourdomain.com and ns2.yourdomain.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.
  • If you use the cPanel, DirectAdmin, or Plesk modules, click Test Connection to test the details you enter on this page. This ensures that the connection and login details are valid before saving.
  • 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.

Syncing Accounts to WHMCS

When you add a new server, it may already have accounts on it that you want to import to WHMCS. The Server Sync Tool allows for quick and easy imports from any server that supports it.

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 or Admin Areas.

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 setup 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 the 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.

Deleting a Server

To delete a server, go to Configuration () > System Settings > Servers and 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.

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, navigate to Setup > Servers and click the status icon to toggle to the other status. For example, click the green checkmark icon on an active server to deactivate it.

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. Server groups make this possible.

Creating a Group

To create a group:

  1. Go to Configuration () > System Settings > Servers or, prior to WHMCS 8.0, Setup > Products/Services > Servers .
  2. Click Create New Group under the Options heading.
  3. Enter a name for your group.
  4. 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.
  5. Select the servers you want to assign to this group in the box on the left.
  6. Click Add to move them to the box on the right, which contains the servers for this group.
    NOTE: If you only assign one server to a group, select the Add to the least full server fill type.
  7. Click Save Changes to complete the process.

Assigning Products to a Group

To assign a product to a group:

  1. Find the product in the Products & Services configuration area.
  2. Click the edit icon for it.
  3. Click the Module Settings tab.
  4. Use the Server Group menu to select the server group. By default, this is None, which assigns the product to the default server for that module.

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.