CDN Host Mode
Overview
You can use a CDN (Content Delivery Network) with WP Squared. After you enabled the CDN host mode, your server will synchronize new and updated DNS records to the CDN’s service. When you create a domain in the WHM or WP2 interface, your server with automatically create the DNS records on the CDN nameservers.
- Currently, WP Squared only supports Cloudflare®.
What is a CDN?
A Content Delivery Network (CDN) uses servers in various locations to provide online content from the closest server to the website consumer, making websites load faster. A properly configured CDN may also help protect websites against some common malicious attacks, such as Distributed Denial of Service (DDOS) attacks.
Enable CDN host mode
To enabled CDN host mode, you can use WHM’s API cdn_defaultconfig_set
function. This function configures your server’s CDN settings.
Use your email address and API key
You will need the following information before you run the API:
Item | Description | Example |
---|---|---|
Email address | The email address you use to authenticate with the CDN service. You would use your email address with your API key. | username@example.com |
API key | The API key you use to authenticate with the CDN service. You would use your email address with your API key. | Click to view…23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H |
To run the API, you can use WHM’s Terminal interface. In the following example, replace the values for api_key
and email
with the credentials you obtained from your CDN:
1whmapi1 cdn_defaultconfig_set api_key="23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H" email="username@example.com" token="23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H"
Use an API token
You will need the following information before you run the API:
Item | Description | Example |
---|---|---|
API token | The API token you use to authenticate with the CDN service. The API requires no additional parameters. | Click to view…23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H |
To run the API, you can use WHM’s Terminal interface. In the following example, replace the value for token
with the credentials you obtained from your CDN:
1whmapi1 cdn_defaultconfig_set token="23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H"
Disable CDN host mode
To disable CDN host mode, run the WHM API cdn_defaultconfig_disable
function in WHM’s Terminal interface. This function will disable the WP Squared’s CDN configuration settings.
1whmapi1 cdn_defaultconfig_disable
This function does not have any parameters and only returns success or failure metadata.