Ministra TV Platform Installation2
Ministra TV Platform Installation2
Ministra TV Platform Installation2
INSTALLATION
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
RAM 8Gb
2xXeon 2620
CPU
RAM 32Gb
HDD System - 2xHDD HARDWARE RAID1, Content - 12xHDD HARDWARE RAID5
Ministra Recommended
TV Operating
Platform System
version
lower Ubuntu
than Server LTS 14.04
5.5.0
Installing the Ministra TV Platform
on Ubuntu 14.04
Necessary services & packets
1. apache2
2. apache2-rewrite
3. nginx
4. memcached
5. mysqld >= 5
6. php5 >= 5.3.0
7. php5-mysql
8. php-pear
9. php-soap *
10. php5-intl *
11. php-gettext *
12. php5-memcache *
13. phing (for version >= 4.8.0) **
14. nodejs>= v0.4.8 (for PVR management)
15. upstart (for stalkerd - PVR management)
16. php5-curl *
17. php5-tidy *
18. php5-imagick *
19. php5-geoip *
20. php5-sqlite
* - beginning from the version 4.8.35 they are automatically installed with phing using.
** - phing installation:
Example of installing all necessary services & packages for Ubuntu 14.04.3 LTS
(performed by superuser “root”):
1. sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install -y -u apache2
nginx memcached php5-memcache mysql-server php5 php5-mysql php-pear nodejs m
crypt php5-mcrypt npm php5-curl php5-imagick php5-sqlite upstart && sudo pear cha
nnel-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 archive with version 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:
4. Make the necessary changes in the portal config. To change the settings/configuration
you need to create a configuration file /var/www/stalker_portal/server/custom.ini and add
to it different from config.ini settings items.
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:
1. [database]
2. mysql_host = 10.128.1.3
3. mysql_pass = superpass
If an error Error: CERT_UNTRUSTED occurs during the installation of npm, use the
command:
1. sudo phing
where
Note! If you use a host and port other than those specified by default, they must be
specified in the command parameters.
3. Back up the portal directory:
1. sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
1. sudo do-release-upgrade
3. Type y to enable the run of the additional ssh daemon on port 1022. It will be required to
access the system in case the update is not completed.
1. Reading cache
2.
3. Checking package manager
4.
5. Continue running under SSH?
6.
7. This session appears to be running under ssh. It is not recommended
8. to perform a upgrade over ssh currently because in case of failure it
9. is harder to recover.
10.
11. If you continue, an additional ssh daemon will be started at port
12. '1022'.
13. Do you want to continue?
14.
15. Continue [yN]
Click Enter.
7. After confirming that the services restart automatically, a few messages will appear
stating that some default configuration files have been changed.
Note! You probably changed some default configuration files, so follow the instructions
below and reject offers to replace the changed files.
For example, you will be prompted to change the default configuration for the Nginx
virtual host. Press N.
1. Configuration file '/etc/nginx/sites-available/default'
2. ==> Modified (by you or by a script) since installation.
3. ==> Package distributor has shipped an updated version.
4. What would you like to do about it ? Your options are:
5. Y or I : install the package maintainer's version
6. N or O : keep your currently-installed version
7. D : show the differences between the versions
8. Z : start a shell to examine the situation
9. The default action is to keep your current version.
10. *** default (Y/I/N/O/D/Z) [default=N]
8. Select the keep the local version currently installed option to configure unattended-
upgrades.
9. On the new system, without any configuration changes, you can answer y to confirm the
removal of unnecessary packages. On a system that has been significantly modified, you
can answer d and view the list of packages proposed for removal in case you want to
reinstall some of them later.
10. After the update is complete, you must restart the server. Enter y to continue.
1. === Command detached from window (Thu Oct 3 04:35:58 2019) ===
2. === Command terminated normally (Thu Oct 3 04:36:08 2019) ===
12. You may need to type any key to exit, since the SSH session was interrupted on the
server side. Wait for the system to reboot and log in again.
13. Verify that the system is updated to Ubuntu 16.04. To do this, run the following
command:
1. lsb_release -a
1. phpenmod mcrypt
1. sudo phing
Installing the Ministra TV Platform
on Ubuntu 16.04
Installation order
Note! To install Ministra TV Platform on Ubuntu 16.04, you must use Ministra TV
Platform version 5.4.0 and higher. Versions lower than Ministra TV Platform 5.4.0
are only compatible with Ubuntu 14.04. When installing Ministra TV Platform 5.4 on
Ubuntu 16.04, we strongly recommend you to downgrade the NPM version to 2.15.11.
Otherwise, incorrect installation of the list of application packages is possible.
1. Install system updates:
4. Unzip the archive with the version to the root directory of the web server /var/www/.
Project files should be available by the
URL http://<your_ip_or_domain_name>/stalker_portal/;
6. Make the necessary changes in the portal config. To change the settings/configuration
you need to create a configuration file /var/www/stalker_portal/server/custom.ini and add
to it different from config.ini settings items.
If the Error: CERT_UNTRUSTED error occurs during the installation of npm, use the
command:
1. sudo phing
PHP
For Ubuntu 14.04
Enable mod_mcrypt :
1. php5enmod mcrypt
1. phpenmod mcrypt
Apache
Enable mod_rewrite :
1. a2enmod rewrite
Make sure that the package libapache2-mod-php5filter is not installed on the system.
If necessary, remove it.
1. <VirtualHost *:88>
2. ServerAdmin webmaster@localhost
3. DocumentRoot /var/www
4. <Directory /var/www/stalker_portal/>
5. Options -Indexes -MultiViews
6. AllowOverride ALL
7. Require all granted
8. </Directory>
9. <Directory /var/www/player>
10. Options -Indexes -MultiViews
11. AllowOverride ALL
12. #Require all granted
13. DirectoryIndex index.php index.html
14. </Directory>
15. ErrorLog ${APACHE_LOG_DIR}/error.log
16. CustomLog ${APACHE_LOG_DIR}/access.log combined
17. </VirtualHost>
Set in /etc/apache2/ports.conf :
1. Listen 88
Restart apache :
Nginx
Example of configuration /etc/nginx/sites-available/default :
1. server {
2. listen 80;
3. server_name localhost;
4.
5. root /var/www;
6. location ^~ /player {
7. root /var/www/player;
8. index index.php;
9. rewrite ^/player/(.*) /player/$1 break;
10. proxy_pass http://127.0.0.1:88/;
11. proxy_set_header Host $host:$server_port;
12. proxy_set_header X-Real-IP $remote_addr;
13. }
14.
15. location / {
16. proxy_pass http://127.0.0.1:88/;
17. proxy_set_header Host $host:$server_port;
18. proxy_set_header X-Real-IP $remote_addr;
19. }
20.
21. location ~* \.(htm|html|jpeg|jpg|gif|png|css|js)$ {
22. root /var/www;
23. expires 30d;
24. }
25. }
Restart nginx
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:
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)
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:
1. 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.
1. [locales]
2. default_locale = ru_RU.utf8
3. allowed_locales[Русский] = ru_RU.utf8
4. allowed_locales[English] = en_GB.utf8
5. allowed_locales[Українська] = uk_UA.utf8
6. allowed_locales[Polski] = pl_PL.utf8
7. allowed_locales[Ελληνικά] = el_GR.utf8
8. allowed_locales[Nederlandse] = nl_NL.utf8
9. allowed_locales[Italiano] = it_IT.utf8
10. allowed_locales[Deutsch] = de_DE.utf8
11. allowed_locales[Slovenský] = sk_SK.utf8
12. 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 .
Installation order
1. Install all necessary services & packages:
Ubuntu 16.04
Ubuntu 14.04
1. <VirtualHost *:88>
2. TimeOut 1800
3. ServerAdmin webmaster@localhost
4. DocumentRoot /var/www
5. <Directory /var/www/stalker_portal/>
6. Options -Indexes -MultiViews
7. AllowOverride ALL
8. Require all granted
9. </Directory>
10. ErrorLog ${APACHE_LOG_DIR}/error.log
11. CustomLog ${APACHE_LOG_DIR}/access.log combined
12. </VirtualHost>
3. Set in /etc/apache2/ports.conf :
1. Listen 88
5. Restart apache :
6. Install Nginx:
1. server {
2. listen 80;
3. server_name example.com;
4.
5. location / {
6. proxy_pass http://127.0.0.1:88/;
7. proxy_set_header Host $host;
8. proxy_set_header X-Real-IP $remote_addr;
9. }
10.
11. location ~* \.(mpg|mpeg|avi|ts|mkv|mp4|mov|m2ts|flv|m4v|srt|sub|ass)$ {
12.
13. secure_link $arg_st,$arg_e;
14. secure_link_md5 "supersecret$uri$remote_addr$arg_e"; # you can change secret
"supersecret" in the portal config - nginx_secure_link_secret
15.
16. if ($secure_link = "") {
17. return 403;
18. }
19.
20. if ($secure_link = "0") {
21. return 410;
22. }
23.
24. send_timeout 6h;
25. root /var/www/;
26. }
27. }
7. Restart Nginx:
8. Unzip the archive with the version of the portal. Copy the contents of the
directory /stalker_portal/storage/ in /var/www/stalker_portal/storage
Create a symbolic link of the folder with the archive to the root of web server.
Create the necessary directories and symbolic links with one command:
1. define('VIDEO_STORAGE_DIR', '/media/raid0/storage/');
2. define('KARAOKE_STORAGE_DIR', '/media/raid0/karaoke/');
3. define('RECORDS_DIR', '/media/raid0/records/');
4. define('NFS_HOME_PATH', '/media/raid0/mac/');
5. //В качестве логина и пароля будут использоваться значения параметров api_aut
h_login и api_auth_password из файла server/custom.ini, который хранится на серв
ере с порталом.
6. define('API_URL', 'http://login:password@192.168.1.71/stalker_portal/api/');
7. define('PORTAL_URL', 'http://192.168.1.71/stalker_portal/');
8. define('STORAGE_NAME', 'bb3');
9. define('ASTRA_RECORDER', false);
10. define('DUMPSTREAM_BUFFERING', 1); // set -1 for system default
where:
VIDEO_STORAGE_DIR- the directory for storing the Video club files;
KARAOKE_STORAGE_DIR- the directory for storing the Karaoke files;
RECORDS_DIR- directory with write permissions 0777 . In this directory, create a
directory archive , where TV archive files will be created. See TV Archive settings.
NFS_HOME_PATH- STB's home directory;
API_URL- URL to record channels from middleware. Usually it is http://<middleware
directory>/api/tv_archive/
PORTAL_URL- portal address. It will be accessed by the storage to verify the access keys
to the archive. For example, http://<portal ip or domain name>/stalker_portal/
STORAGE_NAME- the name of the storage specified in the admin interface.
<API_URL>
for TV archive:
http://<you_ip_or_domain_name>/stalker_portal/api/tv_archive/
Message
If there is an error
apache
and
mod_rewrite
. Note!
/tv_archive
- virtual directory! Do not create it manually!
11. To record a TV archive, go to /var/www/stalker_portal/storage/ and run:
/media/raid0/mac/ Read more about adding storage in the administration panel here.
dumprtp
utility. Utility
dumprtp
is included in
dvbstream
packet.
Example:
where:
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.
1. a2enmod remoteip
1. a2dismod rpaf
Create the remoteip.conf file on the path /etc/apache2 /conf-available/ and add the
following contents to it:
1. <ifmodule remoteip_module>
2. RemoteIPHeader X-Real-IP
3. RemoteIPInternalProxy 127.0.0.1 external_server_ip
4. </ifmodule>
To activate the settings of the remoteip module, you need to run the following command:
1. a2enconf remoteip
In the apache2.conf file, under the path /etc/apache2/ replace the line:
1. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" co
mbined
1. <Directory /var/www/stalker_portal/server/adm/>
2. Order Deny,Allow
3. Deny from All
4. Allow from 192.168.1.0/24
5. </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 option default_stb_status appeared, which
allows closing portal access for all new STBs. To enable this option it is necessary to add
in server/custom.ini :
1. default_stb_status = 0
After this all new STBs will have status OFF in admin interface.
1. allowed_stb_types = MAG200,MAG245,MAG250,MAG254,MAG255,MAG270,MA
G275,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:
1. strict_stb_type_check = true
2. allowed_stb_types = AuraHD9
If the model supports recording on the local media, then you can additionally add it to the
appropriate list
1. allowed_stb_types_for_local_recording = MAG245,MAG250,MAG255,MAG270,M
AG275,AuraHD,WR320
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.
1. 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.
API
We are strongly recommend to pay attention to safety while API enable/use.
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 .
1. [server_api]
2. ; API required for tv archive, pvr and billing
3. enable_api = true
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 ):
1. 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.
1. <Property>
2. <Name>stalkerApiServer</Name>
3. <Value>http://login:password@192.168.1.1/stalker_portal/api/</Value>
4. </Property>
TV channel monitoring
In script check_channels.sh API_URL it is necessary to specify authorization URL:
1. 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.