Welcome to World of IPTV

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Forum Rules

Our Rules: Read to avoid getting banned!

Advertising

Introduce Yourself to the World with Us!

Resource Database

Find the newest resources around IPTV!

Account upgrade

Upgrade your account to unlock more benefits!

Tutorial Xtream-UI HowTo's

Status
Not open for further replies.

redhat

Administrator
Staff member
Administrator
Joined
Jun 19, 2019
Messages
3,299
Reaction score
15,898
Points
134
Location
root[@]woi
Thanks to official Xtream-UI @Firez, @urgodfather, and Discord User: Shin


How to INSTALL (Ubuntu 18.04 recommended for MAIN)

As root:
Bash:
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.


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?

Code:
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



How to update from GITHUB release?

As root run:
Bash:
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
 
Last edited by a moderator:
How to use YouTube in the panel?

As root run:
Bash:
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


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
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
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 [plugin_interface.lib.php] + Php7.2

Warning in ./libraries/plugin_interface.lib.php#532

518

couse of phpmyadmin’s library try to count some parameter. At this line 532, I found this code in this path

Code:
$ /usr/share/phpmyadmin/libraries/plugin_interface.lib.php

1*xTR1npKmfPbhAh571d3YWw.png


Code:
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

Code:
if ($options != null && count((array)$options) > 0) {

1*TCU-qBQZ_s3VR5oC763coQ.png


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

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)
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
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:

Bash:
sudo mysql_secure_installation

or

Bash:
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 '<password>';

replace <password> with your own password
 
Last edited:
17B Import Streams Problem Fix, thanks to @malaquias

Do these things to fix it.

-edit

Code:
nano /home/xtreamcodes/iptv_xtream_codes/admin/stream.php


-change

Code:
$rArray["custom_map"] = $_POST["custom_map"];


-to

Code:
if(isset($_POST["custom_map"])) {
$rArray["custom_map"] = $_POST["custom_map"];
} else{
$rArray["custom_map"] = 0;
}


Then Import Streams will work with R17b.
 
Last edited:
17B Import Streams Problem Fix, thanks to @iptvci

Do these things to fix it.

-edit

Code:
nano /home/xtreamcodes/iptv_xtream_codes/admin/stream.php


-change

Code:
$rArray["custom_map"] = $_POST["custom_map"];


-to

Code:
if(isset($_POST["custom_map"])) {
$rArray["custom_map"] = $_POST["custom_map"];
} else{
$rArray["custom_map"] = 0;
}


Then Import Streams will work with R17b.
lol that modification on stream.php was made by me btw .. lol
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
Autostart on Reboot (rc.local version)

Bash:
nano /etc/rc.local

ADD this Script

Code:
#!/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 SCRIP and Exit

and run
Bash:
chmod +x /etc/rc.local



Autostart on Reboot (crontab version)

Bash:
nano /etc/crontab
@reboot root /home/xtreamcodes/iptv_xtream_codes/start_services.sh
 
Clear Panel Logs with SQL query
Code:
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
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
XtreamUI as service thanks to @castaway

To run xtreamui at boot with Systemd init service,
you can add this code in /etc/init.d/xtreamcodes

Code:
#
#!/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

thanks 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

Bash:
nano /etc/sysctl.conf

search for vm.happiness if it does not exists


add the line at the bottom !

Code:
vm.happiness=100

( lower the value untill it fits your needings )

then
Bash:
sudo sysctl --load=/etc/sysctl.conf


IT HELPED ME ALONG with lahasa fix

Bash:
apt-get install libjemalloc1
service mysql restart


Step 1.
Bash:
nano /etc/mysql/my.cnf


Code:
malloc-lib=/usr/lib64/libjemalloc.so.1


step 2. (add line enviroment)

Bash:
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:
Bash:
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

1591683136292.png


GTA has provide a script to fix the exploid:

Experimental tool to remove any hacks and exploits from your server, change your MySQL password and secure your MySQL installation from the outside world. There is one step it cannot fully perform, and that is removing any duplicates of "xtreamcodes" from /etc/sudoers on your load balancers. It will alert you of the line's presence, you'll have to remove it yourself.


If the tool finds anything, make sure to reboot that server afterwards.


In order to use the MySQL secure section, you will need to know your MySQL root password.

WHAT IT DOES:

  • Removes any infected files in the known file database.
  • Removes any infected NGINX files from the server.
  • Checks /etc/sudoers for escalated privileges.
  • Checks to make sure xtreamcodes user has no password.
  • Checks exploits in start_services.sh and removes them.
  • Checks access to MySQL server from the outside world.
  • Change xtreamcodes MySQL password if compromised, randomly generated.
  • Updates config files with new password on remote load balancers.
  • Secures MySQL installation and only allows access to the load balancers.
  • Edit rAddHosts array to add your own IP's to the MySQL whitelist (advanced).
HOW TO USE:

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

NOTES:

You may get false positives. If it says it found some files but you see "MAIN" and "FETCH" found in the NGINX section, then that means it didn't have access to your LB.. which shouldn't happen. Check to make sure the main server has access to the load balancers.


The script may detect that the user xtreamcodes has a password on your load balancer, if this is the case it will try to delete the password. It may not be allowed to do that however, if that's the case you'll need to SSH into that load balancer and run the following:


sudo passwd -d xtreamcodes && sudo usermod -s /usr/sbin/nologin xtreamcodes


While you're in there, check /etc/sudoers for any extra lines after the first xtreamcodes entry. If it has something like the below, delete that line, save and reboot.


xtreamcodes ALL=(ALL:ALL) NOPASSWD:ALL



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
 
Last edited:
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
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

Code:
mysql -u root


Select the XtreamUI Database

Code:
use xtream_iptvpro;


Enable the SQL Event Scheduler

Code:
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


Code:
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:
Code:
SHOW EVENTS;

CUQ41j.jpg



Removing Events

Code:
DROP EVENT delete_user_activity_logs;


Exit MySQL Session:

Code:
EXIT;
 
Change in use_https value to 1 directly in MySQL:

Code:
UPDATE xtream_iptvpro.settings SET use_https='1' WHERE id='1';
 
Status
Not open for further replies.
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top