Ubuntu 16.04 VOD & PVR installation using Ministra 5.5.0 & 5.6 Files.
[/CENTER]
PHP:
[CENTER]
Infomir-Storage Server Installation on Ubuntu Server LTS 16.04[/CENTER]
[LIST]
[*]Install Ubuntu server 16.04
[*]Upgrade Packages
[/LIST]
[CENTER]sudo apt-get update
sudo apt-get upgrade[/CENTER]
[LIST]
[*]Install Required Packages
[/LIST]
[CENTER]sudo apt-get install -y -u apache2 php php-soap python2.7 libapache2-mod-php [/CENTER]
[LIST]
[*]Unzip the folder Ministra.zip and copy the directory /stalker_portal/storage in /var/www/.
[*]It will be like /var/www/stalker_portal/storage and files will be in storage folder.
[*]Go to /var/www/stalker_portal/storage/ and run the following command
[/LIST]
[CENTER]chmod a+x install.sh
./install.sh
[/CENTER]
Edit file /var/www/stalker_portal/storage/config.php
[LIST=1]
[*]define ('VIDEO_STORAGE_DIR', '/media/raid0/storage/');
[*]define ('KARAOKE_STORAGE_DIR', '/media/raid0/karaoke/');
[*]define ('RECORDS_DIR', '/media/raid0/records/');
[*]define ('NFS_HOME_PATH', '/media/raid0/mac/');
[*]// Use login and password from the configuration file. (api_auth_login and api_auth_password in server/custom.ini)
[*]define ('API_URL', 'http://login:[email protected]/stalker_portal/api/');
[*]define ('PORTAL_URL', 'http://192.168.1.71/stalker_portal/');
[*]define ('STORAGE_NAME', 'bb3');
[*]define ('ASTRA_RECORDER', false);
[*]define ('DUMPSTREAM_BUFFERING', 1); // set -1 for system default
[/LIST]
where is:
VIDEO_STORAGE_DIR- directory for files of “Videoclub” storing;
KARAOKE_STORAGE_DIR- directory for files of “Karaoke” storing;
RECORDS_DIR- directory for files PVR and “TV Archive” storing; "TV archive" settings;
NFS_HOME_PATH- STB's home directory;
API_URL- URL, which will be used for channel recording request from middleware. Watch "TV archive" settings:
PORTAL_URL- portal address. At this address will be sent to requests from “storage” to check the keys to access the archive;
STORAGE_NAME- storage name.
[LIST]
[*]If you change username and password for API authentication in custom.ini then you also must change it in API URL.
[*]'http://username:[email protected]/stalker_portal/api/');
[*]Where username is api_auth_login
[*]Where Password is api_auth_password
[*]Where x.x.x.x is IP Address of the middleware
[/LIST]
[LIST]
[*]Create following directories and give all directories the permissions 0777
[*]/media/raid0/storage/
[*]/media/raid0/karaoke/
[*]/media/raid0/records/
[*]/media/raid0/mac/
[/LIST]
[CENTER]mkdir -p -m 0777 /media/raid0/storage /media/raid0/karaoke /media/raid0/records /media/raid0/mac[/CENTER]
[LIST]
[*]Create Directory /var/www/media/
[/LIST]
[CENTER]mkdir /var/www/media[/CENTER]
[LIST]
[*]Create symlink to the STB’s home directories in /var/www/media/
[/LIST]
[CENTER]ln -s /media/raid0/mac/ /var/www/media/<storage name>
Let Suppose storage name is “bb3”
So
ln -s /media/raid0/mac/ /var/www/media/bb3[/CENTER]
For Subtitles: ln -s /media/raid0/subtitles /var/www/subs
[LIST]
[*]In Portal Admin interface go to Storage and add
[*]Name - <Storage name>. For Example: bb3
[*]IP - Ip Address of the storage server
[*]Home Directory - <STB’s home directory>. For example: /media/raid/mac/
[*]Configure Apache Port in /etc/apache2/ports.conf
[/LIST]
[CENTER]Listen 88[/CENTER]
[LIST]
[*]In /etc/apache2/sites-enabled/default.conf change <VirtualHost *:80> to <VirtualHost *:88>
[*]If there will be Tv Archive then it is necessary to add directive VirtualHost inside the block TimeOut 1800 and remove html/
[/LIST]
File will be like:
<VirtualHost *:88>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
TimeOut 1800
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
[LIST]
[*]Make sure that the package libapache2-mod-php5filter is not installed on the system. If necessary, remove it.
[*]apt-get purge libapache2-mod-phpfilter
[/LIST]
Install Nginx with extra packages
[CENTER]apt-get install nginx nginx-extras
[/CENTER]
Configure nginx in /etc/nginx/sites-available/default
geo $local_client {
default 0;
127.0.0.1/32 1;
X.X.X.X/32 1; Middle ware IP
}
map $local_client $client_allowed {
0 $secure_link;
1 1;
}
server {
listen 10.1.1.4:80;
server_name _;
location / {
proxy_pass http://10.1.1.4:88/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /tslink/ {
rewrite ^/tslink/(.+)/archive/(\d+)/(.+) /stalker_portal/server/api/chk_tmp_timeshift_link.php?key=$1&file=$3 break;
proxy_set_header Host 10.1.1.3; # <-- portal IP
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.1.1.3:88/; # <-- portal IP
}
location /archive/ {
root /var/www;
internal;
}
location ~* ^(?!(\/tslink|\/archive))\/.*\.(mpg|mpeg|avi|ts|mkv|mp4|mov|m2ts|flv|m4v)$ {
secure_link $arg_st,$arg_e;
secure_link_md5 "supersecret$uri$remote_addr$arg_e";
if ($client_allowed = "") {
return 403;
}
if ($client_allowed = "0") {
return 410;
}
send_timeout 6h;
root /var/www/;
}
location ~* \.(srt|sub|ass)$ {
send_timeout 6h;
root /var/www/subs/;
}
}
As subtitles does not support nginx secure link token so add lines in /etc/nginx/sites-available/default and remove (srt|sub|ass) from secure link location
geo $local_client {
default 0;
127.0.0.1/32 1;
10.1.1.3/32 1;
}
map $local_client $client_allowed {
0 $secure_link;
1 1;
}
server {
listen 10.1.1.4:80;
server_name _;
location / {
proxy_pass http://10.1.1.4:88/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /tslink/ {
rewrite ^/tslink/(.+)/archive/(\d+)/(.+) /stalker_portal/server/api/chk_tmp_timeshift_link.php?key=$1&file=$3 break;
proxy_set_header Host 10.1.1.3; # <-- portal IP
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://10.1.1.3:88/; # <-- portal IP
}
location /archive/ {
root /var/www;
internal;
}
location ~* ^(?!(\/tslink|\/archive))\/.*\.(mpg|mpeg|avi|ts|mkv|mp4|mov|m2ts|flv|m4v)$ {
secure_link $arg_st,$arg_e;
secure_link_md5 "supersecret$uri$remote_addr$arg_e";
if ($client_allowed = "") {
return 403;
}
if ($client_allowed = "0") {
return 410;
}
send_timeout 6h;
root /var/www/;
}
location ~* \.(srt|sub|ass)$ {
send_timeout 6h;
root /var/www/subs/;
}
}
Restart Nginx
Add Storage in admin panel Go to
Storage à Add storage à General Information tab
Mention Title
IP address of the storage server
Port of apache server
Home Directory /media/raid0/mac/
Maximum User
Add content in /var/www/media/bb3/
Configure inside the portal in Video club
[CENTER]TV Archive Settings
[/CENTER]
Checking of the availability of multicast streams can be performed with help of dumprtp utility. which is included in dvbstream packet.
[CENTER]apt-get install dvbstream
[/CENTER]
To check the streams are accessible to your system for recoding
[CENTER]dumprtp IP Port > dump(name).ts
dumprtp 239.1.1.1 1234 > dump239.1.1.1.ts
[/CENTER]
Install memcached
[CENTER]apt-get install memcached
[/CENTER]
In admin panel go to
Storage à edit current storage if using same VOD storage à Additional Information
select on the option storing content
Allow Tv Recording à Stalker DVR (Select Stalker DVR if using Stalker, Wowza DVR if Wowza, Flussonic DVR if Flussonic & Nimble DVR if Nimble)
Note: - Incase of using separate storage for PVR, add storage and fill in general information and additional information
At the storage /var/www/stalker_portal/storage/config.php necessary to setup (In case of Separate Storage, if using same VOD server, use those information)
RECORDS_DIR (directory with permission 0777, it will be created archive directory, which will contain all files of recording)
API_URL (which will record the channels from middleware. Usually it is http://IPAddressofMiddleware/api/tv_archive/)
PORTAL_URL (portal address. At this address will be sent to requests from “storage” to check the keys to access the archive)
STORAGE_NAME (storage name, which indicated in Admin interface)
Make Directory
[CENTER]mkdir -p -m 0777 /media/raid0/records/archive
[/CENTER]
Create symlink of folder with archive in web server directory
[CENTER]ln -s /media/raid0/records/archive/ /var/www/
[/CENTER]
While editing TV channel in Admin interface you can choose “Enable TV archive” option.
Ensure that the Apache configuration file have directive “TimeOut 1800”
[CENTER]
For Subtitles as they are not supported with secure link in nginx
mkdir -p -m 0777 /media/raid0/subtitles
ln -s /media/raid0/subtitles /var/www/subs
And Put the link without directory for example:
ffmpeg http://192.168.0.1/TheNun2018.srt
Last edited by a moderator: