Skip to content

Installation ‐ Linux

HB9HIL edited this page Jul 27, 2024 · 2 revisions

This page will guide you through the steps required to install Wavelog onto a Linux web server that is using the LAMP stack (that's Linux, Apache, MySQL, and PHP). The specifics of your server setup can be largely up to you as there are various Linux distributions, for example. This guide will focus on Debian / Ubuntu so instructions given here may not apply to other distributions.

Prerequisites

  • Any modern Linux installation capable of supporting the other prerequisities.

    • Recommended:
    • Debian 11 or 12
    • Ubuntu 22.04
  • Web server (e.g. Apache >= 2.4 or nginx)

  • MySQL or MariaDB

  • PHP <= 8.2 plus modules:

    • php-curl
    • php-mbstring
    • php-mysql
    • php-xml
    • php-zip

Installation

1. Prepare LAMP Stack

Installing a suitable operating system, database server and web server are tasks that are outside the scope of this guide but there are plenty of resources to help you get started. Have a look at these guides from DigitalOcean to set up either Debian or Ubuntu LTS.

Once you have your LAMP stack installed, make sure that the required PHP modules are available as not all will be installed by default:

sudo apt install php-curl php-mysql php-mbstring php-xml php-zip

If you use Apache2 as Webserver you maybe need aswell

sudo apt install libapache2-mod-php

Use php -v to check the installed version. Minimum Version is PHP 7.4

Note: If you use nginx as web server you will need to make sure that the PHP handler does serve .php correctly and not only if the address ends on .php. See this issue. The basic change in the config is (remove the dollar sign):

 	# pass PHP scripts to FastCGI server
 	#
-	location ~ \.php$ {
+	location ~ \.php {

2. Download Wavelog using Git

For ease of installation and updating, it's recommended to acquire the Wavelog application files using Git. Git is most likely installed already on your Linux distribution. If not, use sudo apt-get install git to obtain it.

The git clone command is used to fetch the latest build of Wavelog from the repository on GitHub. This command downloads the application files in their current state on the master branch:

git clone https://github.com/wavelog/Wavelog.git [output_directory]

Replace output_directory with the full path to the directory where you'd like the application files to be created locally (don't include the square brackets). For example, if you configured Apache with a site that uses _/var/www/html as its DocumentRoot directory then the command becomes
git clone https://github.com/wavelog/Wavelog.git /var/www/html
Have a look at the Apache documentation for more information on site configuration.

3. Set Directory Ownership and Permissions

During normal operation, Wavelog will need to write to certain files and directories within the root Wavelog directory (i.e. where you extracted the files in the previous step). You'll need to set the permissions and ownership on these directories appropriately.

The following folders need to be writable by PHP:

  • /application/config/
  • /application/logs/
  • /backup/
  • /updates/
  • /uploads/
  • /images/eqsl_card_images/

Warning

The following commands assume that you are using the Ubuntu/Debian default www-data webserver group. You should verify this is the case - especially if you are using another distribution - and modify the commands below appropriately if it is something different.

Warning

Replace /var/www/html in the below command with the appropriate directory if you cloned the Git repository somewhere else in the previous step!

Warning

It is your responsibility to ensure you protect your system from intruders/attacks. These commands and permissions are just examples used to get Wavelog up and running and are not a guide on how to achieve a secure system. You should review these permissions after installation and make appropriate changes if you determine that finer-grained access control is needed.

Set the basic permissions (work in most cases). Don't forget to adjust the directory:

directory=/var/www/html
sudo chown -R www-data:www-data $directory
sudo find $directory -type d -exec chmod 755 {} \;
sudo find $directory -type f -exec chmod 664 {} \;

These permissions may differ on your setup!

4. Create a SQL Database and User

Wavelog needs a MySQL database to store application and user settings, along with user data such as logbooks.

The basic steps for creating a blank database are very similar for both MySQL and MariaDB - we'll cover those here - but the specific steps relating to securing your database and server will differ. As with the Apache configuration, those latter steps are outside the scope of this guide but you can refer to the MariaDB documentation or the MySQL documentation as a starting point.

Let's start by using the mysql command to connect as the root user. If your server is already configured for something else then you may have another user configured with the ability to create databases - you can substitute that username if so. Read more about connecting with the mysql client in the MySQL documentation.

sudo mysql -u root -p

Note

The mysql tool has the same name in both the MySQL and MariaDB packages.

Now issue the following command to create a database for Wavelog, replacing db_name with a name of your choice, e.g. wavelog. Note this name down as you'll need it later for the Wavelog install wizard.

CREATE DATABASE db_name;

Tip

If you already have a user in mysql. You don't need to create a database, as the Installer will do that for you.

Next, create a user and grant it privileges on the Wavelog database. Creating a new user is optional if you already have a valid non-root user on the MySQL/MariaDB server. Remember to again replace db_name with the name you chose previously for the database, user1 with the name of the user (e.g. waveloguser) to create and password1 with a real, strong password! Keep the username and password safe as you'll need these for the Wavelog installer later.

CREATE USER 'user1'@localhost IDENTIFIED BY 'password1';
GRANT ALL PRIVILEGES ON db_name.* TO 'user1'@'localhost';
QUIT

5. Run the Wavelog Installer

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

Post-Install Tasks

Create Cron Jobs to Automate Wavelog Tasks

You can use cron jobs to automate some of the regular Wavelog maintenance tasks. See Recommended Cron Jobs and Cronmanager for instructions.

After your first login you have to set up some things in Wavelog. Just follow the warnings on the dashboard.