Installing Mahara on nixOS Latest

Mahara is a widely used open-source e-portfolio system which helps users to create and maintain personal online learning environments. NixOS is a popular Linux distribution that uses a declarative approach to manage systems configuration. In this tutorial, we will explain how to install Mahara on the latest nixOS using the command line.

Step 1: Update the system

Before proceeding with the installation, let us first ensure that the system is up-to-date using the following command:

sudo nix-channel --update

Step 2: Install Mahara

To install Mahara, run the following command in the terminal:

sudo nix-env -iA nixos.mahara

Step 3: Create a database

Mahara requires a database to store its data. We will use MariaDB as our database engine. To install and set up MariaDB, run the following commands:

sudo nix-env -iA nixos.mariadb
sudo systemctl start mariadb
sudo mysql_secure_installation

During the installation process, you will be prompted to set a root user password, remove anonymous users, disallow remote root login, and remove the test database. Follow the prompts and provide the necessary information.

Next, create a new database for Mahara using the following commands:

sudo mysql -u root -p
CREATE DATABASE mahara;
GRANT ALL PRIVILEGES ON mahara.* TO 'maharauser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;

Replace password with a strong and unique password for the database user.

Step 4: Configure Mahara

Mahara needs to be configured before it can be accessed. Open the Mahara configuration file using the following command:

sudo nano /etc/mahara/config.php

Add the following lines:

$cfg->dbtype   = 'mysqli';
$cfg->dbhost   = 'localhost';
$cfg->dbname   = 'mahara';
$cfg->dbuser   = 'maharauser';
$cfg->dbpass   = 'password';

Replace password with the password you set for the maharauser earlier.

Step 5: Start Mahara

Once you have saved the configuration file, start the Mahara service using the following command:

sudo systemctl start mahara

Step 6: Access Mahara

You can now access Mahara by opening a web browser and entering the IP address or domain name of your server followed by /mahara. For example, if your server IP address is 192.0.2.1, enter http://192.0.2.1/mahara in the browser's address bar. Follow the on-screen prompts to complete the setup process.

Conclusion

In this tutorial, we have explained how to install Mahara on nixOS Latest using basic command line operations. With the correct setup, you can enjoy all the features and capabilities of the Mahara e-portfolio system.