Skip navigation

We are sorry that due to the change of the Stalker Middleware product name to the Ministra TV platform, in some articles you will still see the name Stalker Middleware.

System Requirements

OS
Ubuntu Server LTS 64bit (recommended)

Approximately for 5000 subscribers

Middlware Server with Ministra TV platform portal
CPU Xeon5620
RAM 16Gb
HDD 2×500Gb RAID-1 (soft or hard)
Content Storage
CPU Xeon5620
RAM 16Gb
HDD System - 2×500Gb RAID-1, Content - 10×2Tb Hdw-RAID-5 (~200 simultaneous views)

Choosing of the distribution

The application works in any *nix system, but we strongly recommend to use the stable 64-bit distribution of Ubuntu Server LTS. The work with other distributions is not guaranteed.

Installing the Ministra TV Platform on Ubuntu 14.04

Necessary services & packets

  1. apache2

  2. apache2-rewrite

  3. nginx

  4. nginx-extras

  5. memcached

  6. mysqld >= 5

  7. php5 >= 5.3.0

  8. php5-mysql

  9. php-pear

  10. php-soap *

  11. php5-intl *

  12. php-gettext *

  13. php5-memcache *

  14. phing (for version >= 4.8.0) **

  15. node.js ( nodejs package) >= v0.4.8 (for PVR management)

  16. upstart (for stalkerd- PVR management)

  17. php5-curl *

  18. php5-tidy *

  19. php5-imagick *

  20. php5-geoip *

* - beginning from the version 4.8.35 they are automatically installed with phing using

** - phing installation:

pear channel-discover pear.phing.info
pear install phing/phing

Recommended operating system for Ministra TV platform installation is Ubuntu Server LTS 14.04.

Example: Install all necessary services & packages for Ubuntu 14.04.3 LTS (performed by superuser “root”):
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install -y -u apache2 nginx memcached mysql-server php5 php5-mysql php-pear nodejs upstart && sudo pear channel-discover pear.phing.info && sudo pear install -Z phing/phing

Installation order

When installing MInistra TV Platform on Ubuntu 14.04, we strongly recommend you to upgrade the NPM version to 2.15.11. Otherwise, it is possible to incorrectly install the list of application packages.

1. Install the necessary services, packages;
2. Unzip current release of “Stalker MW” in your web-server directory (For example in /var/www/ ). Project files should be available by the URL http://<your_ip_or_domain_name>/stalker_portal/ ;
3.Create MySQL user with permission to access stalker_db database only:
GRANT ALL PRIVILEGES ON stalker_db.* TO stalker@localhost IDENTIFIED BY '1' WITH GRANT OPTION;

4. Configuration file /var/www/stalker_portal/server/config.ini .

Do not edit file config.ini! If you want to change some settings - create file custom.ini and add the necessary configuration.

Do not copy the entire content of config.ini in custom.ini. Add customized sections to custom.ini only. For example, if you want to change MySQL configuration, then create a file

custom.ini

with the following lines:

[database]
mysql_host = 10.128.1.3
mysql_pass = superpass
5. Go to /var/www/stalker_portal/deploy/  and run:
sudo phing

6. It is necessary to upgrade the version of NPM to 2.15.11.

sudo npm install -g npm@2.15.11
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo reboot

7. Configure MySQL, PHP, Node.js, Apache, Nginx


Installing the Ministra TV Platform on Ubuntu 16.04

Installation order

Pay attention! To install the Ministra TV Platform on Ubuntu 16.04, you can only use the version of Ministra TV Platform 5.4 and higher. Versions that are lower than Ministra TV Platform 5.4 are only compatible with Ubuntu 14.04. When installing Ministra TV Platform on Ubuntu 16.04, we strongly recommend you to downgrade the NPM version to 2.15.11. Otherwise, it is possible to incorrectly install the list of application packages.

1. Install system updates ;

2. Install and configure apache ;

3. Install the remaining packages with one command ;

sudo apt-get install php7.0-mcrypt nginx memcached mysql-server php php-mysql php-pear nodejs libapache2-mod-php && sudo pear channel-discover pear.phing.info && sudo pear install -Z phing/phing

4.  Unzip current release of “Ministra TV platform” in your web-server directory (For example in /var/www/ ). Project files should be available by the URL http://<your_ip_or_domain_name>/stalker_portal/ ;

5. Create MySQL user with permission to access  stalker_db database only:

GRANT ALL PRIVILEGES ON stalker_db.* TO stalker@localhost IDENTIFIED BY '1' WITH GRANT OPTION;

6.  Configure MySQL, PHP, Node.js, Nginx ;

7. It is necessary to downgrade the version of NPM to 2.15.11.

sudo apt install npm
sudo npm install -g npm@2.15.11
sudo ln -s /usr/bin/nodejs /usr/bin/node

8. Go to /  var/www/stalker_portal/deploy/   and run:

sudo phing


Configure MySQL, PHP, Node.js, Apache, Nginx

MySQL

For Ubuntu 14.04

echo "max_allowed_packet = 32M" >> /etc/mysql/my.cnf

For Ubuntu 16.04

echo "sql_mode=\"\"" >> /etc/mysql/mysql.conf.d/mysqld.cnf

Then you need to restart MySQL server:

sudo service mysql restart


PHP

For Ubuntu 14.04

  • Enable mod_mcrypt :

php5enmod mcrypt
echo "short_open_tag = On" >> /etc/php5/apache2/php.ini

For Ubuntu 16.04

  • Enable mod_mcrypt :

phpenmod mcrypt
echo "short_open_tag = On" >> /etc/php/7.0/apache2/php.ini


Node.js

Check that the config.ini and custom.ini have the correct values for daemon_api_url and stalker_api_url

Apache

  • Enable mod_rewrite :

a2enmod rewrite
  • Make sure that the package libapache2-mod-php5filter is not installed on the system. If necessary, remove it.
apt-get purge libapache2-mod-php5filter
  • Remove content of /etc/apache2/sites-available/000-default.conf Do not forget to make backup.
cat /dev/null > /etc/apache2/sites-available/000-default.conf
  • Add next content to /etc/apache2/sites-available/000-default.conf
<VirtualHost *:88>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www
        <Directory /var/www/stalker_portal/>
                Options -Indexes -MultiViews
                AllowOverride ALL
                Require all granted
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
  • Set in /etc/apache2/ports.conf :

Listen 88
  • Restart apache :

service apache2 restart

Nginx

  • Example of configuration /etc/nginx/sites-available/default :
server {
    listen       80;
    server_name  localhost;
 
    location / {
        proxy_pass http://127.0.0.1:88/;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
    }
 
    location ~* \.(htm|html|jpeg|jpg|gif|png|css|js)$ {
        root /var/www;
        expires 30d;
    }
}
  • Restart nginx
service nginx restart
  •  Admin interface will be available via URL

    http://<your_ip_or_domain_name>/stalker_portal/server/adm/

    .

Default access:
login: admin
password: 1
The recommended browser for the admin interface: - Mozilla Firefox and Google Chrome
If it is necessary you can change the admin password in MySQL:

update administrators set pass=MD5('new password') where login='admin';
  • The client interface is available

    http://<your_ip_or_domain_name>/stalker_portal/c/index.html

    .
    Client interface designed for STB MAG* only.

Portal URL can be set in STB:

From Embedded portal - System Settings (press SET or SETUP) → Servers → Portals → (Portal 1 URL and/or Portal 2 URL)

The most used variables -

portal1

,

portal2

Updating

  1. Fill the download request form for the Ministra TV Platform on the official website. Please note, that the download link for the further updates will be sent to the email specified in the form. If you don't receipt reply to your request, please contact technical support: support@infomir.eu
  2. Rename the folder with the previous version. For example: stalker_portal-old .

  3. Download and unzip the file with the new version;
  4. Copy custom.ini file from the old version to the new one;

  5. Copy /var/www/stalker_portal/screenshots/ folder from the old version to the new one;

  6. Copy all files (except the dummy.png file) from stalker_portal/misc/logos/ and stalker_portal/misc/audio_covers

    from the previous version to the corresponding directories of the new version.

    Pay attention! Before upgrading to the new version, you need to install the recommended version of NPM 2.15.11.

  7. Enter into /var/www/stalker_portal/deploy/ and run command:

sudo phing

Localization

Ministra TV platform interface uses the following locales: Russian (RU), English (EN), Ukrainian (UK), Polish (PL), Greek (EL), Italian (IT), German (DE), Slovenian (SK), Spanish (ES). In default Ministra deducts the current localization variable from the main software and install the interface localization according to it's variable.

To install Ministra portal localization by default it is necessary:

  • to create file custom.ini in directory .../stalker_portal/server/ ;

  • to copy in custom.ini the section [Locales] from file ...//stalker_portal/server/config.ini ;

  • to edit custom.ini

Containing of custom.ini :

[locales]
default_locale = ru_RU.utf8
allowed_locales[Русский] = ru_RU.utf8
allowed_locales[English] = en_GB.utf8
allowed_locales[Українська] = uk_UA.utf8
allowed_locales[Polski] = pl_PL.utf8
allowed_locales[Ελληνικά] = el_GR.utf8
allowed_locales[Nederlandse] = nl_NL.utf8
allowed_locales[Italiano] = it_IT.utf8
allowed_locales[Deutsch] = de_DE.utf8
allowed_locales[Slovenský] = sk_SK.utf8
allowed_locales[Español] = es_ES.utf8

In this case Ministra portal will be loaded with English interface independently from the software locale.

Attention! The name of the locale used in the Middleware and the name of the server system locale should be the same.

Interface localization in other language

For correct localization switching in Admin interface next locales should be installed on the server: ru_RU.utf8 , en_GB.utf8 , uk_UA.utf8 , pl_PL.utf8 , pl_PL.utf8 , el_GR.utf8 , nl_NL.utf8 , it_IT.utf8 , de_DE.utf8 , sk_SK.utf8 , es_ES.utf8 .

Configuration of the Storage (separate server)

Necessary services & packets

  1. apache2

  2. php5 >= 5.3.0

  3. php-soap

  4. libpython2.7-stdlib (for TV recording)

  5. nginx (for "TV Archive", recording or VOD via HTTP)

Installation order

1. Install all necessary services & packets.
for example:

apt-get install -y -u apache2 php5 php-soap python2.7 nginx nginx-extras

2. Unzip the file with release off “Stalker” portal. Copy the directory /stalker_portal/storage/ in your web-server directory /var/www/stalker_portal/storage ;
3. To enable recording for “TV Archive” function it is necessary to run next command in /var/www/stalker_portal/storage/ :

chmod a+x install.sh
./install.sh

4. Edit file /var/www/stalker_portal/storage/config.php :

For example:

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:password@192.168.1.71/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

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.

5. Create directories /media/raid0/storage/, /media/raid0/karaoke/, /media/raid0/records/, /media/raid0/mac/

and set permission 0777 to them.

mkdir -p -m 0777 /media/raid0/storage /media/raid0/karaoke /media/raid0/records /media/raid0/mac

6. Create a directory /var/www/media/

mkdir /var/www/media

7. Create a symbolic link to the STB's home directories in /var/www/media/

ln -s /media/raid0/mac/ /var/www/media/<storage name>

8. In Admin interface of portal“Storage” make next settings:

  • Name - <storage name>. For example: bb3 ;

  • IP - IP address of storage;
  • Home directory - <STB's home directory>. For example: /media/raid0/mac/

9. Configuring Apache, Nginx:

Configuring Apache, Nginx

Apache

  • In /etc/apache2/ports.conf set next:

Listen 88
  • 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
  • Attention! Make sure that the package libapache2-mod-php5filter is not installed on the system. If necessary, remove it.
  • Restart apache.

Nginx

For example:

server {
    listen       80;
    server_name  example.com;
 
    location / {
        proxy_pass http://127.0.0.1:88/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
 
    location ~* \.(mpg|mpeg|avi|ts|mkv|mp4|mov|m2ts|flv|m4v|srt|sub|ass)$ {
 
        secure_link $arg_st,$arg_e;
        secure_link_md5 "supersecret$uri$remote_addr$arg_e"; # you can change secret "supersecret" in the portal config - nginx_secure_link_secret

        if ($secure_link = "") {
            return 403;
        }
 
        if ($secure_link = "0") {
            return 410;
        }
 
        send_timeout 6h;
        root /var/www/;
    }
}

"TV archive" settings

Before turning on “TV archive” option in TV channels, it is necessary to configure the "storage".

Attention! Only multicast streams can be recorded! Multicast streams should be available on the “Storage”

Checking of the availability of multicast streams can be performed with help of

dumprtp

utility. Utility

dumprtp

is included in

dvbstream

packet.
Example:

dumprtp 239.1.1.1 1234 > dump239.1.1.1.ts 

where:

  • 239.1.1.1 - IP address of multicast stream
  • 1234 - port of a multicast stream
  • dump239.1.1.1.ts - file name with dump of multicast stream.

Received files can be played by any player (for example: VLC).

  • Make sure that memcached is installed and worked on the server.
  • In Admin interface → “Storages” it is necessary to choose server and setup “TV record” option.
  • At the storage /var/www/stalker_portal/storage/config.php necessary to setup RECORDS_DIR , API_URL , PORTAL_URL and STORAGE_NAME .

where is:
RECORDS_DIR
- directory with permission 0777 ,there will be create archive directory, which will contain all files.
API_URL - URL
, which will record the channels from middleware. Usually it is http://<middleware directory>/api/tv_archive/ .

To check it you can open your

<API_URL>/tv_archive/

in browser and there should be next:

{“status”:“ERROR”,“results”:null,“error”:“Empty storage name”}

If there is an error

404 Not Found

, then you have the wrong configuration in

apache

and

mod_rewrite

.

/tv_archive

- virtual directory! Do not create it manually!


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.

The approximate content of the file /var/www/stalker_portal/storage/config.php :

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:password@192.168.1.71/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
  • Create directory /media/raid0/records/archive/
mkdir -m 0777 /media/raid0/records/archive
  • Create a symbolic link of the folder with the archive in web server directory

ln -s /media/raid0/records/archive/  /var/www/
  • While editing TV channel in Admin interface you can choose “Enable TV archive” option.
  • Ensure that the Apache configuration file have adirective
TimeOut 1800

Security

Web

User identification

First of all it is necessary to turn on remoteip module in apache. It allows seeing the real IP address of user while working in nginx and user restricting access in apache configuration file.

Turn on the remote ip module:

a2enmod remoteip

If you previously enabled the rpaf module, disable it:

a2dismod rpaf

Create the remoteip.conf file on the path /etc/apache2 /conf-available/ and add the following contents to it:

<ifmodule remoteip_module>
  RemoteIPHeader X-Real-IP
  RemoteIPInternalProxy 127.0.0.1 external_server_ip
</ifmodule>

external_server_ip - address of your server.

To activate the settings of there mote ip module, you need to run the following command:

a2enconf remoteip

In the apache2.conf file, under the path /etc/apache2/ replace the line:

LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

to the following content:

LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

Then restart apache:

service apache2 restart

Restricting access in Admin interface

To improve the security of Admin interface it is strongly recommended to use the same IP address for the opening. This can be set in apache configuration file,where portal's host is described. After making changes it is necessary to restart apache.

<Directory /var/www/stalker_portal/server/adm/>
    Order Deny,Allow
    Deny from All
    Allow from 192.168.1.0/24
</Directory>

STB - Authorization

Strongly recommended for the client portal's access to use STB authorization by login/password, "Authorization with key" method.

Portal access limitation for new STBs

Beginning from 4.8.63 portal version there is new option appeared default_stb_status, which allows closing portal access for all new STBs. To enable this option it is necessary to add in server/custom.ini:

default_stb_status = 0

For old version in MySQL it is necessary to do:

ALTER TABLE `users` MODIFY `status` tinyint DEFAULT 1; 

After this all new STBs will have status OFF in admin interface.

Access control based on the set-top box model

Ministra allows you to differentiate the access to the portal based on set-top box model. The list of all models that are allowed access, is described in parameter allowed_stb_types of the configuration file. For example, you need to add support of WR320 model, all you need is to add in stalker_portal/server/custom.ini the line

allowed_stb_types = MAG200,MAG245,MAG250,MAG254,MAG255,MAG270,MAG275,AuraHD,WR320

For AuraHD set-top box there is a possibility of the strict model check (parameter strict_stb_type_check), in this case, it is necessary to completely specify the model. For example, access is allowed only to AuraHD International:

strict_stb_type_check = true
allowed_stb_types = AuraHD9

If the model supports recording on the local media, then you can additionally add it to the appropriate list

allowed_stb_types_for_local_recording = MAG245,MAG250,MAG255,MAG270,MAG275,AuraHD,WR320

Access to portal using login&password

Simple authorization

Access to the portal organization for new STBs using login&password. Portal admin creates login&password and provide them to the user. While first loading there will be authorization window which requests login&password. After successful authorization MAC address will be adjust to login. Further portal loading will be without authorization.

For this it is necessary to:

1. In custom.ini add next

auth_url = http://localhost/stalker_portal/server/tools/auth_simple.php

2. In admin interface users > add -add user, it is enough to specify login (unique) and password. MAC address field should be empty.

Authorization with key

Access to portal organization by login&password. Portal admin creates login/password and provides them to the user. While first loading there will be authorization window which request login&password. After successful authorization new key will be generating which is based on login&password. This key is stored on STB, which will validate while next portal loading. If the same login&password will be used for another STB than previous one will be un-authorized automatically.

For this it is necessary to:

  1. In custom.ini add next

    auth_url = http://localhost/stalker_portal/server/tools/auth_every_load.php
  2. In admin interface users > add -add user,it is enough to specify login(unique) and password. MAC address field should be empty.

API

 We are strongly recommend to pay attention to safety while API enable/use.

Recommendation about using:

  • Authentication (login&password) for access to API.
  • Strong passwords.
  • Firewall.

Billing

If it is necessary to turn on API for working with external billing systems then it is strongly recommended to use authorization. Specify the login and password in server/custom.ini.

[server_api]
; API required for tv archive, pvr and billing
enable_api = true
api_auth_login = login ; login specifying
api_auth_password = password ; password specifying

Storage configuring

On the storages, which are used for recording, it is necessary to specify API_URL parameter with login and password (in storage/config.php):

define('API_URL', 'http://login:password@localhost/stalker_portal/api/');

Temporary URLs

If the Wowza temporary URLs are using for playing, then it is necessary to specify the login and password for work with API in the configuration of Wowza application. It is not necessary to specify them if nginx and VLC/udpxy are used.

API address setting in configuration file of Wowza:

<Property>
    <Name>stalkerApiServer</Name>
    <Value>http://login:password@192.168.1.1/stalker_portal/api/</Value>
</Property>

TV channel monitoring

In script check_channels.sh API_URLit is necessary to specify authorization URL:

API_URL=http://login:password@localhost/stalker_portal/api/monitoring_links/

Firewall

It is recommended to make access on 88 port (apache) for local access and access from storage, which are working with temporary URLs.

Need Help

Cindy is an expert on the Ministra TV platform and the author of this article.

Was this article helpful?

Yes No

Sorry to hear that.
How can we improve this article?

We use cookies in order to optimise our website, provide you with the best possible user experience and help us promote our products. Please read our Cookie Policy to find out how we use cookies and how you can control cookies.
By using this website or closing this message, you acknowledge our Privacy Policy and agree to our use of cookies as described in our Cookie Policy.