Skip to content
Paul Beesley edited this page Oct 11, 2020 · 65 revisions

Server Requirements

Your server setup is largely up to you and one element that you need to support yourself, however, Cloudlog needs:

  • PHP 7 or later
  • Following Modules: php-curl, php-mbstrings, php-mysql, php-xml, php-openssl

For example, on an Ubuntu or Debian system, you can use:

sudo apt-get install php7.3 php7.3-curl php7.3-mysql php7.3-mbstring php7.3-xml php7.3-openssl

If your distro supports a later version of PHP, you should use the highest version number available. This may be as simple as using "php7.5" instead of "php7.3" on the command above. If your linux distro only has compiled packages for older sub-versions, and you get an error using the command above, try replacing "7.3" with "7.0".

Note: Recent releases of Ubuntu - such as Ubuntu Server 20.04 LTS - no longer provide the php7.x-openssl package. In this case the OpenSSL functionality is compiled into the core PHP component already. You can confirm whether support is present after PHP installation using:

php -i | grep -i openssl

Download Cloudlog with Git

On the command line, you need to run git clone to fetch the latest build of Cloudlog. You may need to rename the file after cloning to make it work on your server, but that's your choice.

git clone https://github.com/magicbug/Cloudlog.git

Folder Write Privileges

This will depend on your operating system of choice, and with Cloudlog it's your responsibility to handle server tasks. The first step will be to find out what group Apache (or Nginx or the web server you use) belongs to. Regular Debian based distros use the group www-data. The following folders need to be writable by PHP:

  • /application/config/
  • /backup/
  • /updates/
  • /uploads/

E.g. Assuming you are using the Debian default /var/www/html/ folder and www-data as the webserver group, you should run

sudo chown -R root:www-data /var/www/html/application/config/

sudo chown -R root:www-data /var/www/html/backup/

sudo chown -R root:www-data /var/www/html/updates/

sudo chown -R root:www-data /var/www/html/uploads/

And then grant writeable permissions to the group to these folders with sudo chmod -R g+rw /var/www/html/uploads/ and repeat for all the other folders.

Note: It is your responsability to ensure you protect your system from intruders/attacks. These commands and permissions are mere examples (wiki) to get Cloudlog up and running, and not a guide on how to achieve a secure system.

More info about granting PHP write permissions can be read here

Create an empty SQL Database and a user to access that database

This will depend on the LAMP installation you have. As an example, if you have installed MariaDB you should start with: sudo mysql_secure_installation to secure a bit your installation More information in the official documentation Then

sudo mysql -u root -p

CREATE DATABASE db_name; db_name of your choice. This will go into the field "Database name" of the Install Wizard

CREATE USER 'user1'@localhost IDENTIFIED BY 'password1'; user1 and password1 of your choice and will go into "username" and "password" of the Install Wizard

GRANT ALL PRIVILEGES ON 'yourDB'.* TO 'user1'@localhost;

QUIT

Run the Install Wizard

You need to run the install wizard. At this point, please open <url-to-cloudlog>/install and follow the guide.

When you have completed the install wizard, do the following:

  • Create a new admin account (Admin Dropdown) and delete the demo account

  • Update Country Files (Admin Dropdown)

  • Create a station profile (Admin Dropdown) and set it as active

  • If you want to know if the person you're working uses LoTW, run: https://<URL-To-Cloudlog>/index.php/lotw/load_users. This is the initial run, but we'll run this every week from cron momentarily.

Create Bash Script

Create a bash file on the command line with nano cloudlog.sh, or your preferred editor.

Paste the following into the new file:

#!/bin/bash
cd <Full-Path-To-Cloudlog-Folder> && git pull

# Uncomment the following lines if you need to restore owner and group after git pull completes
# This assumes a Debian-style installation using the www-data group.
# Change the group name if required for your distro.
#chown -R root:www-data <Full-Path-To-Cloudlog-Folder>/application/config/
#chown -R root:www-data <Full-Path-To-Cloudlog-Folder>/backup/
#chown -R root:www-data <Full-Path-To-Cloudlog-Folder>/updates/
#chown -R root:www-data <Full-Path-To-Cloudlog-Folder>/uploads/

The full path should be an absolute path, relative to the root filesystem. Do not enter a relative path here.

Allow the bash file to be executed:

chmod +x cloudlog.sh

You can test it with ./cloudlog.sh

Create Cronjobs

Run crontab -e, then place the items below inside the file.

0 0 * * * /bin/bash -c "<Full-Path-To-Bash-Script>/cloudlog.sh"
0 */6 * * * curl --silent https://<URL-To-Cloudlog>/index.php/clublog/upload/<username-with-clublog-login> &>/dev/null
@weekly curl --silent https://<URL-To-Cloudlog>/index.php/lotw/load_users &>/dev/null
@weekly curl --silent https://<URL-To-Cloudlog>/index.php/update/update_clublog_scp &>/dev/null
*/2 * * * * curl --silent https://<URL-To-Cloudlog>/index.php/qrz/upload/ &>/dev/null
0 */1 * * * curl --silent https://<URL-To-Cloudlog>/index.php/lotw/lotw_upload &>/dev/null

These periodic tasks complete the following jobs for Cloudlog:

  • Update Cloudlog at midnight every day
  • Sync to Clublog every 6 hours (you could reduce this amount of time, but this function is not using Club Log's realtime API, so keep it sensible)
  • Update the LoTW active user's database table every week.
  • Downloads the Club Log SCP file.

Callbook Integration

Cloudlog supports two amateur radio callbooks, these being QRZ and HamQTH both setups are similar and require you to edit the application/config/config.php file.

Make sure your username and password is the password you use to login to either service.

QRZ

$config['callbook'] = "qrz";
$config['qrz_username'] = "";
$config['qrz_password'] = "";

HamQTH

$config['callbook'] = "hamqth";
$config['hamqth_username'] = "";
$config['hamqth_password'] = "";

You can find more information on callbook integration at https://github.com/magicbug/Cloudlog/wiki/Callsign-Lookup

Clone this wiki locally