Installing Mahara on Debian Latest

Mahara is an open-source digital portfolio and social learning platform designed specifically for educational institutions. It is a robust and customizable platform that allows users to showcase their achievements in education and professional development.

In this tutorial, we will guide you through the process of installing Mahara on Debian Latest. This guide is suitable for system administrators and developers who want to deploy their own Mahara installation.

Prerequisites

Before proceeding with the installation process, ensure that you have the following prerequisites in place:

Step 1: Update System Packages

Before installing any new software, it's important to update the system packages to the latest version. Open a terminal window on your Debian server and run the following command:

sudo apt update && sudo apt upgrade

This command updates the package repository and installs the latest version of all software packages installed on your system.

Step 2: Install Apache Web Server

Mahara requires an Apache web server to run, which you can install using the following command:

sudo apt install apache2

Once the installation is complete, start the Apache service and enable it to start at boot time:

sudo systemctl start apache2 && sudo systemctl enable apache2

Step 3: Install MariaDB/MySQL Database Server

Mahara needs a database server to store its data. We recommend using MariaDB or MySQL, which you can install using the following command:

sudo apt install mariadb-server

Once the installation is complete, run the following command to secure the database server:

sudo mysql_secure_installation

Follow the prompts and set a strong password for the root user. Then, create a new user and database for Mahara using the following commands:

sudo mysql -u root -p
MariaDB [(none)]> CREATE DATABASE mahara;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mahara.* TO 'maharauser'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Replace 'password' with a strong password of your choice.

Step 4: Install PHP and required PHP extensions

Mahara requires PHP 7.2 or later and several PHP extensions to function correctly. You can install them using the following command:

sudo apt install php libapache2-mod-php php-cli php-curl php-gd php-mbstring php-mcrypt php-xml php-zip php-bz2 php-intl php-ldap

Once the installation is complete, restart the Apache service to load the new PHP modules:

sudo systemctl restart apache2

Step 5: Download and Install Mahara

Once you have completed all the prerequisites, you can download and install Mahara using the following steps:

  1. Download the latest release of Mahara from the official website at https://mahara.org/.

  2. Extract the downloaded archive to the Apache document root directory:

    cd /var/www/html
    sudo tar xzvf /path/to/mahara-X.X.X.tar.gz
    cd mahara-X.X.X
    sudo mv * ..
    cd ..
    sudo rm -rf mahara-X.X.X
    

    Replace 'X.X.X' with the version number you downloaded.

  3. Set the correct file ownership and permissions:

    sudo chown -R www-data:www-data /var/www/html/
    sudo chmod -R 755 /var/www/html/
    
  4. Configure the Mahara settings by copying the 'config-defaults.php' file to 'config.php':

    cd /var/www/html/
    sudo cp htdocs/config-defaults.php htdocs/config.php
    
  5. Edit the 'config.php' file and change the following settings:

    $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' account in Step 3.

Step 6: Configure Apache Virtual Host

To access Mahara from a web browser, you need to configure an Apache virtual host. Create a new virtual host configuration file in the '/etc/apache2/sites-available/' directory:

sudo nano /etc/apache2/sites-available/mahara.conf

Add the following content to the file:

<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  DocumentRoot /var/www/html/htdocs
  ServerName example.com

  <Directory /var/www/html/htdocs>
    AllowOverride All
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Replace 'example.com' with your domain name, and save the file. Then, enable the virtual host using the following command:

sudo a2ensite mahara.conf

Finally, restart the Apache service to apply the changes:

sudo systemctl restart apache2

Step 7: Access Mahara

You can now access Mahara by entering your domain name or server IP address in a web browser. The first time you access the site, you will see the Mahara installation page. Follow the prompts to set up your administrator account and configure the system settings.

Congratulations! You have successfully installed Mahara on Debian Latest.

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!