Storage Servers
Overview
The Storage Servers page allows administrators to configure and manage individual storage servers within a storage group. This includes CDN providers (Bunny.net, Vultr, DigitalOcean, Cloudflare R2, KeyCDN, CDN77), FTP servers, and local storage. The page also features integrated CDN provider information cards with setup guides and a heartbeat monitoring system for server health checks.
Key capabilities include:
- Add and configure storage servers (6 CDN providers + FTP + Local)
- View server health status and storage usage
- Configure heartbeat monitoring for FTP/local servers
- Test server connectivity
- Access CDN provider information and signup links
- Quick access to CDN Cost Calculator
System Requirements
PHP Requirements
PHP Extensions Required
mysqli- Database connectivityjson- JSON encoding/decoding for server configscurl- Heartbeat testing (AJAX handler)ftp- FTP server deploymentsession- Session management
PHP Settings
session.autostart = Off
date.timezone = Your/Timezone
allowurlfopen = On
Server Type Reference
Health Status Reference
File Dependencies
ct/admin/adminauth.php- Admin authenticationct/dat/config.inc.php- Configurationct/includes/header.php- Admin headerct/includes/annotateftr.php- Admin footerct/admin/heartbeat.php- Heartbeat script template- Font Awesome 6+ - Icon library
Features & UI Elements
Page Header
[Screenshot: storage-servers-header]
The page header displays:
- Title: "Storage Servers"
- Icon:
fa-server - Breadcrumb: Dashboard / Storage Groups / [Group Name]
- Subtitle: "Choose from our recommended CDN providers for fast, reliable content delivery OR add your own server!"
Alert Messages
[Screenshot: storage-servers-alerts]
Success and error alerts for:
- Server added successfully
- Server updated successfully
- Server deleted successfully
- Heartbeat deployment status
- Connection test results
Action Card
[Screenshot: storage-servers-actions]
Primary action buttons:
Add New Server (green) - Opens configuration modal
- Back to Groups (gray) - Returns to storagegroups.php
CDN Provider Cards
[Screenshot: storage-servers-cdn-cards]
Six compact provider cards with quick info:
Card Elements:
- Provider icon
- Provider name
- Price per GB
- Quick info line
- Tag badges (POPULAR, NEW, ADULT OK, ZERO EGRESS)
Clicking a card opens the provider details modal.
Cost Calculator Button
[Screenshot: storage-servers-calculator-btn]
A prominent button linking to the CDN Cost Calculator:
- Label: "Compare CDN Costs - Interactive Calculator"
- Icon:
fa-calculator - Opens cdncostcalculator.php in new tab
Servers Table
[Screenshot: storage-servers-table]
The main data table showing configured servers:
Storage Display Variations:
Action Buttons:
Provider Details Modal
[Screenshot: storage-servers-provider-modal]
Detailed information modal for each CDN provider:
Sections:
- Overview (pricing, best use cases)
- Key Features (bullet list)
- Quick Setup (numbered steps)
- Pro Tips (info boxes)
- Action Buttons:
- "Sign Up Now" (external link with referral)
- "Configure Server" (opens add modal)
Server Configuration Modal
[Screenshot: storage-servers-config-modal]
The main configuration form with dynamic fields:
Common Fields:
Dynamic Fields by Server Type:
Bunny.net:
- Storage Zone Name
- Storage API Key
- Region (de, ny, la, sg, syd, uk)
Vultr:
- Access Key
- Secret Key
- Bucket Name
- Endpoint/Region
DigitalOcean Spaces:
- Access Key
- Secret Key
- Space Name
- Region (nyc3, ams3, sgp1, sfo3)
Cloudflare R2:
- Account ID
- Access Key ID
- Secret Access Key
- Bucket Name
- Custom Domain (optional)
KeyCDN:
- Zone ID
- Zone URL
- API Key
- Origin URL
CDN77:
- CDN Resource ID
- CDN URL
- API Key
- Origin URL
FTP/SFTP:
- FTP Host
- Port (21 for FTP, 22 for SFTP)
- Username
- Password
- Upload Path
Local:
- Storage Path
Heartbeat Monitoring Section
[Screenshot: storage-servers-heartbeat]
For FTP/Local servers, a heartbeat monitoring configuration:
Fields:
Deployment Info:
- FTP/Local: Auto-deploy available
- CDN providers: Heartbeat not supported
Manual Download:
- "Download heartbeat.php" button
- Pre-configured with secret key
Step-by-Step Usage
Adding a CDN Server (Bunny.net Example)
- Navigate to Admin Panel → Storage → Groups
- Click Servers on your target group
- Click Add New Server button
- Select Server Type: Bunny.net CDN
- Fill in the configuration:
- Server Name: "Bunny CDN - Main"
- Storage Zone Name: Your Bunny zone name
- Storage API Key: From Bunny dashboard
- Region: Select closest region
- Base URL:
https://yourzone.b-cdn.net/ - Max Storage: 1000 (GB)
- Click Save Server
Adding an FTP Server with Heartbeat
- Navigate to Admin Panel → Storage → Groups → [Group] → Servers
- Click Add New Server
- Select Server Type: FTP Server
- Fill in FTP configuration:
- Server Name: "CDN Server 1"
- FTP Host: cdn.example.com
- Port: 21
- Username: yourftpuser
- Password: yourftppassword
- Upload Path: /publichtml/videos/
- Configure Base URL:
- Base URL:
https://cdn.example.com/videos/
- Configure Heartbeat:
- Check Enable Heartbeat Monitoring
- Secret Key: Auto-generated (keep it)
- Path to Monitor: /publichtml/videos/
- Click Save Server
Testing Server Heartbeat
- Find the server in the table
- Click the Test button (green with heartbeat icon)
- Wait for the test to complete
- Review the results:
- Server status
- Health status
- Disk space (total, used, free, percentage)
- Server info (hostname, PHP version, OS)
- Load average (if Linux)
- Warnings (if any)
Editing Server Configuration
- Find the server in the table
- Click Edit button (yellow with pencil icon)
- Modify the desired fields
- Click Save Server
Deleting a Server
- Find the server in the table
- Click Delete button (red with trash icon)
- If server has files:
- A warning shows file count
- Confirm deletion (files remain on storage, only records deleted)
- If no files:
- Confirm deletion
Using CDN Provider Information
- Click on any CDN provider card
- Review the provider details:
- Pricing information
- Key features
- Setup instructions
- Click Sign Up Now to create an account
- Click Configure Server to add to your platform
CDN Provider Setup Guides
Bunny.net Setup
- Create account at bunny.net
- Go to Storage → Add Storage Zone
- Enter zone name (e.g., "my-videos")
- Select region closest to your users
- Click Add Storage Zone
- Go to zone settings → FTP & API Access
- Copy the Storage API Key
- Note your Zone Name and Region
Configuration Values:
Vultr Setup
- Create account at vultr.com
- Go to Products → Object Storage
- Click Add Object Storage
- Select location and label
- After creation, click on the storage
- Create a Bucket
- Go to S3 Credentials tab
- Copy Access Key and Secret Key
Configuration Values:
Cloudflare R2 Setup
- Login to Cloudflare Dashboard
- Go to R2 → Create Bucket
- Enter bucket name
- Go to R2 → Manage R2 API Tokens
- Create token with Admin Read & Write
- Copy Access Key ID and Secret Access Key
- Note your Account ID from dashboard URL
Configuration Values:
Heartbeat Monitoring System
How It Works
- Heartbeat Script: A PHP file deployed to FTP/Local servers
- Secret Key: Authentication to prevent unauthorized access
- Health Check: AJAX call from admin panel to heartbeat URL
- Response: JSON with disk space, load, status
Heartbeat Response Format
{
"status": "ok",
"health": "healthy",
"datetime": "2025-01-02 12:00:00",
"disk": {
"totalgb": 500,
"totaltb": 0.49,
"usedgb": 250,
"usedpercent": 50,
"freegb": 250
},
"server": {
"hostname": "cdn1.example.com",
"phpversion": "8.2.10",
"os": "Linux"
},
"load": {
"1min": 0.5,
"5min": 0.8,
"15min": 0.6
},
"warnings": []
}
Manual Heartbeat Deployment
If auto-deploy fails:
Click Download heartbeat.php buttonUpload file to your server's web-accessible directoryEnsure file is accessible at: https://yourdomain.com/path/heartbeat.php
- Verify with:
https://yourdomain.com/path/heartbeat.php?key=YOURSECRETKEY
Heartbeat Troubleshooting
Best Practices
Server Naming Conventions
Storage Allocation
Health Monitoring Schedule
# Check all server heartbeats every 5 minutes
/5 php /path/to/ct/admin/cron/checkstoragehealth.php
Security Best Practices
- Use unique secret keys for each server
- Store keys securely in database (encrypted recommended)
- Rotate keys periodically (update both sides)
- Use HTTPS for all heartbeat URLs
- Restrict heartbeat access to admin IPs if possible
Troubleshooting
Common Issues
Server Connection Failed
Cause: Incorrect credentials or network issue
Solutions:
- Verify credentials are correct
- Test connection manually (FTP client, S3 browser)
- Check firewall allows outbound connections
- Verify endpoint URL is correct
Heartbeat Returns HTML
Cause: PHP not processing on remote server
Solutions:
- Ensure PHP is installed on remote server
- Check file has .php extension
- Verify web server is configured for PHP
- Check for .htaccess blocking
Files Not Syncing
Cause: Storage server manager not finding server
Solutions:
Verify server status is "enabled"
- Check group has autosyncnewcontent enabled
- Verify baseurl is accessible
- Check storage server logs
Cannot Delete Server with Files
Note: This is expected behavior
Process:
- Warning shows file count
- Confirm deletion to proceed
- File location records deleted
- Physical files remain on storage
- Clean up files manually if needed
Debug Queries
-- Check server configuration
SELECT serverid, servername, servertype, connectionconfig
FROM tblStorageServers
WHERE groupid = {groupid};
-- Check file counts per server
SELECT s.serverid, s.servername, COUNT(f.locationid) as filecount
FROM tblStorageServers s
LEFT JOIN tblStorageFileLocations f ON s.serverid = f.serverid
WHERE s.groupid = {groupid}
GROUP BY s.serverid;
-- Check failed syncs
SELECT FROM tblStorageFileLocations
WHERE syncstatus = 'error'
ORDER BY updatedat DESC
LIMIT 20;
Security Considerations
Credential Storage
- Use encrypted connection (SSL/TLS)
- Limit database user permissions
- Regular backup with encryption
- Consider credential vault for production
API Key Protection
- Never expose API keys in frontend code
- Use environment variables when possible
- Rotate keys if compromised
- Monitor API usage for anomalies
Heartbeat Security
- Secret keys prevent unauthorized health checks
- Use HTTPS to prevent key interception
- Consider IP whitelisting on remote server
- Regular key rotation recommended
Translatable Strings
{
"storageserverstitle": "Storage Servers",
"storageserversbreadcrumb": "Dashboard / Storage Groups / {groupname}",
"storageserverssubtitle": "Choose from our recommended CDN providers for fast, reliable content delivery OR add your own server!",
"storageserversaddbtn": "Add New Server",
"storageserversbackbtn": "Back to Groups",
"storageserverscdntitle": "Available CDN Providers",
"storageserverscdnsubtitle": "Click any provider to see detailed information and setup instructions",
"storageserverscalculatorbtn": "Compare CDN Costs - Interactive Calculator",
"storageserverstabletitle": "Your Configured Servers",
"storageserverstablename": "Server Name",
"storageserverstabletype": "Type",
"storageserverstablestorage": "Storage Usage",
"storageserverstablefiles": "Files",
"storageserverstablehealth": "Health",
"storageserverstablestatus": "Status",
"storageserverstableactions": "Actions",
"storageserversmodaladdtitle": "Configure Storage Server",
"storageserversmodaledittitle": "Edit Storage Server",
"storageserversformname": "Server Name",
"storageserversformtype": "Server Type",
"storageserversformbaseurl": "Base URL (Public Access URL)",
"storageserversformmaxstorage": "Max Storage (GB)",
"storageserversformstatus": "Status",
"storageserversheartbeattitle": "Heartbeat Monitoring",
"storageserversheartbeatenable": "Enable Heartbeat Monitoring",
"storageserversheartbeatkey": "Heartbeat Secret Key",
"storageserversheartbeatpath": "Path to Monitor",
"storageserversheartbeatregenerate": "Regenerate",
"storageserversheartbeatdownload": "Download heartbeat.php",
"storageserversheartbeatdeployftp": "Auto-Deploy Available",
"storageserversheartbeatdeploycdn": "Heartbeat not available for CDN providers",
"storageserversbtnsave": "Save Server",
"storageserversbtncancel": "Cancel",
"storageserversbtnedit": "Edit",
"storageserversbtntest": "Test",
"storageserversbtndelete": "Delete",
"storageserversstatusenabled": "Enabled",
"storageserversstatusdisabled": "Disabled",
"storageservershealthhealthy": "Healthy",
"storageservershealthwarning": "Warning",
"storageservershealthcritical": "Critical",
"storageservershealthunknown": "Unknown",
"storageservershealthnotmonitored": "Not Monitored",
"storageserverssuccessadded": "Server added successfully!",
"storageserverssuccessupdated": "Server updated successfully!",
"storageserverssuccessdeleted": "Server deleted successfully!",
"storageserverssuccessheartbeat": "Heartbeat deployed successfully!",
"storageserverserrorheartbeat": "Heartbeat deployment failed",
"storageserversconfirmdelete": "Are you sure you want to delete this server?",
"storageserversconfirmdeletefiles": "This server has {count} files. Deleting will remove file records but physical files remain. Continue?",
"storageserversprovideroverview": "Overview",
"storageserversproviderfeatures": "Key Features",
"storageserversprovidersetup": "Quick Setup",
"storageserversprovidersignup": "Sign Up Now",
"storageserversproviderconfigure": "Configure Server"
}
Related Documentation
- Storage Server Groups - Group management
- CDN Cost Calculator - CDN pricing comparison
- Video Processing - Video processor CDN integration