DXSpider is a great DX Cluster software that has a usefull telnet interface. I wrote this application in order to add a web user interface to DXSpider and show the spots collected. The user could see 50 spots at time and filter them by band, spotter continent and spotted continent.
You can find my web site at https://www.iu1bow.it
INSTALL
1) DXSpider First of all you have to installed [DXspider] (http://www.dxcluster.org/) and connected with some other cluster nodes.
2) MariaDB / MySQL
Then you have to install MariaDB on your web server, on the same server where DXSpider is running and configure DXSpider to use it: in your spider folder edit local/DXVars.pm
adding these lines:
# the SQL database DBI dsn
$dsn = "dbi:mysql:dxcluster:localhost:3306";
$dbuser = "your-user";
$dbpass = "your-password";
If you would change some MariaDB parameters, then you can find them in /etc/mysql/my.cnf
or /etc/my.cnf
, depending on your distro.
3) Python / Flask First of all you have to install the python3 pip installer
foo@bar:~$ sudo apt install python3-pip
This application is based on Flask To install Flask:
foo@bar:~$ pip3 install flask
or
foo@bar:~$ sudo -H pip3 install flask --system
Then you have to install mysql libraries**:
foo@bar:~$ pip3 install flask_mysqldb
or
foo@bar:~$ sudo -H pip3 install flask_mysqldb --system
Finally you have to install matplotlib in order to plots some graphics
foo@bar:~$ pip3 install matplotlib
or
foo@bar:~$ sudo -H pip3 install matplotlib --system
**CONFIGURATION
In the path spiderweb/cfg/
rename config.json.template
in config.json
:
foo@bar:~$ mv config.json.template config.json
then edit it and set the user and password of your database, the menu items, and other stuffs (callsign, mail address...). Othewhise, if you preferr, you could use an utility for edit your configuration and menu. Go in "script" folder and run ./config.sh
foo@bar:~$ cd scripts
foo@bar:~$ ./config.sh
*** DxSpider configuration ***
Configuration file loaded from: ../cfg/config.json
h: help
vc: view config.
ec: edit config.
vm: view menu
em: edit menu
s: save
t: load config. from template
x: exit
Make your choiche:
In order to show the right plots, you have to generate them! To do so you have to run .sh files inside scripts folders, or the better way is to schedule them with your crontab
foo@bar:~$ crontab -e
then edit it in a manner like this:
0 23 * * * /foo/bar/spiderweb/scripts/qso_months.sh > /dev/null 2>&1
*/15 * * * * /foo/bar/spiderweb/scripts/propagation_heatmaps.sh > /dev/null 2>&1
**TEST Now you can run your web application with the following command:
foo@bar:~$ python3 webapp.py
The flask default port is 5000, so you can see your web app, typing http://localhost:5000
in your web browser.
Keep in mind that the flask web server, usually is used as a test server.
**GO LIVE If your would run your application a production web server, install it on Gunicorn and NGINX (obviously you can choose your preferred proxy/web server instead). I'm also using certbot in order to manage SSL Let's encrypt certificates.
At this link (in italian language) you can find a guide for install certbot, gunicorn and NGINX After installed it you can configure
Search engine indexing When you are on-line, if you would to index your website on search engines, you have to generate a file named sitemap.xml and put it in /static/ folder. There are many tool to generate sitemap.xml, for example https://www.xml-sitemaps.com/
**Index on MySQL If you would to increase speed on callsign search, you could define some index on the table 'spot'. You can see more details on 'scripts/create_mysql_index.sql' ~