Integrating FOSSBilling with CWP
Configuring CWP
FOSSBilling is integrated with CWP (Control Web Server) using it’s API. We will briefly describe how to setup the CWP API, however if needed you can view the CWP API documentation.
- First, login to your CWP server and navigate to the
API Manger
module (CWP Settings -> Api Manager) - Click on the
Allow new API access
button - Give the API key a friendly name (such as FOSSBilling), generate an API key (Key code), and enter your FOSSBilling server IP in the
IP Origin
field.- You may optionally enter
%
to allow any IP address to connect to your CWP API, however this is discouraged for security reasons.
- You may optionally enter
- Leave the
Format Request
option set toJSON
- Assign the following permissions to the API key (as of FOSSBilling 0.4.0):
- Account:
Add
,Update
,Delete
,List
,Suspend
,Unsuspend
- Account Details:
List
- Account Package Change:
Update
- Change Password:
Update
- Account:
- Copy the API key you’ve generated and save the changes.
Adding a CWP 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 select CWP from the drop down. - Enter the API key you created in the previous steps
- Click the add server button to save your settings and add the server to FOSSBilling.
Hosting plans with CWP and FOSSBilling
Attempting to use a hosting plan with a name such as “Plan 1” won’t work correctly, instead it should be named “Plan1”.
Due to technical limitations between FOSSBilling and CWP, FOSSBilling cannot create hosting packages automatically. Because of this, you should first create the hosting plans (packages) you want to use from withing CWP and define the limitations and capabilities you want it to have there, as FOSSBilling will be unable to change or define them.
Once you’ve created the package within CWP, you should then create it within FOSSBilling, ensuring that the package name matches exactly between the two. If it doesn’t match, FOSSBilling will be unable to create accounts with that package.