🐰 BunnyCDN для WHMCS - Автоматическая настройка, отслеживание использования, биллинг трафика. Полная интеграция CDN.
📋 Кредит-ноты для WHMCS - Профессиональная обработка кредит-нот для соблюдения НДС ЕС.
⚙️ PowerDNS Manager v1.12 - DNSSEC проверки по запросу, мгновенная загрузка зон, кеширование в браузере.
🤖 AI Support Assistant 2.2 - Claude Sonnet 4.5 и Haiku 4.5, контекст приватных заметок, AI инструменты в редакторе новых тикетов.
🔐 MFA Reminder v1.3 - Поддержка нескольких пользователей, индивидуальная проверка MFA для суб-пользователей.

BunnyCDN for WHMCS Печать

  • 0

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:

  1. Standalone product (dedicated CDN service)
  2. Paid addon (upsell to hosting plans)
  3. 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 status
  • mod_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 pages
  • AfterModuleCreate: logs provisioning
  • AdminAreaClientSummaryActionLinks: quick admin access
  • AdminHomeWidgets: statistics dashboard
  • ClientAreaSecondarySidebar: 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:

  1. Admin adds custom hostname: cdn.example.com
  2. Module returns CNAME: cdn.example.com CNAME xyz.b-cdn.net
  3. Client configures DNS
  4. Module requests SSL via API
  5. BunnyCDN validates DNS, issues certificate
  6. 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

  1. Purchase license from arkhost.com/store/whmcs-modules/bunnycdn
  2. Upload modules folder to WHMCS root (merge with existing)
  3. Go to Setup → Addon Modules
  4. Find "BunnyCDN" and click Activate
  5. Click Configure
  6. Enter license key from ArkHost purchase
  7. Click "Settings" tab
  8. Paste BunnyCDN API key from dash.bunny.net/account/api-key
  9. Configure defaults (or leave as-is)
  10. Save

Module is now active. Configure deployment option next.

Configuration

API Setup

Get BunnyCDN API key:

  1. Login to BunnyCDN dashboard
  2. Navigate to Account → API
  3. Copy Account API Key (not Storage API Key)
  4. 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

  1. Addons → BunnyCDN
  2. Click "Create Pull Zone"
  3. Select client from dropdown
  4. Enter origin URL (e.g., https://example.com)
  5. Choose pricing zone
  6. Click Create

Zone appears in list immediately. BunnyCDN generates hostname like xyz.b-cdn.net.

Admin: Adding Custom Hostname

  1. Find pull zone in admin list
  2. Click globe icon
  3. Enter hostname: cdn.example.com
  4. Click Add
  5. 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:

  1. Addons → BunnyCDN → Import Zones
  2. Module fetches all zones from your BunnyCDN account
  3. Select client for each zone
  4. Optionally select WHMCS service
  5. 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

  1. Click trash icon on pull zone
  2. Confirm purge
  3. 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:

  1. Enter origin URL: https://example.com
  2. Click "Activate CDN"
  3. Module creates pull zone instantly
  4. 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:

  1. Add "Bandwidth Limit" configurable option to product (exact name, case-sensitive)
  2. Set values in format: 100GB, 1TB, etc.
  3. Enable "Enable Bandwidth Limiting" in module settings
  4. 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:

  1. Todo item appears: "BunnyCDN overage: cdn.example.com used 523GB of 500GB"
  2. Admin contacts client: upgrade to 1TB plan or delete zone
  3. If upgrade: admin edits service, changes configurable option, unsuspends zone in WHMCS
  4. 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:

  1. Verify DNS with dig
  2. Click "Enable SSL" to retry
  3. 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:

  1. Copy API key from BunnyCDN dashboard
  2. Paste in WHMCS (no spaces, no line breaks)
  3. Test connection
  4. If still fails, test manually: curl -H "AccessKey: YOUR_KEY" https://api.bunny.net/pullzone
  5. Should return JSON array of pull zones
  6. 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 bunnycdn server 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:

  1. Verify DNS: dig cdn.example.com
  2. Should show CNAME to xyz.b-cdn.net
  3. If proxied through Cloudflare (orange cloud icon), disable proxy temporarily
  4. Wait 15-30 minutes for propagation
  5. Click "Enable SSL" in WHMCS
  6. Click "Refresh SSL Status" after 10 minutes
  7. If still red, check BunnyCDN dashboard for validation errors
  8. 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:

  1. Check WHMCS cron status: System Settings → Automation Settings
  2. Verify Activity Log shows: BunnyCDN Cron: Starting bandwidth usage check
  3. Check configurable option: must be named "Bandwidth Limit" exactly
  4. Check value format: 100GB, 1TB, etc. (text values like "Unlimited" won't work)
  5. Verify "Enable Bandwidth Limiting" checked in module settings
  6. 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:

  1. Check todo items for overage notifications
  2. Contact client to upgrade or delete service
  3. 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:

  1. Verify API key type: must be "Account API Key" from dash.bunny.net/account/api-key
  2. Storage API Keys don't work (different endpoint)
  3. Test with curl: curl -H "AccessKey: YOUR_KEY" https://api.bunny.net/pullzone
  4. 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:

  1. Verify API key has pull zone management permissions
  2. Check Activity Log for error details
  3. Try purging from admin interface
  4. If works in admin but not client, check AJAX handler permissions
  5. 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:

  1. Stop offering CDN (lose revenue)
  2. Keep doing it manually (unsustainable)
  3. 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

Помог ли вам данный ответ?

« Назад

WHOIS Information

×
Loading WHOIS information...