Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The CDN server code can be found in the folder /PF.Site/Apps/PHPfox_CDN/server/

This folder can should be moved to any server you wish as long as it has public HTTP access. The first thing we need to do is rename the file phpfox-cdn-setting.php.new to phpfox-cdn-setting.php.

...

Code Block
<?php

define('CDN_FOLDER', './file/');
define('CDN_KEY', '');

The first constant, CDN CDN_FOLDER is FOLDER is the path to place store the user uploaded files. You can change this and if . If you do, make sure to create a folder for that location. In this example, you've upload two files into path: "/yoursitepath"; then CDN_FOLDER will be "/yoursitepath/file/"

The next constant is CDN_KEY. This is a unique key you create and will be used when you assign this server to the App in your phpFox AdminCP. Remember this key for next step.

AdminCP Settings

Now that we have our CDN server ready. Log into your AdminCP and head on over to Apps >> phpFox CDN

...

The final setting is Secret Key. This is the same value as the CDN_KEY you created earlier. Hit Submit and you will have added your first CDN server.

For example

You'd like to setup CDN into Sub Folder at : yoursite.com/CDN.

  1. Create a folder at /yoursitepath/CDN/ ; ex. /home/yoursite.com/CDN/
  2. Upload these two files into /yoursitepath/CDN/ --> CDN_FOLDER is /yoursitepath/CDN
  3. Open CDN Application/Servers Setting 
    1. Upload URL will be: http://yoursite.com/CDN
    2. View URL will be: http://yoursite.com/CDN/file/  
    3. Change Secret Key to match with CDN_KEY define in phpfox-cdn-setting.php file

Enable CDN

Now that we have updated the CDN server and assigned it to the App we need to enable the CDN feature. On the same page where you manage your CDN servers you will find a link Settings. Click on that and then click Yes to enable the service.

...