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:
ulimit -u
if it was 1024 then we need to increase it as follow
nano /etc/security/limits.conf
add the following lines to the end of your file:
* 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)
nano /etc/sysctl.conf
add the following lines to the end of your file:
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:
sudo sysctl -p
4. Reboot your server and check it now !
after reboot, run these commands again to verify your changes:
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.
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:
sudo mysql -u root
Now copy & past following commands:
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
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’;
As root run:
apt-get remove --auto-remove libcurl4-openssl-dev
apt-get install libcurl3 -y
Fix GeoLite2 permission
As root run:
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)
#! /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
Login with default MySQL root user and password is not possible
Run as root:
mysql -u root -p
type in your default root password
edit you root password
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
$ /etc/init.d/mysql restart;
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
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
Edit sql.lib.php in nano
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
Press CTRL + W and search for
(count($analyzed_sql_results['select_expr'] == 1)
Replace it with
((count($analyzed_sql_results['select_expr']) == 1)
Save file and exit. (Press CTRL + X, press Y and then press ENTER)