Servers
Contents
Adding a New Server
Watch the video tutorial for this feature.
Adding a Server
WHMCS provides a Server Setup Wizard to allow for quick and easy implementation of new servers.
To use this:
- Go to Configuration () > System Settings > Products/Services > Servers.
- Click Add New Server.
- Input your required module, hostname or IP address, username, and password. Also enter your API Token if you have one.
- Click Test Connection. This will ensure that WHMCS can successfully connect to this server. After testing, the servers configuration page will appear.
- Add more information according to your requirements. For more information, see Manually Adding a New Server.
Manually Adding a New Server
You can add new servers using our older method by going to Configuration () > System Settings > Products/Services > Servers and selecting Add New Server. On this, page, click the "Click Here" link to load the previous experience.
All fields are optional, but you should at least 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.
- 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 (server groups) doesn't apply.
Syncing Accounts to WHMCS
After adding a new server, it's possible that you already have some accounts on your server that you want to import in to WHMCS.
In WHMCS 7.8, we introduced a new Server Sync Tool, which 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 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 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, uncomment the line #phpinfo(); (remove the #) within the index.php file.
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:
- Go to Configuration () > System Settings > Products/Services > Servers.
- Click Create New Group under the Options heading.
- Enter a name for your group.
- Choose whether to assign new orders to the least-full server or fill the default server until it reaches the limit for accounts, and then move to the next server.
- Select the servers you want to assign to this group in the box on the left.
- 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 option. - Click Save Changes to complete the process.
Assigning Products to a Group
To assign a product to a group:
- Find the product in the Products & Services configuration area.
- Click the edit icon for it.
- Click the Module Settings tab.
- 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.