digital
Host A YSF DMR DSTAR C4FM Multi-mode Reflector On Ubuntu 22.04 or Debian 12 with XLX

Host A YSF DMR DSTAR C4FM Multi-mode Reflector On Ubuntu 22.04 or Debian 12 with XLX

A few years ago, I was frustrated in my research for getting a YSF reflector up and running so I wrote this guide on getting a YSF Reflector running on Debian 10. Now here we are a few years later, and that’s basically obsolete. There’s a new (actually kind of old) kid on the block called XLX. XLX is a multi-mode/multi-protocol gateway reflector for amateur radio digital modes. It will do DMR, C4FM, Dstar, and supports various linking protocols. But, their official documentation is now 5 years old without updates, which you can find here if curious. N5AMD created a handy install script, and some documentation here, but it is now 1+ year old (and written for Debian 9) without any updates and installs vulnerable versions of php.

xlx multimode reflector

Prerequisites

  • Ubuntu 22.04 Server or Debian 12
    I recommend Linode as a cloud server for this, as I’ve been running my reflectors for years with them for $5 a month.
    If you use this referal link, you get $100 account credit after adding a payment method.
  • Logged in as Root.
  • A Fully Qualified Domain Name
  • Pick a 3 digit number that is not already listed on https://xlx.n5amd.com/index.php?show=reflectors your reflector name will be “XLX000” Where the three 0’s are replaced by the number you picked out.

Creating a new User

We are going to create a super user to use for the rest of this guide.
Remember to be logged in as root for this part.
Replace “kn4mkb” with your desired username below:

apt update -y
apt-get install sudo
adduser kn4mkb

You can press enter to skip the questions asked (besides password creation), but make sure to answer “y” when asked if the information is correct.

Now we will add this user to the “sudo” group so we can use root commands.
Remember to replace “kn4mkb” with the user you created above.

usermod -aG sudo kn4mkb

We will now swap over from root to our newly created user. This will be the user we use for the rest of this guide. No Longer root. (Replace “kn4mkb” with your new user)

su kn4mkb
cd ~

Installing Software Requirements (and a firewall)

Here will go ahead and take care of any dependencies we will need to get our reflector up and running. Some of these php modules may not be needed. But It’s a small attempt to future proof / handle unforeseen issues.

sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt install git git-core apache2 php libapache2-mod-php php-cli php-xml php-mbstring php-curl build-essential ufw -y

Downloading and Configuring XLX

We will now download the XLX reflector source from GitHub, make some modifications, and then compile it.

git clone https://github.com/LX3JL/xlxd.git
cd xlxd/src/
nano main.h

This will open a file for editing.
Find the line that reads:

#define YSF_AUTOLINK_ENABLE             0

Change the 0 to a 1, so that it looks like this:

#define YSF_AUTOLINK_ENABLE             1

Press Ctrl + X to save the file.

Compile The XLX Reflector Source Code

Run the Following Commands to compile the source, install the reflector and make the binary executable.

make clean
make
sudo make install
sudo chmod +x /xlxd/xlxd

Configure The Server and Create Auto-Start Script

Copy the startup template to /etc/init.d/xlxd, and edit the script.

sudo cp ~/xlxd/scripts/xlxd /etc/init.d/xlxd
sudo nano /etc/init.d/xlxd

Find the line :

ARGUMENTS="XLX999 192.168.1.240 127.0.0.1"

Replace “999” with the three digit number you found in the prerequisites.
Replace “192.168.1.240” with your servers PUBLIC IP ADDRESS.
Replace 127.0.0.1 with your dedicated trans-coding server (if you have one). Otherwise, leave it as 127.0.0.1

Press Ctrl +X to save.

Download the DMRID Database

sudo wget -O /xlxd/dmrid.dat http://xlxapi.rlx.lu/api/exportdmr.php

Setup the service to auto-start

sudo update-rc.d xlxd defaults

Copy the Dashboard to the apache web-server directory

sudo cp -r ~/xlxd/dashboard /var/www/xlxd

Edit the Reflector Dashboard Configuration

To edit the dashboard configuration, use the following command:

sudo nano /var/www/xlxd/pgs/config.inc.php

Change the following Lines for page Metadata, as well as to provide a good contact email.

$PageOptions['ContactEmail']
$PageOptions['MetaDescription']
$PageOptions['MetaAuthor']

Change these settings for XLX Reflector Reporting:
$CallingHome[‘Active’] Must be set to “true” in order for your reflector to show up on public lists and host files!
$CallingHome[‘MyDashBoardURL’] Should be the Fully Qualified Domain Name pointed to your server.
Such as “xlx.yourwebsite.org”
$CallingHome[‘Country’] Should be your countries abbreviation, such as “USA”
$CallingHome[‘Comment’] Can be a small comment that will show up on XLX Server Lists
$CallingHome[‘HashFile’] Need to be changed to: “/xlxd/callinghome.php”

Press Ctrl +x to save

Modify Privileges of our dashboard file, as well as the folder that will house our “callinghome.php” file. This file will be created in a moment once re start our services. It is going to be the file the verifies that the reflector if yours. From what I see, there is basically zero documentation on how this can be used if you actually need it to move servers though.

sudo chown -R www-data:www-data /var/www/xlxd/
sudo chown -R www-data:www-data /xlxd/

Create the Web-server Configuration File

We will now create our web server configuration file. Please replace the “yourdhashdomain.com” with your fully qualified domain name.

sudo nano /etc/apache2/sites-available/yourdhashdomain.com.conf

Enter or Copy + Paste the following into the new file (again changing “yourdhashdomain.com” to your fully qualified domain name) :

<VirtualHost *:80>
     ServerName yourdhashdomain.com
     DocumentRoot /var/www/xlxd
</VirtualHost>

Press Ctrl +X to Save

Open The Ports

This will open all of ports required for all of the digital modes as well as the webserver and ssh. If you have ip-tables installed, (some distros come with it) copy and paste these commands. If you don’t know, it doesn’t hurt to run them.

sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 10001 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 10002 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 42000 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 30001 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 20001 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 30051 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 8880 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 62030 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 10100 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 10101 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 12345 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 12346 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 40000 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 21110 -j ACCEPT

Copy and Paste these to open the ports on our installed firewall.

sudo ufw allow 80
sudo ufw allow 8080
sudo ufw allow 10001
sudo ufw allow 10002
sudo ufw allow 42000
sudo ufw allow 30001
sudo ufw allow 20001
sudo ufw allow 30051
sudo ufw allow 8880
sudo ufw allow 62030
sudo ufw allow 10100
sudo ufw allow 12345
sudo ufw allow 12346
sudo ufw allow 40000
sudo ufw allow 21110

Start the Server

We can now finally start the server to see the fruits of our labor.
Again, replace yourdashdomain.com with own.

sudo a2ensite yourdhashdomain.com
sudo systemctl reload apache2
sudo service xlxd start
sudo chown -R www-data:www-data /var/log/xlxd.xml
sudo systemctl restart apache2

You should now be able to navigate to http://yourdashdomain.com and see your new XLX Dashboard. In time, your PI-star hosts file will populate with your new reflector as XLX000, where 000 is the three digits you chose in the beginning.

Consider Subscribing!

Signup for our once a month newsletter!

We don’t spam! Read our privacy policy for more info.

1 thought on “Host A YSF DMR DSTAR C4FM Multi-mode Reflector On Ubuntu 22.04 or Debian 12 with XLX

Leave a Reply

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