Kaltura CE V3.0 - Amazon Cloudfront Guide

This guide is applicable for Kaltura CE version 3.0.x installations

The Kaltura Community Edition is a free, open-source, self-hosted video platform. It is developed through the combined efforts of Kaltura and the community and is available under the GNU Affero General Public License v3

This guide helps you understand how to add a CDN to your Kaltura CE or on-prem systems using Amazon Cloudfront's custom origin capability.

Cloudfront with custom origins

Cloudfront is Amazon's content delivery network (CDN) technology. Until recently, Amazon only offered the ability to use Cloudfront when your distributions resided in an Amazon S3 storage bucket. However, Amazon has now added the ability to use Cloudfront using a custom origin. This makes it easy to add a CDN to your Kaltura CE or on-prem system.

Note: Cloudfront does not yet support streaming distributions when using a custom origin. Only HTTP download-type distributions are currently offered by Amazon.

Creating a Custom Origin Distribution

Amazon has not yet added the ability to create custom origin distributions using their AWS Management Console, so you must create your distribution using a 3rd party tool or by using the Amazon API directly. However, once you've created your distribution, you can manage it using the AWS Management Console.

A list of 3rd party tools that support creating Cloudfront distributions using custom origins are in this blog post.

In this example, we use the free Cloudbuddy application (Windows-only) to create a Cloudfront custom origin distribution. You can download the Cloudbuddy personal edition here.

After downloading and installing Cloudbuddy, follow these steps to create a custom origin distribution for your Kaltura CE or on-prem system:

  • Launch Cloudbuddy
  • Add your Amazon developer credentials to Cloudbuddy
  • Click on the "Cloudfront" button
  • The Cloudfront Console will pop up and you can then click on the "Switch to non-S3 origin" link
  • Click on the blue plus symbol next to the DNSname to add the custom origin. Enter the domain name of your Kaltura CE or on-prem installation and select "http-only" for the Protocol Policy.
  • Click on the "Enable Distribution" checkbox
  • The Cloudfront domain name will now appear in the "Distribution" box. Select and copy the cloudfront domain name to your clipboard. Your Cloudfront domain name will look something like this: d3pyg0vu80tr46.cloudfront.net
  • Click on the Save button.

Cloudbuddy Cloudfront config using custom origin

You can now navigate to the AWS Management Console where your Cloudfront distribution should appear under the Cloudfront tab.

Image

Starting the Cloudfront Distribution on Your Kaltura System

Once you've created the Cloudfront distribution, it's easy to add it to your Kaltura system.

Go to the admin console and navigate to the Publishers tab and select Publisher Management. Next to the publisher(s) who will be using Cloudfront, go to the "Select Action" drop-down menu on the far right and select "Configure".

The "Publisher Specific Configuration" dialog box will appear.

Enter the Cloudfront distribution domain name that you copied to the clipboard in the last step in the "Publisher Specific CDN Host" box. Make sure you prefix it with "http://". Click on the Save button.

Image

It will take some time for your media assets to migrate to Cloudfront. On the AWS Management Console, it wil show a state of "InProgress" while your assets are being distributed. Soon, you'll see cloudfront URLs in the embed codes.
EXAMPLE: <a rel="media:thumbnail" href="http://d3rsg0vu80tr46.cloudfront.net/p/100/sp/10000/thumbnail/entry_id/0_yzz42tom/width/120/height/90/bgcolor/000000/type/2" />

Setting Cloudfront Distribution as the default Kaltura CDN

Here's how to make your Kaltura Server use the CloudFront CDN as the default CDN for all publishers.

  1. Edit the kConf.php file -- [path to your kaltura installation]/app/alpha/config/kConf.php
  2. Change the value of: "cdn_host" => "@CDN_HOST@" to your Cloudfront distribution domain name (prefixed with http://).
    EXAMPLE: "cdn_host" => "http://d3pyg0vu80tr46.cloudfront.net"

You're all done.

Comments

Is it possible to have

Is it possible to have transcoded video files uploaded to S3 automatically and then served from S3 through Cloudfront? In other words, offload both storage and bandwidth to S3 and Cloudfront, respectively?

You can use s3fs to mount an

You can use s3fs to mount an s3 partion on you kaltura server. Then you have to copy your entry/data/4/267 file over and use CDN to stream back down.

Ok, so using this CDN...what

Ok, so using this CDN...what are the benefits suppose to be? Where are the files stored, or are they cached in cloudfront? Otherwise it just seems like cloudfront is being fed from the server. So I have to pay for bandwidth to cloudfront and to my ISP. I did a test and my server's bandwidth is still being pegged for each download.

Can someone explain how this setup will help with server cpu/bandwidth load?

Thanks,

Dan

Ok, I can see that it is

Ok, I can see that it is caching the data now somewhere?? in CloudFront, like a proxy server would.

So I have moved all my file hosting and CDN distribution to Amazon s3 and Cloudfront.

S3.....
I connect to s3 using a mounted s3fs file system that is mounted at ../content/entry/data/... So when a video is converted it get's stored in my s3 bucket.

Cloudfront.....
Using this article I setup a Cloudfront CDN for my domain. Cloudfront is not connected directly to my bucket, but rather it requests content through my Kaltura CE server and then caches and distributes. If I could set it up to dip straight from the bucket I would but there is no documentation on that as far as how to organize content in your bucket so that Kaltura CE can use it.

Anyways, for the time being this setup solves two big problems....file storage capacity...bandwidth to distribute content.

Connecting SSH

Ive followed the instructions perfectly. Used CLoudBuddy to connect the AMI's DNS to a Cloudfront instance. Then I Get to: The "Publisher Specific Configuration" dialog box will appear. Picture Attached...
Is that in my KMC account? If so the only one that it could be is not selectable and slightly 'yellow', indicating I don't have access? Ive written for access 3 times... is that not where this "Publisher Specific Configuration" dialog where I enter the CDN host is located?
PLEASE someone shed some light... because this is getting old....
Also; if I can find this admin CDN DNS field.. will my ability to SSH work? Pictura Attached...

Charles R Douthat

AttachmentSize
save.gif21.44 KB
SSH 2.png97.52 KB

Kaltura 4.0

I got CloudFront to work with Kaltura 4.0 hosted on AWS single instance and Media files on EBS storage (default)

Modification to the procedure:
- Used AWS Management Console instead CloudBuddy
- unchecked "Delete exported storage from Kaltura"
- for "Delivery Policy" selected "Kaltura Storage Only"
- instead of editing kConf.php I edited kConfLocal.php

Also once the configured I had to replace the URLs in a player from mydomain.com to XXXXXXX.cloudfront.net

Lukasz Szajkowski
www.logicallysoftware.co.uk