Connect DirectAdmin servers
ClientFence creates, suspends and removes DirectAdmin users through the DirectAdmin API. You add each server once with an admin login, then link your hosting plans to DirectAdmin packages.
Make a login key in DirectAdmin
Section titled “Make a login key in DirectAdmin”A login key is a separate password for the API. You can also use the admin password, but a key can be limited to some commands and to your ClientFence server’s IP address.
- Sign in to DirectAdmin as the admin and open User Level → Login Keys.
- Select CREATE KEY, enter a Key Name and a Key Value (or generate one), and leave Allow HTM off.
- In Commands, allow what ClientFence uses:
CMD_API_LOGIN_TEST,CMD_API_SHOW_RESELLER_IPS,CMD_API_PACKAGES_USER,CMD_API_ACCOUNT_USER,CMD_ACCOUNT_RESELLER,CMD_API_SELECT_USERS,CMD_API_SHOW_USERS,CMD_API_SHOW_USER_CONFIG,CMD_API_MODIFY_USER,CMD_API_USER_PASSWDand, for the client’s one-click sign-in,CMD_API_LOGIN_KEYS. - In Allowed IPs, enter the IP address of your ClientFence server.
- Enter your Current Password and save.
See DirectAdmin’s Creating a login key.
Add the server
Section titled “Add the server”- Go to System → Hosting Plans and Servers, stay on the Hosting Servers tab and select New Server.
- Fill in the form and select Add Server:
| Field | What to enter |
|---|---|
| Name | Any name you know the server by. |
| Hostname | The address DirectAdmin opens at, such as server1.example.com. ClientFence connects to it. |
| IP | The server’s main IP address. |
| Server Manager | DirectAdmin. |
| Username | The admin user name, such as admin. |
| Password / Login Key | The login key (or the admin password). |
| Connection Port | Empty uses 2222. |
| Use Secure Connection | Yes for HTTPS, No if DirectAdmin runs on plain HTTP. |
| Verify TLS Certificate | Yes, unless the server uses a self-signed certificate. |
| Password Length | Length of the passwords ClientFence makes for new accounts. Empty means 10. |
- Select Test Connection (the signal icon) on the server’s row. It signs in to the API.
On the server’s edit page, Users Prefix adds a prefix to the user names ClientFence makes. Saved credentials are never shown again. To change one, enter a new value and save.
Link hosting plans to DirectAdmin packages
Section titled “Link hosting plans to DirectAdmin packages”Make a hosting plan on the Hosting Plans tab (New Plan) and fill in its limits on the plan’s page. When an account is created or its plan changes, ClientFence looks for a DirectAdmin user package with the hosting plan’s name:
- The package exists: the user gets that package.
- It does not: the user gets custom limits from the hosting plan instead (disk, bandwidth,
addon and parked domains, subdomains, FTP, databases and email accounts).
unlimitedin a limit sets it to unlimited.
To use a package with another name, add the Parameter Name package with the DirectAdmin
package name as Parameter Value under Hosting Plan Additional Parameters, then select
Add New Field. For custom limits you can also add nemailf, nemailml, nemailr (email
forwarders, mailing lists, autoresponders) and switches set to 1 or 0: aftp, catchall,
cgi, cron, dnscontrol, login_keys, php, spam, ssh, ssl, suspend_at_limit,
sysinfo. Switches you do not add are off, except dnscontrol and sysinfo.
Then choose the server and the hosting plan in the product’s Configuration tab, under Hosting Settings. See Products.
What ClientFence does in DirectAdmin
Section titled “What ClientFence does in DirectAdmin”| Action | What happens |
|---|---|
| Order activated | Creates the user with a user name from the domain (up to seven letters and digits plus a number), a new password, the client’s email and one of the admin’s IP addresses chosen at random. With Reseller Hosting, creates a reseller on a shared IP. If DirectAdmin answers that the domain already exists, the order counts as created. |
| Suspend / unsuspend | Suspends or unsuspends the user. Unsuspending a user that is not suspended fails. |
| Cancel | Deletes the user. |
| Change Hosting Plan | Gives the user the new package, or the new custom limits. |
| Change Account Password | Changes the user’s password. Clients can do this on their service page too. |
| Change Username, Change Domain, Change IP | Not supported: the action stops with the message “DirectAdmin does not support …”. |
| Sync with server | Not shown for DirectAdmin accounts. |
| Login to Control Panel (client) | Opens DirectAdmin signed in, with a one-time link valid for 30 minutes. A reseller gets the sign-in page. |
| Jump to control panel (staff) | Opens https://<Hostname>:2222 (your protocol and port). |
A new password reaches DirectAdmin on active, suspended and expired orders. While an order is not yet set up or is canceled, it is saved in ClientFence only.
If something fails
Section titled “If something fails”- The “DirectAdmin” server manager is not fully configured: fill in the Hostname, Username or Password / Login Key the message names.
- Failed to connect to the DirectAdmin server. Please verify your credentials and configuration: DirectAdmin answered with its sign-in page. Check the user name, the key, its Allowed IPs and Use Secure Connection.
- … does not exist in your authority level: the login key does not allow that command.
- There are no available IPs on this server.: the admin has no IP addresses to give users.
- Failed to … on the DirectAdmin server, check the error logs: DirectAdmin refused the request. Its reason is in Activity → System Activity.
- The DirectAdmin server returned HTTP status …: DirectAdmin answered with an HTTP error. Check that the server is up and the Hostname, port and login key.
- Could not connect to the DirectAdmin server: check the Hostname, the Connection Port and the server’s firewall.
Failed order actions are listed under Orders → Failed actions. See Failed actions.

