XtreamUI Things

XtreamUI Things

XtreamUI allows IPTV streaming providers to manage their own IPTV or VOD service and their customer database. … Xtream-UI Panel is a software to build your own IPTV Server from scratch. It supports all common protocols as an input and it is powered by the FFMPEG. XtreamUI Things, xtreamui 2021

HowTo fix CPU and RAM overload on XtreamUI

Make sure pid_monitor is in crons.

1. Clean up streams_sys using stream tools.
2. Optimize your server OS:

Set ulimit parameters on your ubuntu server. Check ulimit with this command:

Code:
ulimit -u

if it was 1024 then we need to increase it as follow

Code:
nano /etc/security/limits.conf

add the following lines to the end of your file:

Code:

* hard nofile 500000

* soft nofile 500000

root hard nofile 500000

root soft nofile 500000

* soft nproc 500000

* hard nproc 500000

root soft nproc 500000

root hard nproc 500000

Then save and close the file.

3. Optimize sysctl

Edit sysctl.conf – sysctl preload/configuration file (these settings has been taken from an LB that had xtream-codes installed to it)

Code:
nano /etc/sysctl.conf

add the following lines to the end of your file:

Code:

net.core.somaxconn = 6815744

net.ipv4.route.flush=1

net.ipv4.tcp_no_metrics_save=1

net.ipv4.tcp_moderate_rcvbuf = 1

fs.file-max = 6815744

fs.aio-max-nr = 6815744

fs.nr_open = 6815744

net.ipv4.ip_local_port_range = 1024 65000

net.ipv4.tcp_sack = 1

net.ipv4.tcp_timestamps = 0

net.ipv4.tcp_rmem = 10000000 10000000 10000000

net.ipv4.tcp_wmem = 10000000 10000000 10000000

net.ipv4.tcp_mem = 10000000 10000000 10000000

net.core.rmem_max = 524287

net.core.wmem_max = 524287

net.core.rmem_default = 524287

net.core.wmem_default = 524287

net.core.optmem_max = 524287

net.core.netdev_max_backlog = 300000

net.ipv4.tcp_max_syn_backlog = 300000

net.netfilter.nf_conntrack_max=1215196608

net.ipv4.tcp_window_scaling = 1

vm.max_map_count = 655300

net.ipv4.tcp_max_tw_buckets = 1440000

Then save and close the file.

run this command:

Code:
sudo sysctl -p

4. Reboot your server and check it now !

after reboot, run these commands again to verify your changes:

Code:
ulimit -u

-> should show 500000

-> should show the above values

 

Xtream-ui epg fix

A simple cron job to update EPG tested and working fine.

Code:

0 4 * * * /home/xtreamcodes/iptv_xtream_codes/php/bin/php /home/xtreamcodes/iptv_xtream_codes/crons/epg.php

Or if you want you can run it twice per day:

0 */12 * * * /home/xtreamcodes/iptv_xtream_codes/php/bin/php /home/xtreamcodes/iptv_xtream_codes/crons/epg.php

How to reset xtream ui admin password

Login to the MySQL Server:

Code:
sudo mysql -u root

Now copy & past following commands:

Code:

UPDATE xtream_iptvpro.reg_users SET password='$6$rounds=20000$xtreamcodes$XThC5OwfuS0YwS4ahiifzF14vkGbGsFF1w7ETL4sRRC5sOrAWCjWvQJDromZUQoQuwbAXAFdX3h3Cp3vqulpS0' WHERE id='1';

UPDATE xtream_iptvpro.reg_users SET username = ‘admin’ WHERE id = ‘1’;

UPDATE xtream_iptvpro.reg_users SET member_group_id = ‘1’ WHERE id = ‘1’;

exit

Now you can login with:
User: admin
Pass: admin

 

Xtream ui check mag check leaked lines

Log in to to mysql or php go to mag devices and execute this query.
It will display all mag devices with more than 1 ip used from user activity ( you must have enabled logs for this to work correctly)
For example if someone pulled illegal m3u from mac, and sharing your line etc. you can check this out with this command

Code:

SELECT FROM_BASE64(mac), username, PASSWORD, user_activity.user_id, GROUP_CONCAT(DISTINCT user_ip) FROM user_activity

INNER JOIN users ON user_id = users.id AND is_mag = 1

INNER JOIN mag_devices ON users.id = mag_devices.user_id

WHERE 1 GROUP BY user_id HAVING COUNT(DISTINCT user_ip) > 1

You can also use php code

$sql = ‘SELECT FROM_BASE64(mac), username, PASSWORD, user_activity.user_id, GROUP_CONCAT(DISTINCT user_ip) FROM user_activity \n”
.
“INNER JOIN users ON user_id = users.id AND is_mag = 1\n”
.
“INNER JOIN mag_devices ON users.id = mag_devices.user_id\n”
. ”
“WHERE 1 GROUP BY user_id HAVING COUNT(DISTINCT user_ip) > 1’;

DUMP Database (Backup)

On your OLD Server
Run as root:

Bash:
mysqldump xtream_iptvpro > xtcdump.sql

RESTORE Database

Upload xtcdump.sql to your new server (It’s OK to use /root)
Run as root:

Bash:
mysql xtream_iptvpro < /root/xtcdump.sql

NOTE: This is ONLY for XC V2 to V2!

User not working to login on panel after RESTORE DB?

Using SSH: mysql
Now type:

Bash:
UPDATE xtream_iptvpro.reg_users SET password='$6$rounds=20000$xtreamcodes$XThC5OwfuS0YwS4ahiifzF14vkGbGsFF1w7ETL4sRRC5sOrAWCjWvQJDromZUQoQuwbAXAFdX3h3Cp3vqulpS0' WHERE id='1';
UPDATE xtream_iptvpro.reg_users SET username = 'admin' WHERE id = '1';
UPDATE xtream_iptvpro.reg_users SET member_group_id = '1' WHERE id = '1';

Login using admin/admin

I rebooted the server and the panel didn’t come back up

As root run:

Bash:
/home/xtreamcodes/iptv_xtream_codes/start_services.sh

How to get m3u playlist?

PHP:
http://ip.address:25461/get.php?username=user&password=pass&type=m3u&output=ts

Download m3u not working

Check if the user does NOT have MAG and stuff ENABLED on user config. They must be DISABLED!

libexslt.so.0 – geoip.so – libcurl ERRORS

Run as root:

Bash:
apt-get install libxslt1-dev libcurl3 libgeoip-dev

How to ADD Stream on the final step

Move the “Main Server” tile INSIDE the “Stream Source” like this:

How to find out user_iptvpro mysql password?

As root run:

Bash:
wget https://raw.githubusercontent.com/xtreamui/XtreamUI/master/pytools/config.py && python config.py DECRYPT && rm config.py

How to change BROADCAST port from 25461 to another port?

Change NEWPORT to the port you want. Eg 8080
As root run:

Bash:
sed -i 's/25461/NEWPORT/g' /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf ; /etc/init.d/xtreamcodes

How to change ADMIN port from 25500 to another port?

Change NEWPORT to the port you want. Eg 8081
As root run:

Bash:
sed -i 's/25500/NEWPORT/g' /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf ; /etc/init.d/xtreamcodes

I rebooted the server and the panel didn’t come back up

As root run:

Bash:
/home/xtreamcodes/iptv_xtream_codes/start_services.sh

How to FORCE RELOAD EPG (If EPG empty on Apps and stuff)

Bash:
/home/xtreamcodes/iptv_xtream_codes/php/bin/php /home/xtreamcodes/iptv_xtream_codes/crons/epg.php


Errors AUTO Installing Load Balancers?

As root run on the LOAD BALANCE SERVER:

Bash:
apt-get install wget libxslt1-dev libcurl3 libgeoip-dev python -y

Now delete (X) the stuck on installing server on the Admin UI and try again.

Fix 500 Errors on XC v2

As root run:

Bash:
apt-get install e2fsprogs -y && chattr -i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb ; wget https://archive.org/download/geolite2_201910/GeoLite2.mmdb -O /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && chown xtreamcodes.xtreamcodes /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && chattr +i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && clear && echo

“If you see this message, 500 errors are probably fixed”

How to find out what Network Interface to use on your Admin UI
As root run:

Bash:
route -n | awk '$1 == "0.0.0.0" {print $8}'

After that, on your Admin UI, go to: Servers > Manage Servers > Edit > Advanced

`CURL_OPENSSL_3′ not found fix

As root run:

Bash:
apt-get remove --auto-remove libcurl4-openssl-dev
apt-get install libcurl3 -y

Fix GeoLite2 permission

As root run:

Bash:
sudo chattr -i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb
sudo chmod 777 /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb
sudo ./start_services.sh

fix startup script (someone else figured it out)

Bash:
#! /bin/bash
kill $(ps aux | grep 'xtreamcodes' | grep -v grep | grep -v 'start_services.sh' | awk '{print $2}') 2>/dev/null
sleep 1
kill $(ps aux | grep 'xtreamcodes' | grep -v grep | grep -v 'start_services.sh' | awk '{print $2}') 2>/dev/null
sleep 1
kill $(ps aux | grep 'xtreamcodes' | grep -v grep | grep -v 'start_services.sh' | awk '{print $2}') 2>/dev/null
sleep 2

sudo -u xtreamcodes /home/xtreamcodes/iptv_xtream_codes/php/bin/php /home/xtreamcodes/iptv_xtream_codes/crons/setup_cache.php
sudo -u xtreamcodes /home/xtreamcodes/iptv_xtream_codes/php/bin/php /home/xtreamcodes/iptv_xtream_codes/tools/signal_receiver.php >/dev/null 2>/dev/null &
sudo -u xtreamcodes /home/xtreamcodes/iptv_xtream_codes/php/bin/php /home/xtreamcodes/iptv_xtream_codes/tools/pipe_reader.php >/dev/null 2>/dev/null &
chown -R xtreamcodes:xtreamcodes /sys/class/net
chown -R xtreamcodes:xtreamcodes /home/xtreamcodes
sleep 1
/sbin/start-stop-daemon --start --quiet --pidfile /home/xtreamcodes/iptv_xtream_codes/php/VaiIb8.pid --exec /home/xtreamcodes/iptv_xtream_codes/php/sbin/php-fpm -- --daemonize --fpm-config /home/xtreamcodes/iptv_xtream_codes/php/etc/VaiIb8.conf
/sbin/start-stop-daemon --start --quiet --pidfile /home/xtreamcodes/iptv_xtream_codes/php/JdlJXm.pid --exec /home/xtreamcodes/iptv_xtream_codes/php/sbin/php-fpm -- --daemonize --fpm-config /home/xtreamcodes/iptv_xtream_codes/php/etc/JdlJXm.conf
/sbin/start-stop-daemon --start --quiet --pidfile /home/xtreamcodes/iptv_xtream_codes/php/CWcfSP.pid --exec /home/xtreamcodes/iptv_xtream_codes/php/sbin/php-fpm -- --daemonize --fpm-config /home/xtreamcodes/iptv_xtream_codes/php/etc/CWcfSP.conf
sleep 3
/home/xtreamcodes/iptv_xtream_codes/nginx_rtmp/sbin/nginx_rtmp
sleep 1
/home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx
phpmyadmin fix for Ubuntu 18.04 and Xtream-UI

Login with default MySQL root user and password is not possible
Run as root:

Bash:
mysql -u root -p

type in your default root password

edit you root password

Bash:
mysql> show databases;
mysql> use mysql;
mysql> update user set authentication_string=PASSWORD("new_password") where user='root';
mysql> update user set plugin="mysql_native_password";
mysql> flush privileges;
mysql> quit;

replace new_password with your own password

restart mysql

Bash:
$ /etc/init.d/mysql restart;
Now it should be possible to login with default mysql root user and password.
Fix Bug phpMyAdmin and PHP 7.2: “Warning in ./libraries/sql.lib.php#613 count():

It’s possible that when you installed phpMyAdmin, the version in the repository (phpMyAdmin v4.6.6) was not fully compatible with PHP 7.2. There is a newer version available on the official website (v4.9 as of writing), which fixes these compatibility issues with PHP 7.2.

you can make a change to sql.lib.php to fix the error

Firstly, backup sql.lib.php before editing

PHP:
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak

Edit sql.lib.php in nano

Bash:
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php

Press CTRL + W and search for

Bash:
(count($analyzed_sql_results['select_expr'] == 1)

Replace it with

Bash:
((count($analyzed_sql_results['select_expr']) == 1)

Save file and exit. (Press CTRL + X, press Y and then press ENTER)

Leave a Reply

Your email address will not be published. Required fields are marked *