How to Install Mahara on Fedora CoreOS Latest

Mahara is a modern, open-source e-portfolio software that allows users to create and share their learning achievements. In this tutorial, we will go over the steps to install Mahara on Fedora CoreOS Latest.

Prerequisites

Before starting with the installation process, ensure that you have the following prerequisites:

Step 1: Install Required Packages

First, update the system packages by running the following command:

sudo dnf update

Next, install the required packages for Mahara:

sudo dnf install -y nginx mariadb mariadb-server php-fpm php-mysqlnd php-gd php-zip unzip wget

Step 2: Configure MariaDB

MariaDB is an open-source database management system. We will be using it to store Mahara data. Follow the below steps to set up MariaDB:

Start the MariaDB service and enable it to start after system reboot:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Secure your database installation by running:

sudo mysql_secure_installation

Enter the root password and follow the prompted instructions.

Then, login to the MariaDB shell:

sudo mysql -u root -p

Create a new database for Mahara and a new database user:

CREATE DATABASE mahara_db;
CREATE USER 'mahara_user'@'localhost' IDENTIFIED BY 'your-strong-password';
GRANT ALL PRIVILEGES ON mahara_db.* TO 'mahara_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 3: Install and Configure Nginx

Nginx is a lightweight web server that we will use to run Mahara. Follow the below steps to install and set up Nginx:

Start the Nginx service and enable it to start after system reboot:

sudo systemctl start nginx
sudo systemctl enable nginx

Copy the default Nginx configuration file to a new file with the Mahara configuration settings:

sudo cp /etc/nginx/nginx.conf /etc/nginx/mahara.conf

Edit the new configuration file:

sudo nano /etc/nginx/mahara.conf

Paste the following configuration:

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
  worker_connections  1024;
}

http {
  client_max_body_size 20M;
  server_tokens off;

  include /etc/nginx/mime.types;
  default_type application/octet-stream;

  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';

  access_log  /var/log/nginx/access.log  main;

  sendfile        on;
  keepalive_timeout  65;

  gzip  on;
  gzip_proxied any;
  gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

  upstream php-handler {
    server unix:/var/run/php-fpm/php-fpm.sock;
  }

  server {
    listen 80;
    server_name your_domain.com;
    root /var/www/mahara;
    index index.php;

    location / {
      try_files $uri $uri/ /index.php?$args;
    }

    location = /robots.txt {
      access_log off;
      log_not_found off;
    }

    location ~ \.php$ {
      # fastcgi_pass 127.0.0.1:9000;
      # With php-fpm:
      fastcgi_pass php-handler;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;
    }

    location ~ /\.ht {
      deny all;
    }
  }

}

Replace your_domain.com with your custom domain name. Save and close the file.

Test the syntax of the configuration file:

sudo nginx -t -c /etc/nginx/mahara.conf

If the output is successful, reload the Nginx service:

sudo systemctl reload nginx

Step 4: Download and Install Mahara

Create a new directory for the Mahara installation:

sudo mkdir /var/www/mahara

Next, download and extract the latest Mahara source code:

sudo wget https://launchpad.net/mahara/20.10/20.10.0/+download/mahara-20.10.0.tar.gz -P /tmp/
sudo tar zxvf /tmp/mahara-20.10.0.tar.gz --strip-components=1 -C /var/www/mahara/

Change the ownership of the Mahara directory to the Nginx user:

sudo chown -R nginx:nginx /var/www/mahara/

Step 5: Configure Mahara

Copy the Mahara configuration file and edit it:

sudo cp /var/www/mahara/config-dist.php /var/www/mahara/config.php
sudo nano /var/www/mahara/config.php

Enter the following settings at the end of the file:

$cfg->dbtype   = 'mysqli';
$cfg->dbhost   = 'localhost';
$cfg->dbname   = 'mahara_db';
$cfg->dbuser   = 'mahara_user';
$cfg->dbpass   = 'your-strong-password';
$cfg->wwwroot  = 'http://your_domain.com';
$cfg->dataroot = '/var/www/mahara/maharadata';
$cfg->directorypermissions = 02770;
$cfg->adminuser = 'admin';          
$cfg->adminpw   = 'your-strong-password';

Replace the database details and URL with your own settings. Save and close the file.

Step 6: Test Mahara

Restart the necessary services:

sudo systemctl restart php-fpm

Open your preferred web browser and navigate to your server's IP address or your custom domain name. If you have correctly followed the steps, you should see the Mahara installation page.

Follow the prompts to complete the installation process, and once complete, you will be directed to the Mahara dashboard.

Conclusion

In this tutorial, you learned how to install and configure Mahara on Fedora CoreOS Latest. With Mahara, you can create and showcase your learning achievements, helping you achieve new academic or career goals.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!