[THANKS]
# First we update the list of packages, and we update the packages
apt update & apt upgrade
# Ubuntu 18 and 20.04 has php7.2+ as the default version of PHP but ministry 5.6.1 can work with PHP version <= 7.1 So, we'll use php7.0.
# Add repository for php7.0
apt install software-properties-common & add-apt-repository ppa:ondrej/php
apt update & apt upgrade -y
apt remove php* -y
# Install Apache2
apt -y install apache2
# Configuring Apache2
# Change port 80 to 88
nano /etc/apache2/ports.conf
Listen 88
Save file Ctrl+O and close Ctrl+X
cat /dev/null > /etc/apache2/sites-available/000-default.conf
nano /etc/apache2/sites-enabled/000-default.conf
# Paste this into the 000-default.conf file
<VirtualHost *:88>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory /var/www/stalker_portal/>
Options -Indexes -MultiViews
AllowOverride ALL
Require all granted
</Directory>
<Directory /var/www/>
Options -Indexes -MultiViews
AllowOverride ALL
Require all granted
</Directory>
<Directory /var/www/player>
Options -Indexes -MultiViews
AllowOverride ALL
#Require all granted
DirectoryIndex index.php index.html
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save file Ctrl+O and close Ctrl+X
service apache2 restart
# Install required packages
apt -y install apache2 nginx memcached curl mysql-server php7.0 php7.0-mysql php7.0-memcached php7.0-curl php-pear php7.0-xml php7.0-mcrypt php7.0-zip php7.0-sqlite3 php7.0-imagick php7.0-soap php7.0-intl php7.0-gettext php7.0-tidy php7.0-geoip nodejs systemd-sysv
# Set php7.0 as default PHP.
update-alternatives --set php /usr/bin/php7.0
a2dismod php7.*
a2enmod php7.0
# Download Ministra
cd /var/www/
wget https://download.ministra.com/downloads/2b93b176f3d2373364d6786a814f236c/ministra-5.6.9.zip
unzip ministra-5.6.1.zip
rm -rf *.zip
# Create Database ( there is some changes due to Mysql 8.X)
mysql -uroot -e "CREATE DATABASE stalker_db;"
mysql -uroot -e "CREATE USER stalker@localhost IDENTIFIED WITH mysql_native_password BY '1';"
mysql -uroot -e "GRANT ALL PRIVILEGES ON stalker_db.* TO stalker@localhost WITH GRANT OPTION;"
# Install NPM 2.5.11
sudo apt-get -y -u install npm
sudo npm install -g [email protected]
sudo ln -s /usr/bin/nodejs /usr/bin/node
# Set the Server Timezone to EDT
echo "America/Toronto" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# MySQL Settings
echo 'sql_mode=""' >> /etc/mysql/mysql.conf.d/mysqld.cnf
echo 'default_authentication_plugin=mysql_native_password' >> /etc/mysql/mysql.conf.d/mysqld.cnf # For MySQL 8.X
/etc/init.d/mysql restart
# PHP Settings
echo "short_open_tag = On" >> /etc/php/7.0/apache2/php.ini
# Ministra custom.ini
# Edit configuration using test editor
nano /var/www/stalker_portal/server/costom.ini
default_stb_status = 0
auto_add_stb = false
; 1 - on, 0 - off
;default_stb_status = 0
auth_url = http://localhost/stalker_portal/server/tools/auth_simple.php
enable_service_button = true
display_menu_after_loading = true
enable_m3u_file = false
Save file Ctrl+O and close Ctrl+X
# Pear
pear channel-discover pear.phing.info
pear install --alldeps phing/phing-2.15.2 # Phing V2.16.4 has an issue with PHP7.0 and PHP7.1
# Fix Smart Launcher Applications
mkdir /var/www/html/.npm
chmod 777 /var/www/html/.npm
# Configuring Nginx
cat /dev/null > /etc/nginx/sites-available/default
nano /etc/nginx/sites-enabled/default
# Paste this in the default file
server {
listen 80;
server_name localhost;
root /var/www;
location ^~ /player {
root /var/www/player;
index index.php;
rewrite ^/player/(.*) /player/$1 break;
proxy_pass http://127.0.0.1:88/;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
}
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;
}
}
Save Ctrl+O and close Ctrl+X
service nginx restart
# Phing :)
cd /var/www/stalker_portal/deploy
phing
# Remove system I/O limiter for mysql-server
cp /lib/systemd/system/mysql.service /etc/systemd/system/
echo "LimitNOFILE=infinity" >> /etc/systemd/system/mysql.service
echo "LimitMEMLOCK=infinity" >> /etc/systemd/system/mysql.service
systemctl daemon-reload
systemctl restart mysql
# By Default, In Ubuntu 18.04 and 20.04 mysql-server's root user can access it without a password.
Now you can access Ministra TV platform's admin panel at http://[Your server's IP address]/stalker_portal/
[/THANKS]