Xtream UI Tips, FAQ’s and Fixes

Gizmo

Well-known member
Joined
Jun 8, 2021
Messages
524
Awards
4
Offline

Xtream UI Tips, FAQ’s and Fixes​

Let’s try helping each other to setup and understand Xtream UI better way.
Quick Jump Links!

How to install Xtream UI Admin Panel?​

Installation of Xtream UI admin panel is bit longer step thing, we’ve a dedicated guide on this you can read it here

How to change http broadcast port for Main or Loadbalancer?​

sed -i 's/25461/8080/g' /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf ; /etc/init.d/xtreamcodes
And then run this command: /home/xtreamcodes/iptv_xtream_codes/start_services.sh
This command will change any word matching to 25461 to 8080 in the file /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf
Important! Before changing the http broadcast port, go to Manage Servers > edit the server you’re changing port of > Advance Tab> edit the broadcast port and replace default one to the new you’re about to change and save it. Then you can run above command to change the port.

How to change admin port for Main or Loadbalancer?​

sed -i 's/25500/2083/g' /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf ; /etc/init.d/xtreamcodes
And then run this command: /home/xtreamcodes/iptv_xtream_codes/start_services.sh
This command will change any word matching to 25500 to 2083 in the file /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf
Now you’re admin panel port changed to the new one which is :2083 . You can choose any port you want.

How To Add / Install New Loadbalancer?​

By default auto installation of loadbalancer will not work (mostly). So, if you’ve already added new loadbalancer as installation and not coming online since long; you need to delete it.
Now, login main server via PuTTY as root and run following 2 commands:
sed -i 's/xtream-ui.com/lofertech.com/g' /home/xtreamcodes/iptv_xtream_codes/pytools/balancer.py ; /etc/init.d/xtreamcodes
/home/xtreamcodes/iptv_xtream_codes/start_services.sh
Now go to Load Balancer Installation, add correct IP of new loadbalancer server and root password (if root isn;t enabled read this guide) and click on it. Now go to Manage Servers page and reload it to see change, LB should be online within few minutes.
You can read a detailed guide on installing loadbancer on Xtream UI .

How to fix/ignore GeoLite2.mmdb warning?​

Pls run following command to fix this warning:
sed -i 's|chown -R xtreamcodes:xtreamcodes /home/xtreamcodes|chown -R xtreamcodes:xtreamcodes /home/xtreamcodes 2>/dev/null|g' /home/xtreamcodes/iptv_xtream_codes/start_services.sh

How to change main server?​

First of all we need to take important backups.
  1. Go to manage servers page, edit main server and add your new server ip and save it. Never run start_services.sh or any other command.
  2. Go to settings ==> Backups ==> Create New backup
  3. Now login to your main server ssh via WinSCP and go to /home/xtreamcodes/iptv_xtream_codes/adtools/backups and download your latest backup locally.
  4. Now download this file locally from your main server and all your LBs /home/xtreamcodes/iptv_xtream_codes/nginx/conf/ngix.conf
  5. Now as our main server has now new IP and MySQL password, get main server MySQL password then run this command one by one on each LB to update IP and MySQL Pass wget https://raw.githubusercontent.com/shinctl/XtreamUI/master/pytools/config.py && python config.py ENCRYPT
If still failing or need detailed guide, visit this link.

Clearing Panel Logs from MySQL database.​

  1. Login to your main server via PuTTY using root as username and run following commands (pPASSWORD, replace PASSWORD with your own)
  2. mysql -u root -pPASSWORD
  3. use xtream_iptvpro;
  4. TRUNCATE panel_logs;
  5. TRUNCATE client_logs;
  6. TRUNCATE stream_logs;
  7. TRUNCATE epg_data;
  8. exit

Fixing M3U list import not working:​

  1. Run Command: sudo /etc/init.d/mysql restart
  2. Run Command: /home/xtreamcodes/iptv_xtream_codes/start_services.sh

Setting up correct order of playlists (like first m3u, then m3u_plus):​

Pls run following commands to get this done:
wget https://lofertech.com/xui/xc_sorted_devices.sql
sudo mysql -u root xtream_iptvpro < /root/xc_sorted_devices.sql
Getting main server MySQL password:
Pls run following command to get your MySQL password.
python /home/xtreamcodes/iptv_xtream_codes/pytools/config.py DECRYPT
OR following
cp -rf /home/xtreamcodes/iptv_xtream_codes/pytools/config.py /root && python config.py DECRYPT && rm -rf /root/config.py && rm -rf /root/install.py

Testing and reloading Ngix upon editing or making changes into the file:​

sudo /home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx -t
sudo /home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx -s reload

How to exclude some characters from your line’s random username or passwords?​

We need to make changes to function.php file. The file is bit long and is better to edit it with WinSCP or use following command to keep with PuTTY.
nano /home/xtreamcodes/iptv_xtream_codes/admin/function.php
Go to line 480 and try finding function generateString($strength = 10) and to the next line is $input = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
So in $input = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; remove all unwanted and save it.

Fixing error 500 on Xtream UI admin:​

There are many reason of this error, we;ll try applying max we can. Run following commands one by one and keep checking things if start working.
apt-get install unzip e2fsprogs python-paramiko -y && rm -rf /home/xtreamcodes/iptv_xtream_codes/admin && rm -rf /home/xtreamcodes/iptv_xtream_codes/pytools && wget “https://lofertech.com/xui/update.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/
After this must run following commands:
rm -rf /tmp/update/XtreamUI-master && rm /tmp/update.zip && rm -rf /tmp/update && sudo chmod +x /home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx && sudo chmod +x /home/xtreamcodes/iptv_xtream_codes/nginx_rtmp/sbin/nginx_rtmp && chattr +i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && /home/xtreamcodes/iptv_xtream_codes/start_services.sh
OR
cd /home/xtreamcodes/iptv_xtream_codes/crons/ && sudo chattr -i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && sudo wget https://lofertech.com/xui/GeoLite2.mmdb && sudo chattr +i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && sudo /home/xtreamcodes/iptv_xtream_codes/start_services.sh
Now try reloading panel or line if all fine there or if not PuTTY must shown you the error on terminal, try searching relevant issues on this site and apply fixes or comment bellow.

Admin not logging after restoring database or resetting admin password.​

Run following commands on main server and try logging again.
mysql
use xtream_iptvpro
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';
Now try logging using user and pass as admin admin

With this i tried sharing the most common issues fixes and hope you liked them.
 

jebon

Well-known member
Joined
May 23, 2021
Messages
114
Awards
3
Offline
how to disable reseller change customer username ?
 
Top