Server requirements

Minimum server requirements

  • PHP 5.2 or above
  • Mysql 5.0 or above
  • FFmpeg 0.8 with libfaac, libx264, libavfilter
  • Yamdi
  • Qt-faststart
  • ImageMagick
  • Curl and its support in PHP
  • Apache + mod_rewrite
  • ionCube loader
  • Perl & CGI 3.15 or above (not required if you use Nginx)

Minimum PHP requirements

  • Zlib library
  • XML extension
  • GD2 with true type font (required!)
  • Ability to exec PHP from CLI using exec() command
  • PHP magic_quotes_gpc off
  • PHP safe_mode off
  • PHP file_uploads on
  • PHP allow_url_fopen on

Recommended configuration (very desired)

  • Memcache and its support in PHP
  • Nginx + Apache (via reverse proxy) + NginxHttpUploadProgressModule

Nginx usage

We recommend using Nginx as a reverse proxy over Apache. First, Nginx performs much better than Apache. Second, you will not be able to configure pseudo-streaming using Apache. And finally, KVS is integrated with Nginx to protect your content from hotlinking and auto-grabbing.

Please pay attention to the demo Nginx config!

In order to be able to upload videos from a local disk you need to install NginxHttpUploadProgressModule and configure it correctly in the Nginx config. You should specify all three directives similar to how they are specified in the demo config:

  • upload_progress proxied 1m
  • track_uploads proxied 30s
  • report_uploads proxied (under the same location as in example)

In order to protect your video content from hotlinking, you need to define the video folder as an Nginx internal resource (see location ^~ /contents/videos/ in the example).

Also, in order to protect the source files for videos and albums, you should define their folders as Nginx internal resources (see location ^~ /contents/videos_sources/ and location ^~ /contents/albums/sources/ in the example).

The client_max_body_size value should be specified according to your requirements depending on the maximum amount of video files you will upload from the local disk or expect your users to upload.

If you are going to allow embed codes for your videos, you should make sure that Nginx does not intercept requests to swf files.

MP4 files pseudo-streaming

Nginx does not support pseudo-streaming of MP4 files by default. In order to enable that, you should make nginx_mod_h264_streaming-2.3.2 module. After that you should use "mp4" directive for video storage folder in Nginx config (see location ^~ /contents/videos/ in the example, in addition to "flv" directive you should add "mp4" directive).

Recommended PHP options

PHP upload_max_filesize 1024M (the maximum allowed size for uploaded files)
PHP post_max_size 1024M (the maximum allowed size for uploaded files)
PHP memory_limit 512M
PHP session.gc_maxlifetime 21600

Requirements for multiserver scenario

All the requirements above are related to the simplest configuration, which only utilizes 1 single physical server. KVS supports separate physical servers for content storage or CPU-hungry conversion operations. If you are going to use separate servers, they will have different requirements:

Requirements Main server Content server Conversion server
PHP Required Required Required
MySQL Required No No
Apache Required Required No
FFmpeg Required No Required
ImageMagick Required No Recommended
Memcache Recommended No No
Nginx Recommended Required No
Yamdi No No Required
Qt-faststart No No Recommended
(for MP4 files)