XtreamUI: tutoriel & modifications
Table of Contents
Procédure d’installation (Ubuntu 18.04 recommandé pour MAIN Server)
As root:
apt-get update ; apt-get install libxslt1-dev libcurl3 libgeoip-dev python -y ; wget https://xtream-ui.com/install/install.py ; sudo python install.py
If you want a whole NEW installation, choose MAIN and then ADMIN.
If you want ONLY the admin part, select ADMIN only.
Sauvegarde de l’ancienne Base de données
DUMP Database (Backup)
On your OLD Server
Run as root:
mysqldump xtream_iptvpro > xtcdump.sql
Restauration de la base de données
RESTORE Database
Upload xtcdump.sql to your new server (It’s OK to use /root)
Run as root:
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:
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
Panel ne s’affiche pas après un reboot
I rebooted the server and the panel didn’t come back up
As root run:
/home/xtreamcodes/iptv_xtream_codes/start_services.sh
Comment avoir la liste m3u?
How to get m3u playlist?
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!
Erreurs libexslt.so.0 – geoip.so – libcurl
libexslt.so.0 – geoip.so – libcurl ERRORS
Run as root:
apt-get install libxslt1-dev libcurl3 libgeoip-dev
Comment trouver le password Mysql
How to find out user_iptvpro mysql password?
As root run:
wget https://raw.githubusercontent.com/xtreamui/XtreamUI/master/pytools/config.py && python config.py DECRYPT && rm config.py
Changer le port du Broadcast
How to change BROADCAST port from 25461 to another port?
Change NEWPORT to the port you want. Eg 8080
As root run:
sed -i 's/25461/NEWPORT/g' /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf ; /etc/init.d/xtreamcodes
Changer le port du Admin du panel
How to change ADMIN port from 25500 to another port?
Change NEWPORT to the port you want. Eg 8080
As root run:
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:
/home/xtreamcodes/iptv_xtream_codes/start_services.sh
Forcer le chargement de l’EPG
How to FORCE RELOAD EPG (If EPG empty on Apps and stuff)
/home/xtreamcodes/iptv_xtream_codes/php/bin/php /home/xtreamcodes/iptv_xtream_codes/crons/epg.php
Faire un update du panel à partir du GITHUB
How to update from GITHUB release?
As root run:
apt-get install unzip e2fsprogs python-paramiko -y && chattr -i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && rm -rf /home/xtreamcodes/iptv_xtream_codes/admin && rm -rf /home/xtreamcodes/iptv_xtream_codes/pytools && rm -rf /home/xtreamcodes/iptv_xtream_codes/adtools && wget https://github.com/xtreamui/XtreamUI/archive/master.zip -O /tmp/update.zip -o /dev/null && unzip /tmp/update.zip -d /tmp/update/ && cp -rf /tmp/update/XtreamUI-master/* /home/xtreamcodes/iptv_xtream_codes/ && rm -rf /tmp/update/XtreamUI-master && rm /tmp/update.zip && rm -rf /tmp/update && rm /home/xtreamcodes/iptv_xtream_codes/README.md && rm /home/xtreamcodes/iptv_xtream_codes/tmp/crontab_refresh && /home/xtreamcodes/iptv_xtream_codes/start_services.sh && chattr +i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb
Don’t forget to clear your browser cache
Utiliser Youtube dans le panel
How to use YouTube in the panel?
sudo su ; wget https://s3.us-east-2.amazonaws.com/firez.uploadanime.xyz/ytphp.sh -O "ytphp.sh" ; chmod u+x ytphp.sh ; ./ytphp.sh
Erreur lors de l’installation auto du LB
Errors AUTO Installing Load Balancers?
As root run on the LOAD BALANCE SERVER:
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.
Erreur 500
Fix 500 Errors on XC v2
As root run:
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 »
Trouver le Network Interface à utiliser dans l’admin UI
How to find out what Network Interface to use on your Admin UI
As root run:
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′ non trouvé
`CURL_OPENSSL_3′ not found fix
As root run:
apt-get remove --auto-remove libcurl4-openssl-dev
apt-get install libcurl3 -y
Erreur GeoLite2
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
/home/xtreamcodes/iptv_xtream_codes/start_services.sh
Script de demarrage
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
PhpMyadmin solution sur Ubuntu 18.04
phpmyadmin fix for Ubuntu 18.04 and Xtream-UI
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;
Now it should be possible to login with default mysql root user and password.
Fix Bug Phpmyadmin [plugin_interface.lib.php] + Php7.2
Warning in ./libraries/plugin_interface.lib.php#532
couse of phpmyadmin’s library try to count some parameter. At this line 532, I found this code in this path
PHP:
$ /usr/share/phpmyadmin/libraries/plugin_interface.lib.php
PHP:
if ($options != null && count($options) > 0) {
i think in new php version.It can’t use count() or sizeof() with un array type. Force parameter to array is easy way to solve this bug, Like This
PHP:
if ($options != null && count((array)$options) > 0) {
May this trick help your code.
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
(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)
In some cases mySQL root password doesn’t set although the Xtream-UI script asks during installation.
To set mySQL root password you can start the mySQL Secure installation Tool. Follow the setup wizzard instructions:
sudo mysql_secure_installation
or
sudo mysql -u root -p
Enter password: (press enter as no password is set)
after then can easily run query
Apache config:
ALTER USER 'root'@'localhost' IDENTIFIED BY '';
17B Import Streams Problem Fix
Do these things to fix it.
-edit
PHP:
nano /home/xtreamcodes/iptv_xtream_codes/admin/stream.php
-change
PHP:
$rArray[« custom_map »] = $_POST[« custom_map »];
-to
PHP:
if(isset($_POST["custom_map"])) {
$rArray["custom_map"] = $_POST["custom_map"];
} else{
$rArray["custom_map"] = 0;
}
Then Import Streams will work with R17b.
Autostart on Reboot (rc.local version)
nano /etc/rc.local
ADD this Script
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/xtreamcodes/iptv_xtream_codes/start_services.sh
exit 0
SAVE THE SCRIPT and Exit
and run
chmod +x /etc/rc.local
Autostart on Reboot (crontab version)
nano /etc/crontab
@reboot root /home/xtreamcodes/iptv_xtream_codes/start_services.sh
Effacer les journaux du panneau de la base de données MySQL
- Login to your main server via PuTTY using root as username and run following commands (pPASSWORD, replace PASSWORD with your own)
mysql -u root -pPASSWORD
use xtream_iptvpro;
TRUNCATE panel_logs;
TRUNCATE client_logs;
TRUNCATE stream_logs;
TRUNCATE epg_data;
exit
Clear Panel Logs with SQL query: 2eme méthode
PHP:
mysql --user=root --password=PASSHERE --database=xtream_iptvpro -s --execute="TRUNCATE client_logs;"
mysql --user=root --password=PASSHERE --database=xtream_iptvpro -s --execute="TRUNCATE user_activity;"
mysql --user=root --password=PASSHERE --database=xtream_iptvpro -s --execute="TRUNCATE stream_logs;"
change PASSHERE with your mySQL root password
XtreamUI as service
To run xtreamui at boot with Systemd init service,
you can add this code in /etc/init.d/xtreamcodes
PHP:
#
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: xtreamcodes
# Required-Start: $mysql $network
# Should-Start: $network $time
# Should-Stop: $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the xtreamcodes server daemon
# Description: Controls the main xtreamcodes server daemon
/home/xtreamcodes/iptv_xtream_codes/start_services.sh
after you change xtreamcodes init script, you have to run
systemctl enable xtreamcodes
after this xtreamui will start at boot, without need to be added in rc.local file
tested on Ubuntu 18.04
HIGH RAM FIX
hanks to kazzk0 @ xtream-ui.com
For many many days i have searched for a memory leak fix in ubuntu 18 .
Tonight i have found my solutions .
It was something to do about vm.happiness
I did nano
nano /etc/sysctl.conf
search for vm.happiness if it does not exists
add the line at the bottom !
PHP:
vm.happiness=100
( lower the value untill it fits your needings )
then
sudo sysctl --load=/etc/sysctl.conf
IT HELPED ME ALONG with lahasa fix
Bash:
apt-get install libjemalloc1
service mysql restart
Step 1.
nano /etc/mysql/my.cnf
PHP:
malloc-lib=/usr/lib64/libjemalloc.so.1
step 2. (add line enviroment)
nano /lib/systemd/system/mysql.service
Bash:
Environment=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1
Step 3.
now just restart mysql service with:
service mysql restart
My Ram Usage dropped from 12 -15 GB
to
4.9 GB maximum , with 60 streams online , it does not get higher , not getting lower . its between 4.7 and 4.9 max !
Xtream-UI Exploits Security Fix
Original Announcement from Xtream-UI
GTA has provide a script to fix the exploid:
https://github.com/xtreamui/XCFILES/blob/master/README.md
HOW TO USE:
Bash:
apt-get -y install python python-requests python-mysqldb
wget "https://raw.githubusercontent.com/xtreamui/XCFILES/master/check_hacks.py" -O /tmp/check_hacks.py
python /tmp/check_hacks.py
FİX: XtreamUI Page load take very long
A know XtreamUI issue is that over time the XtreamUI database will be flooded with logs which leads to big tables take very long to load.
You can automatically empty the logs from the Database at certain intervals.
MySQL EVENT Version fix
Connect to the XtreamUI Database
mysql -u root
Select the XtreamUI Database
use xtream_iptvpro;
Enable the SQL Event Scheduler
SET GLOBAL EVENT_SCHEDULER = ON;
Create the Events to Turncate (empty) the tables stream_logs, user_activity, client_logs every one hour. If you want empty the logs once per Day, just replace EVERY 1 HOUR with EVERY 1 DAY
CREATE EVENT delete_stream_logs ON SCHEDULE EVERY 1 HOUR STARTS NOW() DO TRUNCATE TABLE stream_logs;
CREATE EVENT delete_user_activity_logs ON SCHEDULE EVERY 1 HOUR STARTS NOW() DO TRUNCATE TABLE user_activity;
CREATE EVENT delete_client_logs_logs ON SCHEDULE EVERY 1 HOUR STARTS NOW() DO TRUNCATE TABLE client_logs;
You can list the created Events with:
SHOW EVENTS;
Removing Events
DROP EVENT delete_user_activity_logs;
Exit MySQL Session:
EXIT;
Change in use_https value to 1 directly in MySQL:
UPDATE xtream_iptvpro.settings SET use_https='1' WHERE id='1';