The Problem
WHMCS has no native CDN integration. Hosting providers manually provision BunnyCDN pull zones, configure DNS, manage SSL certificates, and track bandwidth usage across spreadsheets.
What This Looks Like
Client orders hosting β Admin logs into BunnyCDN dashboard β Creates pull zone manually β Emails CNAME records β Client updates DNS β Admin waits for propagation β Admin enables SSL β Admin tracks bandwidth in spreadsheet β Client exceeds limit β Admin notices days later β Manual suspension
Result: hours wasted on tasks that should be automated.
Why Manual CDN Management Fails
Time waste: Each CDN setup takes 15-30 minutes of admin time. Multiply by dozens or hundreds of clients.
Revenue leakage: No bandwidth tracking means clients exceed limits without consequences. You pay BunnyCDN overages, client pays nothing.
Support overhead: Clients open tickets for DNS instructions, SSL status, cache purging, statistics. Every request needs admin intervention.
Human error: Forgot to set up a zone? Configured wrong origin? Typo in hostname? Manual processes fail.
The Solution
BunnyCDN for WHMCS automates pull zone creation, SSL provisioning, bandwidth limiting, and client self-service management.
What It Does
Automatic Provisioning: WHMCS activates service β Module creates pull zone via API β Configures custom hostname β Requests SSL certificate β Client gets instant CNAME instructions β No admin involvement
Bandwidth Enforcement: Daily cron checks usage β Compares against configurable limit β Auto-suspends on overage β Creates todo item for admin β Activity logged
Client Self-Service: View pull zone details β See CNAME records β Check SSL status β Purge cache β View statistics β All from service page
Three Deployment Options:
- Standalone product (dedicated CDN service)
- Paid addon (upsell to hosting plans)
- Free integrated (included with hosting)
Technical Implementation
Architecture: Addon module handles admin interface, settings, cron jobs. Server module handles product provisioning for Option 1 (standalone). Hooks inject client interface into service pages for Options 2 and 3.
Database: Creates two tables:
mod_bunnycdn_pull_zones: zone mappings, bandwidth tracking, suspension statusmod_bunnycdn_hostnames: custom hostnames, SSL status, CNAME records
API Integration: Uses BunnyCDN Account API (not Storage API). Requires API key from dash.bunny.net/account/api-key. Wrapper class handles authentication, rate limiting, error handling.
Cron Job: Daily task at 3 AM:
- Fetches usage for all active zones
- Compares against bandwidth limits
- Marks zones as suspended in database
- Creates admin todo items
- Logs all actions
Hooks:
ClientAreaFooterOutput: injects CDN panel on service pagesAfterModuleCreate: logs provisioningAdminAreaClientSummaryActionLinks: quick admin accessAdminHomeWidgets: statistics dashboardClientAreaSecondarySidebar: menu integration
Deployment Options Explained
Option 1: Standalone Product
CDN as separate billable product.
Setup β Products/Services β Create Product
Module Settings β bunnycdn (server module)
Configurable Options:
- Pricing Zone: Standard | Volume
- Bandwidth Limit: 100GB | 500GB | 1TB | 5TB
Pull zone auto-creates on product activation. Client manages from dedicated service page.
Option 2: Paid Addon
Upsell to existing services.
Setup β Products/Services β Product Addons
Create addon, assign to hosting products
Client purchases from shopping cart
Activation form appears on hosting service page
No server module needed. Addon purchase triggers CDN activation.
Option 3: Free Integrated
Include with hosting plans at no extra charge.
Addons β BunnyCDN β Settings β CDN-Enabled Products
Select hosting products
Activation form auto-appears on service pages
No checkout flow
Pure value-add. Clients activate instantly, no additional billing.
Bandwidth Limiting
Important limitation: BunnyCDN API does not support disabling zones. Module marks zone as "suspended" in WHMCS database, creates admin todo item, but zone continues serving traffic in BunnyCDN.
Why this matters: You still pay BunnyCDN for overage traffic. Suspension is a flag for admin action, not technical enforcement. Admin must manually delete zone in BunnyCDN dashboard or contact client to upgrade.
Configuration:
Add configurable option to product:
Option Name: Bandwidth Limit (case-sensitive)
Option Type: Dropdown
Values: 100GB|500GB|1TB|5TB
Enable in module settings:
βοΈ Enable Bandwidth Limiting
Cron behavior:
3 AM daily:
For each active zone with bandwidth limit:
Fetch current month usage from BunnyCDN API
If usage > limit:
Mark zone as suspended in mod_bunnycdn_pull_zones
Create todo: "BunnyCDN overage: {hostname} used {usage} of {limit}"
Log activity: "Suspended due to bandwidth limit"
Next zone
Supported limit formats: 100GB, 1TB, 500 GB, 1.5TB (spaces and decimals OK)
Applies to: Product-based services only (Options 1 & 2). Not CDN-Enabled Products (Option 3) because those have no individual billing.
SSL Certificate Management
BunnyCDN provides free SSL via Let's Encrypt. Module automates provisioning.
Process:
- Admin adds custom hostname:
cdn.example.com - Module returns CNAME:
cdn.example.com CNAME xyz.b-cdn.net - Client configures DNS
- Module requests SSL via API
- BunnyCDN validates DNS, issues certificate
- Certificate active in 5-60 minutes
Status indicators:
- Red badge: DNS not configured or SSL pending
- Green badge: Certificate active
- Gray badge: SSL not enabled
Client actions:
- "Refresh SSL Status": polls BunnyCDN API for current state
- "Enable SSL": requests certificate (requires valid DNS first)
Why this works: BunnyCDN handles ACME challenge, certificate renewal, everything. Module just triggers the process.
When You Need This
Required if:
- Offering CDN services
- BunnyCDN customer
- Provisioning zones manually
- Tracking bandwidth in spreadsheets
- Handling CDN support tickets
Not required if:
- No CDN offerings
- Using different CDN provider
- Self-hosted CDN infrastructure
- Clients manage their own BunnyCDN accounts
ROI calculation:
Manual provisioning: 20 minutes Γ β¬50/hour = β¬16.67 per client
Module cost: one-time purchase
Breakeven: 3-4 CDN activations
Installation
- Purchase license from arkhost.com/store/whmcs-modules/bunnycdn
- Upload
modulesfolder to WHMCS root (merge with existing) - Go to Setup β Addon Modules
- Find "BunnyCDN" and click Activate
- Click Configure
- Enter license key from ArkHost purchase
- Click "Settings" tab
- Paste BunnyCDN API key from dash.bunny.net/account/api-key
- Configure defaults (or leave as-is)
- Save
Module is now active. Configure deployment option next.
Configuration
API Setup
Get BunnyCDN API key:
- Login to BunnyCDN dashboard
- Navigate to Account β API
- Copy Account API Key (not Storage API Key)
- Paste in WHMCS: Addons β BunnyCDN β Configure β Settings tab
Test connection: Click "Test API Connection" button. Should return: "API connection successful!"
If fails:
- Verify no leading/trailing spaces in API key
- Check firewall allows outbound HTTPS to api.bunny.net
- Test manually:
curl -H "AccessKey: YOUR_KEY" https://api.bunny.net/pullzone
Module Settings
Auto Create Pull Zones: Only enable for Option 1 (standalone products using server module). Leave disabled for Options 2 & 3.
Auto Enable SSL: Recommended: Yes. Automatically requests SSL certificates when custom hostnames are added. Requires valid DNS first.
Default Pricing Zone:
- Standard: US and EU regions, cheaper, lower coverage
- Volume: Global coverage, slightly more expensive
Choose based on target market. Can override per-product via configurable options.
Pull Zone Prefix: Default: whmcs- Prepended to all zone names. Example: whmcs-client-123 Prevents naming conflicts if you have multiple WHMCS installations.
KB Article URL: Optional link to your help documentation. Shows in client interface as "View Documentation" button.
Enable Bandwidth Limiting: Only relevant for Options 1 & 2 (product-based). Enable if you want automatic suspension on overage. Requires configurable option named "Bandwidth Limit" on products.
Choosing Deployment Option
For standalone CDN product (Option 1):
Setup β Products/Services β Create New Product
Module Settings:
Module Name: bunnycdn
Automatically setup: Yes
Add configurable options if desired
Leave "CDN-Enabled Products" in module settings empty
For paid addon (Option 2):
Setup β Products/Services β Product Addons
Create addon, assign to hosting products
Leave "CDN-Enabled Products" in module settings empty
For free integrated (Option 3):
Addons β BunnyCDN β Settings β CDN-Enabled Products
Select hosting products to include CDN
Save
Activation form auto-appears on those service pages
Usage
Admin: Creating Pull Zone Manually
- Addons β BunnyCDN
- Click "Create Pull Zone"
- Select client from dropdown
- Enter origin URL (e.g.,
https://example.com) - Choose pricing zone
- Click Create
Zone appears in list immediately. BunnyCDN generates hostname like xyz.b-cdn.net.
Admin: Adding Custom Hostname
- Find pull zone in admin list
- Click globe icon
- Enter hostname:
cdn.example.com - Click Add
- Provide CNAME to client:
cdn.example.com CNAME xyz.b-cdn.net
After client configures DNS, click "Enable SSL" or wait for auto-provisioning (if enabled).
Admin: Importing Existing Zones
If you already have BunnyCDN zones created manually:
- Addons β BunnyCDN β Import Zones
- Module fetches all zones from your BunnyCDN account
- Select client for each zone
- Optionally select WHMCS service
- Click Import
Zones now appear in WHMCS. Client can manage from service page.
Admin: Viewing Statistics
Click "Statistics" icon on any pull zone:
- Bandwidth usage (current month)
- Total requests
- Cache hit rate
- Geographic distribution
Data fetched live from BunnyCDN API.
Admin: Purging Cache
- Click trash icon on pull zone
- Confirm purge
- BunnyCDN clears cache globally
Useful after client updates website content.
Client: Activating CDN (Options 2 & 3)
Client navigates to service page. Sees "Activate CDN" form:
- Enter origin URL:
https://example.com - Click "Activate CDN"
- Module creates pull zone instantly
- Page reloads, shows pull zone details
Client: Viewing Pull Zone Details
After activation, client sees:
- BunnyCDN hostname:
xyz.b-cdn.net - Origin URL
- Pricing zone (Standard/Volume)
- Custom hostnames with CNAME instructions
- SSL status badges
- Bandwidth usage (if limits configured)
Client: Managing SSL
Client adds custom hostname via support ticket. Admin adds in WHMCS. Client sees:
- Hostname:
cdn.example.com - CNAME:
xyz.b-cdn.net - SSL Status: Red badge (pending)
After configuring DNS, client clicks "Refresh SSL Status". Badge turns green when active.
If stuck on red: click "Enable SSL" to retry provisioning.
Client: Purging Cache
Client clicks "Purge Cache" button on service page. Confirmation modal appears. Click "Confirm Purge". Cache cleared globally in seconds.
Configurable Options
Add to products for tiered pricing or feature gating.
Option 1: Pricing Zone
Option Name: Pricing Zone (case-sensitive)
Option Type: Dropdown
Values: Standard|Volume
Module reads this during activation. Creates pull zone with specified pricing tier.
Standard vs Volume:
- Standard: US and EU only, $0.01/GB
- Volume: Global coverage, $0.015/GB
Option 2: Bandwidth Limit
Option Name: Bandwidth Limit (case-sensitive)
Option Type: Dropdown
Values: 100GB|500GB|1TB|5TB
Module reads this during activation. Stores limit in database. Cron checks daily.
Example pricing:
- 100GB CDN: β¬5/month
- 500GB CDN: β¬20/month
- 1TB CDN: β¬35/month
- 5TB CDN: β¬150/month
Bandwidth Limiting Details
How it works: Daily cron at 3 AM checks each zone with bandwidth limit. Fetches current month usage from BunnyCDN API. If usage exceeds limit, marks zone as suspended in WHMCS database and creates todo item for admin.
Critical limitation: Zone continues serving traffic in BunnyCDN. API does not support disabling zones. Admin must manually delete zone in BunnyCDN dashboard or contact client to upgrade.
Why this exists: Some providers want automatic flagging of overages, even if technical enforcement is impossible. Creates paper trail and admin notification for billing follow-up.
Configuration checklist:
- Add "Bandwidth Limit" configurable option to product (exact name, case-sensitive)
- Set values in format:
100GB,1TB, etc. - Enable "Enable Bandwidth Limiting" in module settings
- Verify WHMCS cron is running (System Settings β Automation Settings)
Troubleshooting: Check Activity Log for entries like: BunnyCDN Cron: Starting bandwidth usage check If missing, cron isn't running. If present but no suspensions, limits not exceeded or configurable option not found.
Admin workflow on overage:
- Todo item appears: "BunnyCDN overage: cdn.example.com used 523GB of 500GB"
- Admin contacts client: upgrade to 1TB plan or delete zone
- If upgrade: admin edits service, changes configurable option, unsuspends zone in WHMCS
- If delete: admin deletes zone in BunnyCDN dashboard manually
Unsuspending: Simply editing the configurable option to higher limit does NOT unsuspend automatically. Admin must click "Unsuspend" in Services β View/Edit Service after changing option. Suspension flag clears, cron continues monitoring.
DNS & SSL Configuration
The DNS Part
BunnyCDN requires CNAME record pointing custom hostname to pull zone hostname.
Example:
Pull zone hostname: xyz.b-cdn.net
Custom hostname: cdn.example.com
DNS record: cdn.example.com CNAME xyz.b-cdn.net
Client adds this in their DNS provider (Cloudflare, Route53, whatever).
Verification: dig cdn.example.com Should return CNAME pointing to xyz.b-cdn.net.
If returns A record or nothing, DNS not configured correctly.
The SSL Part
BunnyCDN validates DNS via ACME challenge before issuing certificate.
Process timeline:
- DNS configured: 0 minutes
- ACME challenge propagation: 5-15 minutes
- Certificate issuance: 5-10 minutes
- Total: 10-25 minutes typically
Can take up to 60 minutes if DNS propagation is slow.
Status checking: Client clicks "Refresh SSL Status" in WHMCS. Module queries BunnyCDN API. API returns certificate status. Badge updates accordingly.
Manual intervention: If stuck on red badge after 60 minutes:
- Verify DNS with
dig - Click "Enable SSL" to retry
- Check BunnyCDN dashboard for errors
Common issue: CNAME has Cloudflare proxy enabled (orange cloud). Disable proxy for ACME validation, re-enable after certificate is active.
Technical Specifications
Requirements:
- WHMCS 8.9 or higher
- PHP 7.4+ with curl extension
- MySQL 5.7+
- BunnyCDN account
- Valid license key from ArkHost
Languages included:
- English
- Dutch
- French
- German
- Italian
- Russian
- Spanish
Security:
- API key stored encrypted in WHMCS database
- Client access validated against service ownership
- CSRF protection on all forms
- SQL injection prevention via Capsule ORM
- File access checks (WHMCS constant validation)
Performance:
- API calls cached where possible
- Bandwidth checks run once daily (configurable)
- Statistics fetched on-demand
- No impact on regular WHMCS operations
- Database indexes on foreign keys
File structure:
modules/
βββ addons/bunnycdn/
β βββ bunnycdn.php # Core addon module
β βββ hooks.php # WHMCS hooks
β βββ ajax.php # Client AJAX handler
β βββ lib/BunnyCDNAPI.php # API wrapper class
β βββ templates/admin.php # Admin interface
β βββ templates/client.tpl # Client page template
β βββ lang/english.php # Language strings
βββ servers/bunnycdn/
βββ bunnycdn.php # Provisioning module (Option 1)
βββ templates/clientarea.tpl
Troubleshooting
API Connection Failed
Symptoms: "API connection failed" error in module settings.
Causes:
- Invalid API key
- Firewall blocking outbound HTTPS
- BunnyCDN API temporarily down
Fix:
- Copy API key from BunnyCDN dashboard
- Paste in WHMCS (no spaces, no line breaks)
- Test connection
- If still fails, test manually:
curl -H "AccessKey: YOUR_KEY" https://api.bunny.net/pullzone - Should return JSON array of pull zones
- If curl works but WHMCS doesn't, check PHP curl extension:
php -m | grep curl
Pull Zones Not Auto-Creating
Symptoms: Client activates service, no pull zone created.
Causes:
- Wrong deployment option configuration
- "Auto Create Pull Zones" disabled
- API connection broken
- Product not using bunnycdn server module (for Option 1)
Fix:
- Option 1: Verify product uses
bunnycdnserver module - Option 1: Enable "Auto Create Pull Zones" in settings
- Option 2/3: Disable "Auto Create Pull Zones" (only for Option 1)
- Check Activity Log for errors
- Verify API connection in module settings
Activation Form Not Appearing
Symptoms: Client sees service page, no CDN activation form.
Causes:
- Product not selected in CDN-Enabled Products (Option 3)
- Addon not attached to service (Option 2)
- Template cache not cleared
- Hooks not loading
Fix:
- Option 3: Add product to CDN-Enabled Products in module settings
- Option 2: Verify addon purchased and active on service
- Clear cache: Utilities β System β Clear Cache
- Check hooks.php exists and is readable
- View page source, search for "bunnycdn" to verify injection
SSL Certificate Not Activating
Symptoms: Red SSL badge persists for hours after DNS configuration.
Causes:
- DNS not propagated yet
- CNAME configured incorrectly
- DNS record proxied through Cloudflare
- BunnyCDN ACME validation failed
Fix:
- Verify DNS:
dig cdn.example.com - Should show CNAME to
xyz.b-cdn.net - If proxied through Cloudflare (orange cloud icon), disable proxy temporarily
- Wait 15-30 minutes for propagation
- Click "Enable SSL" in WHMCS
- Click "Refresh SSL Status" after 10 minutes
- If still red, check BunnyCDN dashboard for validation errors
- Re-enable Cloudflare proxy after certificate is active
Bandwidth Limiting Not Working
Symptoms: Client exceeds limit, no suspension occurs.
Causes:
- Cron not running
- Configurable option name wrong (case-sensitive)
- Limit value format invalid
- Bandwidth limiting disabled in settings
Fix:
- Check WHMCS cron status: System Settings β Automation Settings
- Verify Activity Log shows:
BunnyCDN Cron: Starting bandwidth usage check - Check configurable option: must be named "Bandwidth Limit" exactly
- Check value format:
100GB,1TB, etc. (text values like "Unlimited" won't work) - Verify "Enable Bandwidth Limiting" checked in module settings
- Test: manually set limit to 1GB, wait for next cron run
Zone Still Serving Traffic After Suspension
This is expected behavior.
BunnyCDN API does not support disabling pull zones. Module only marks zone as "suspended" in WHMCS database for admin notification.
Zone continues serving traffic in BunnyCDN. You continue paying for bandwidth.
Admin action required:
- Check todo items for overage notifications
- Contact client to upgrade or delete service
- If delete: manually delete zone in BunnyCDN dashboard
Import Shows No Zones
Symptoms: "No zones found in your BunnyCDN account" despite having zones in dashboard.
Causes:
- API key from wrong account
- Using Storage API Key instead of Account API Key
- Account has no pull zones (only storage zones)
Fix:
- Verify API key type: must be "Account API Key" from dash.bunny.net/account/api-key
- Storage API Keys don't work (different endpoint)
- Test with curl:
curl -H "AccessKey: YOUR_KEY" https://api.bunny.net/pullzone - Should return JSON array with your pull zones
Client Can't Purge Cache
Symptoms: "Purge Cache" button doesn't work or shows error.
Causes:
- API key lacks permissions
- BunnyCDN API rate limiting
- Network timeout
Fix:
- Verify API key has pull zone management permissions
- Check Activity Log for error details
- Try purging from admin interface
- If works in admin but not client, check AJAX handler permissions
- Check browser console for JavaScript errors
Comparison: Manual vs Automated
Manual CDN Management:
Client orders β Admin opens ticket
β
Login to BunnyCDN dashboard
β
Create pull zone manually
β
Copy hostname
β
Email CNAME to client
β
Wait for client to configure DNS
β
Check DNS propagation manually
β
Enable SSL in BunnyCDN dashboard
β
Wait for certificate
β
Check SSL status manually
β
Email confirmation to client
β
Track bandwidth in spreadsheet
β
Check spreadsheet weekly for overages
β
Manual suspension and client contact
Time: 30-45 minutes per client
Error rate: High (typos, forgotten steps)
Support tickets: 3-5 per client
With BunnyCDN Module:
Client orders β WHMCS activates
β
Module creates pull zone (API)
β
Module configures hostname (API)
β
Client sees CNAME instructions
β
Client configures DNS
β
Module enables SSL (API)
β
Certificate auto-provisions
β
Client refreshes SSL status
β
Cron tracks bandwidth daily
β
Auto-suspension on overage
β
Admin todo item created
Time: 0 minutes admin involvement (Options 2/3)
Error rate: Near zero (API-driven)
Support tickets: 0-1 per client (DNS help only)
Why This Exists
ArkHost offers CDN services to hosting clients. BunnyCDN pricing is good, performance is solid, but WHMCS integration didn't exist.
Manual provisioning was killing productivity. Every CDN activation meant logging into BunnyCDN, creating zones, emailing instructions, tracking bandwidth in spreadsheets.
Options were:
- Stop offering CDN (lose revenue)
- Keep doing it manually (unsustainable)
- Build automation (solve it properly)
Built the module. Deployed at ArkHost. Provisioned 40+ zones in first month with zero admin time.
Made it available to other hosting providers dealing with same problem.
License
One license per WHMCS installation.
Validation: License validates against domain name, IP address, installation directory. Checks license server on module activation and daily thereafter.
Invalid license behavior: Module disables automatic provisioning, shows warning in admin interface. Manual functions still work (view zones, purge cache, etc.).
Purchase: BunnyCDN for WHMCS
Support: Submit ticket at arkhost.com
Changelog
v1.0 (2025-11-12)
- Initial release
- Pull zone creation and management
- Custom hostname support with automatic SSL
- Three deployment modes (product/addon/integrated)
- Admin interface with zone import/mapping
- Client self-service activation
- Product-based CDN configuration
- Bandwidth limiting with auto-suspend
- Configurable options support (Pricing Zone, Bandwidth Limit)
- Daily cron job for usage tracking
- Statistics and cache purge
- Full internationalization support