Integrating FOSSBilling with WHM
Configuring WHM / cPanel
FOSSBilling is integrated with WHM using it’s API. We will briefly describe how to setup the WHM API, however if needed you can view the WHM API documentation.
- Log in to WHM and Go to
Development
->Manage API Tokens
- Click on
Generate Token
. - Give the token a friendly name (“billing” for example).
- Scroll down and go through permissions. Most of the time you don’t need to adjust this, but become familiar with what the API will have access to.
- Scroll to the bottom and click on
Save
. - The token will now appear. Copy and save the token where you can reference it later, as WHM will not let you view the token again.
- Now that you have completed these steps, follow the steps in the next section to add the server inside of FOSSBilling.
Adding a WHM server to FOSSBilling
- Login to your admin panel.
- Go to
System
->Hosting plans and servers
from within the navigation bar. - Go to the “New server” tab and fill out the name, hostname, and IP address, and nameservers for your server.
- Select the
Server manager
drop down and selectWHM (cPanel)
from the drop-down. - Enter the WHM ROOT username (NOT the name you gave the API in WHM). This must be a username that you use to log into your WHM server!
- Enter the API token you created in the previous steps.
- Click the add server button to save your settings and add the server to FOSSBilling.
Hosting plans with WHM and FOSSBilling
When using FOSSBilling with WHM, FOSSBilling will first check and see if the WHM server has a package that matches the name of the hosting plan configured for the ordered product. If there is not a matching package, FOSSBilling will then create it using the hosting package details you entered within FOSSBilling.
Configuring on WHM (Recommended)
- Create the package from within WHM under the account you are using to authenticate with WHM from FOSSBilling.
- Configured the package as you wish and would normally when using WHM.
- Create a new package from within FOSSBilling, ensuring that the names exactly match between both FOSSBilling and WHM.
Note: Keep in mind, accounts will only follow the limits as set within WHM and the details you configure in FOSSBilling don’t matter as long as the package name matches.
Creating on FOSSBilling
If you wish to have FOSSBilling automatically create the package for you, follow these steps.
- Create the hosting package for the server from within FOSSBilling and configure the limits as you see fit.
- If needed, refer to the information below to configure optional package options and add them to the
Hosting plan additional parameters
section of the hosting plan.
Note: While FOSSBilling will create the package for you, changes to the package within FOSSBilling will not by synced to the WHM server and as such any changes will need to be manually performed on the WHM server.
Additional Parameters
Name | Example Values | Description |
---|---|---|
cgi | 1 or 0 | Whether CGI access is enabled for the account. |
cpmod | jupiter | The hosting plan’s cPanel theme. |
maxlst | unlimited , null , or 250 | The hosting plan’s maximum number of mailing lists. |
hasshell | 1 or 0 | Whether the hosting plan allows shell access. |