User Tools

Site Tools


ysf:welcome

This is an old revision of the document!


YSF Cloud Reflector 14.11.21

GB7SV YSF Cloud Reflector and Web Dashboard (Status and last stations heard)

Network and Hardware Setup

Based on https://cloud.oracle.com/?tile=free-apache-ubuntu-vm&region=uk-london-1

Virtual Cloud Network configuration

Setup compute instance

Web Server Setup

# Copy down private key, store and set security on it
cd keys
sudo chmod 60 ssh-key-2021-10-31.key
# ssh on to cloud instance
ssh -i ./keys/ssh-key-2021-10-31.key ubuntu@150.230.115.225

sudo apt update
sudo apt full-upgrade
sudo apt install apache2 -y
sudo usermod -G www-data -a ubuntu
sudo usermod -G www-data -a root
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 775 /var/www/html
sudo apt install php7.4-common php7.4-cgi php7.4 -y
sudo apt install libapache2-mod-php7.4 -y
sudo nano /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
sudo nano /etc/apache2/ports.conf

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
sudo systemctl restart apache2

Update firewall rules 42002 Reflector and 80 Web Dashboard

sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 42002 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 42002 -j ACCEPT
sudo netfilter-persistent save

Check firewall rules

sudo iptables -S

YSF Reflector Service Setup

Based on https://github.com/iu5jae/pYSFReflector

git clone git://github.com/iu5jae/pYSFReflector.git
cd pYSFReflector/systemd
sudo cp YSFReflector.service /etc/systemd/system

sudo systemctl enable YSFReflector.service
sudo mkdir /var/log/YSFReflector

sudo groupadd mmdvm
sudo useradd mmdvm -g mmdvm -s /sbin/nologin
sudo chown -R mmdvm:mmdvm /var/log/YSFReflector

cd ..
sudo cp YSFReflector  /usr/local/bin
sudo mkdir /etc/YSFReflector
sudo cp YSFReflector.ini  /etc/YSFReflector/YSFReflector.ini
sudo cp deny.db /usr/local/etc

YSFReflector.service (For reference)

 
[Unit]
Description=YSFReflector
After=network.target

[Service]
ExecStartPre=/bin/sleep 1
Type=simple
User=mmdvm
Group=mmdvm
Restart=always
# Modify for different location of Python3 or location of files
ExecStart=/usr/bin/python3 /usr/local/bin/YSFReflector /etc/YSFReflector/YSFReflector.ini

[Install]
WantedBy=multi-user.target

Setup ensuring config files are correctly placed

sudo nano /etc/YSFReflector/YSFReflector.ini

Name=GB-GB7SV
Description=www.GB7SV.com

and

#Set this to 0 to have full logging capabilities, 1 for normal log and 2 for ve$
FileLevel=1
FilePath=/var/log/YSFReflector/
FileRoot=YSFReflector
# Set this to 0 and configure systems logrotate to do the job with a single log$
FileRotate=1
# Enable = 1 or disable = 0 the extended command set
EnableExtendedCommands=0

[Network]
Port=42002

Changed Reflector config file

sudo systemctl daemon-reload

Reflector Status

sudo systemctl status YSFReflector.service

Reflector Restart

sudo systemctl restart YSFReflector.service

YSF Reflector Web Dashboard Setup

Based on https://qso365.co.uk/2020/02/how-to-set-up-a-yaesu-system-fusion-reflector-ysfreflector/

Using https://github.com/dg9vh/YSFReflector-Dashboard

cd ~
sudo git clone https://github.com/dg9vh/YSFReflector-Dashboard.git
sudo cp -R ./YSFReflector-Dashboard/* /var/www/html/

Configure YSF Reflector Web Dashboard

http://150.230.115.225:8900/setup.php

Configuration as per file config.php

date_default_timezone_set('UTC');
define("YSFREFLECTORLOGPATH", "/var/log/YSFReflector");
define("YSFREFLECTORLOGPREFIX", "YSFReflector");
define("YSFREFLECTORINIPATH", "/etc/YSFReflector/");
define("YSFREFLECTORINIFILENAME", "YSFReflector.ini");
define("YSFREFLECTORPATH", "/usr/local/bin/");
define("TIMEZONE", "Europe/London");
define("LOGO", "");
define("REFRESHAFTER", "60");
define("SHOWOLDMHEARD", "60");
define("TEMPERATUREHIGHLEVEL", "60");

Remove Setup.php

sudo rm /var/www/html/setup.php

Register Reflector https://register.ysfreflector.de

YSF Reflector Web Dashboard Configuration Notes

Apache, Ports, Reflector and dashboard configuration files

sudo nano /etc/apache2/sites-enabled/000-default.conf
sudo nano /etc/apache2/ports.conf
sudo nano /etc/YSFReflector/YSFReflector.ini
sudo nano /var/www/html/config/config.php

Web Dashboard Issues

internal 500 error PHP timeout where code is processing log. Web dashboard frozen. Caused by PHP script errors, code sadly no longer maintained. Work round - Delete the logs and restart apache service.

nano /var/log/apache2/error.log
[Sun Jul 11 00:03:00.953894 2021] [php7:notice] [pid 29690] [client 192.168.0.4:49337] PHP Notice:  A non well formed numeric value encountered in /var/www/html/include/sysinfo.php on line 96, referer: ht$
$er: http://192.168.0.100:8900/
[Wed Jul 14 05:22:14.638807 2021] [php7:notice] [pid 25132] [client 114.23.212.119:56754] PHP Notice:  A non well formed numeric value encountered in /var/www/html/include/sysinfo.php on line 96, referer: http://gb7sv.duckdns.org:8900/
[Wed Jul 14 05:23:17.695948 2021] [php7:notice] [pid 26313] [client 114.23.212.119:62027] PHP Notice:  A non well formed numeric value encountered in /var/www/html/include/sysinfo.php on line 96, referer: http://gb7sv.duckdns.org:8900/
[Wed Jul 14 05:23:17.696143 2021] [php7:notice] [pid 26313] [client 114.23.212.119:62027] PHP Notice:  A non well formed numeric value encountered in /var/www/html/include/sysinfo.php on line 96, referer: http://gb7sv.duckdns.org:8900/
[Wed Jul 14 05:24:20.787588 2021] [php7:notice] [pid 25129] [client 114.23.212.119:53648] PHP Notice:  A non well formed numeric value encountered in /var/www/html/include/sysinfo.php on line 96, referer: http://gb7sv.duckdns.org:8900/
[Wed Jul 14 05:24:20.787788 2021] [php7:notice] [pid 25129] [client 114.23.212.119:53648] PHP Notice:  A non well formed numeric value encountered in /var/www/html/include/sysinfo.php on line 96, referer: http://gb7sv.duckdns.org:8900/
[Wed Jul 14 05:25:23.844868 2021] [php7:notice] [pid 25132] [client 114.23.212.119:51296] PHP Notice:  A non well formed numeric value encountered in /var/www/html/include/sysinfo.php on line 96, referer: http://gb7sv.duckdns.org:8900/
PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 193
[Wed Nov 03 15:43:42.037962 2021] [php7:error] [pid 12372] [client 82.27.122.60:33026] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 193
[Wed Nov 03 16:07:21.008009 2021] [php7:error] [pid 10435] [client 82.27.122.60:33672] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 191
[Wed Nov 03 16:08:02.657894 2021] [php7:error] [pid 10438] [client 82.27.122.60:33684] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 189
[Wed Nov 03 16:12:03.817933 2021] [php7:error] [pid 12372] [client 192.168.0.12:35070] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 189
[Wed Nov 03 16:12:27.147982 2021] [php7:error] [pid 10434] [client 192.168.0.12:35072] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 189
[Wed Nov 03 16:13:50.348007 2021] [php7:error] [pid 13257] [client 192.168.0.3:60337] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 195
[Wed Nov 03 16:14:15.717954 2021] [php7:error] [pid 10436] [client 192.168.0.3:60342] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 189
[Wed Nov 03 16:20:46.167922 2021] [php7:error] [pid 10438] [client 192.168.0.3:60385] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 189
[Wed Nov 03 16:22:54.967884 2021] [mpm_prefork:notice] [pid 548] AH00169: caught SIGTERM, shutting down
[Wed Nov 03 16:22:55.630151 2021] [mpm_prefork:notice] [pid 13386] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations
[Wed Nov 03 16:22:55.630486 2021] [core:notice] [pid 13386] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 03 16:23:41.877915 2021] [php7:error] [pid 13387] [client 192.168.0.12:35308] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 195
[Wed Nov 03 16:23:59.437952 2021] [php7:error] [pid 13388] [client 192.168.0.3:60396] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 189
[Wed Nov 03 16:24:29.547913 2021] [php7:error] [pid 13389] [client 192.168.0.12:35310] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/include/functions.php on line 196
cd /var/log/YSFReflector
sudo rm *.* # to remove logs
sudo systemctl restart apache2.service

Reflector Issues

Changed Reflector config file

sudo systemctl daemon-reload

Stuck Reflector

No longer possible to connect. Reflector service has hung and auto restart failed

sudo systemctl status YSFReflector.service
 
● YSFReflector.service - YSFReflector
   Loaded: loaded (/etc/systemd/system/YSFReflector.service; enabled; vendor pre
   Active: active (running) since Thu 2021-06-24 19:34:21 BST; 2 days ago
  Process: 530 ExecStartPre=/bin/sleep 1 (code=exited, status=0/SUCCESS)
 Main PID: 545 (python3)
    Tasks: 7 (limit: 2062)
   CGroup: /system.slice/YSFReflector.service
           └─545 /usr/bin/python3 /usr/local/bin/YSFReflector /etc/YSFReflector/
Jun 24 19:34:20 GB7SVReflector systemd[1]: Starting YSFReflector...
Jun 24 19:34:21 GB7SVReflector systemd[1]: Started YSFReflector.
Jun 27 10:56:28 GB7SVReflector python3[545]: Starting pYSFReflector-20210512

To Restart

sudo systemctl restart YSFReflector.service
 
pi@GB7SVReflector:~ $ sudo systemctl status YSFReflector.service
● YSFReflector.service - YSFReflector
   Loaded: loaded (/etc/systemd/system/YSFReflector.service; enabled; vendor pre
   Active: active (running) since Sun 2021-06-27 11:36:45 BST; 14min ago
  Process: 8578 ExecStartPre=/bin/sleep 1 (code=exited, status=0/SUCCESS)
 Main PID: 8583 (python3)
    Tasks: 7 (limit: 2062)
   CGroup: /system.slice/YSFReflector.service
           └─8583 /usr/bin/python3 /usr/local/bin/YSFReflector /etc/YSFReflector

Jun 27 11:36:44 GB7SVReflector systemd[1]: Starting YSFReflector...
Jun 27 11:36:45 GB7SVReflector systemd[1]: Started YSFReflector.

Logon and select “update” to ensure Reflector entry is activated https://register.ysfreflector.de

ysf/welcome.1636933867.txt.gz · Last modified: by nicolas