Mahara is an available supply e-portfolio application that enable individuals share its profile.

Several Mahara features:

  • Personalized
  • Collaboration
  • SmartEvidence
  • Open supply
  • Customizable
  • Mobile
  • Integration
  • Scalable

You can discover more information about Mahara by going to Mahara internet site.

Objective

In this guide we will learn to install Mahara on Ubuntu 14.04. We shall also install and configure its prerequisites.

Prerequisites

We will install Mahara in fresh installation of Ubuntu Server 14.04. We also need these applications to be able to run Mahara:

  • Apache 2
  • MySQL 5.1+
  • PHP 5.4+

Update the Base System

Before we install Mahara, let’s update the system to the update that is latest.

$ Sudo apt-get update $ sudo apt-get -y upgrade 

Install Apache 2

After applying update that is latest to our base system, Lets’s start installing Apache 2 and required libraries.

$ sudo apt-get -y install apache2 apache2-bin apache2-data apache2-mpm-prefork libaio1 libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libterm-readkey-perl libwrap0 ssl-cert tcpd 

We can check the Apache 2 service status using command below:

sudo service apache2 status  * apache2 is running 

We can also check whether Apache 2 is listening on which port using command below:

 sudo netstat -naptu | grep apache tcp6       0      0 :::80                   :::*                    LISTEN      14873/apache2 

Install MySQL 5.6

We will install and use MySQL 5.6 as database for Mahara.

We will use MySQL Server 5.6 since MySQL 5.6 is the most up to date version of MySQL shipped with Ubuntu 14.04 Trusty Tahr.

$ sudo apt-get install that is-y 

We need certainly to setup MySQL root password. Please input password for MySQL root individual.

Verify root password.

Securing MySQL Installation

We will secure MySQL installation by operating mysql_secure_installation.

Enter the main password we set on installation.

$ mysql_secure_installation  NOTE: RUNNING each ELEMENTS OF THIS SCRIPT IS ADVISED FOR SEVERAL MySQL       SERVERS IN MANUFACTURING utilize!  PLEASE STUDY EACH STEP OF THE PROCESS PROPERLY!

In purchase to log into MySQL to secure it, we will require the password that is current the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here.

Enter current password for root (enter for none): OK, successfully used password, moving on...

Since we already have a root password set, answer this part with n.

Setting the root password ensures that nobody can log into the MySQL root user without the authorisation that is proper

You curently have a root password set, to properly respond to 'n'.

Change the main password? [Y/n] letter ... skipping.

Remove the user that is anonymous improve security. This will make sure people or the application has the username that is correct password to login to MySQL. Response with Y

By standard, a MySQL installation has an anonymous individual, enabling you to log into MySQL and never have to have a person account designed for them.  This will be meant limited to evaluating, and also to result in the installation get somewhat smoother.  They should be removed by you before moving into a production environment.

Remove anonymous users? [Y/n] Y ... Success!

We also want remove root login from remote machine. Answer with Y.

Normally, root should only be allowed to connect from 'localhost'.  This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y ... Success!

Previously the test database created automatically by the MySQL installation, but MySQL 5.6 does not create test database. We can still choose Y, it will throw error but that’s fine.

By default, MySQL comes with a database named 'test' that anyone can access.  This is also intended only for testing, and should be removed before moving into a production environment.

Remove Test access and database to it? [Y/n] Y - Dropping test database... MISTAKE 1008 (HY000) at line 1: cannot fall database 'test'; database does not occur ... Failed! Maybe not critical, move... - Removing privileges on test database... ... triumph!

The final action would be to reload the MySQL privilege dining table.

Reloading the privilege tables will make certain that all modifications made thus far will need impact straight away.

Reload privilege tables now? [Y/n] Y ... Success!

All done! If you have finished most of the above actions, your installation that is mySQL should be secure.

Thanks for using MySQL!

Cleaning up...

Create a Database for mahara

Now we have a secure MySQL installation, it’s time to create database and user for mahara itself.

Login to MySQL using root credential.

$ Mysql root that is-u Enter password:  Welcome toward MySQL monitor.  Commands end with ; or g. Your MySQL connection id is 58 Server variation: 5.6.30-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All legal rights reserved.

Oracle is a trademark that is registered of Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>

Create a database that is new mahara utilizing demand below:

mysql> CREATE DATABASE mahara CHARACTER SET utf8 COLLATE utf8_general_ci; Query okay, 1 line impacted (0.00 sec) 

Create a person for Mahara

The database for mahara is prepared, let us produce a username and password and give privileges to mahara database.

Don’t forget to improve the password mahara123secret below with better password.

mysql> GIVE each PRIVILEGES ON `mahara`.* TO 'mahara'@'localhost' IDENTIFIED with 'mahara123secret'; Query okay, 0 rows impacted (0.00 sec) 

We need certainly to run FLUSH PRIVILEGES demand so the privileges dining table would be reloaded by MySQL so we may use brand new credential.

mysql> FLUSH PRIVILEGES; Query okay, 0 rows impacted (0.00 sec) 

Exit from MySQL system by typing q

mysql> q 

Install PHP 5

The final component before we can install mahara is PHP 5. We will install PHP 5 and several common PHP libraries.

$ that we have to install sudo apt-get install that is-y php5-common php5-json php5-mysql php5-readline 

Install extra php libraries:

$ sudo apt-get -y install php5-gd php5-mcrypt php5-curl 

We will allow mcrypt module

$ sudo php5enmod mcrypt 

Restart the Apache 2 procedure therefore the modifications would be used:

$ sudo solution apache2 restart 

Install Mahara

All prerequisites happen to be set up. We are prepared to install mahara. The most recent stable form of mahara can be acquired Mahara down load web page on Launchpad.

At the full time of the writing, the newest stable variation is variation 16.10.2, let us down load mahara compressed file utilizing wget.

$ wget -c https://launchpad.net/mahara/16.10/16.10.2/+download/mahara-16.10.2.tar.gz 

Extract the mahara compressed file.

$ tar xzf mahara-(.10.2.tar.gz that is 

Move mahara-16.10.2 directory to Apache directory.

$ sudo mv mahara-16.10.2 /var/www/mahara 

Change ownership of mahara directory to www-data user and group.

$ sudo chown -R www-data:www-data /var/www/mahara 

The Mahara files are ready, now let’s create Apache Virtual Host configuration to serve mahara.

Configure Apache Virtual Host for http Only

Create new apache configuration file on /etc/apache2/sites-available/mahara.conf with contents below.

<VirtualHost *:80>     ServerName mahara.exampleserver.xyz

DocumentRoot /var/www/mahara/htdocs

<Directory /var/www/mahara/htdocs> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted php_value post_max_size 20M </Directory>

ErrorLog ${APACHE_LOG_DIR}/mahara.exampleserver.xyz-error.log CustomLog ${APACHE_LOG_DIR}/mahara.exampleserver.xyz-access.log combined

</VirtualHost>

Don’t forget to change mahara.exampleserver.xyz above with the domain name that you use for your mahara installation.

Enable the site using a2ensite command.

$ sudo a2ensite mahara 

Reload the apache2 process so it read the new virtualhost configuration:

$ sudo service apache2 reload 

Setup Mahara

Move the mahara configuration file config-dist.php to config.php.

Open config.php file.

Change database configuration to reflect database name and credential we created earlier.

$cfg->dbtype   = 'mysql'; $;dbhost that is cfg-> 'localhost'; $cfg->dbport   = null; // Change if you use a non-standard slot quantity for the database $cfg->dbname   = 'mahara'; $cfg->dbuser   = 'mahara'; $cfg->dbpass   = 'mahara123secret'; 

Change dataroot setup from :

$cfg->dataroot = '/path/to/uploaddir'; 

to

$cfg->dataroot = '/var/www/mahara/uploaddir'; 

Set urlsecret and passwordsaltmain setup

// $cfg->urlsecret = 'mysupersecret'; // $cfg->passwordsaltmain = 'some long random sequence right here with countless figures'; 

These two designs must be filled up with random figures. You need to use two service that is online to get random character to be used for two value above.

Now Open the Mahara URL we shall be rerouted to Mahara installation wizard. Simply click Install Mahara

Next we shall install the mahara database. Click Continue

The last step is to set admin password and email. Click Submit

We already enter Mahara dashboard.

Mahara homepage.

Configure https only site for mahara

Secure connection is now a requirement for web application. Last step that we will do in this tutorial is changing the connection to only use https.

We assume that you already have SSL certificate and key that is private

Let’s generate brand new apache digital host setup on /etc/apache2/sites-available/mahara-ssl.conf with articles below.

Don’t forget to change*********) that are:

(**********)ServerName

  • SSLCertificateFile
  • SSLCertificateChainFile
  • SSLCertificateKeyFile
  • <VirtualHost *:80>    ServerName mahara.exampleserver.xyz    Redirect permanent / https://mahara.exampleserver.xyz/ </VirtualHost>

    <VirtualHost *:443>

    ServerName mahara.exampleserver.xyz

    DocumentRoot /var/www/mahara/htdocs

    <Directory /var/www/mahara/htdocs> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted php_value post_max_size 20M </Directory>

    ErrorLog ${APACHE_LOG_DIR}/mahara.exampleserver.xyz-error.log CustomLog ${APACHE_LOG_DIR}/mahara.exampleserver.xyz-access.log combined

    SSLEngine on SSLCertificateFile /etc/apache2/ssl/mahara.exampleserver.xyz.crt SSLCertificateChainFile /etc/apache2/ssl/mahara.exampleserver.xyz.crt SSLCertificateKeyFile /etc/apache2/ssl/mahara.exampleserver.xyz.key

    Header always set Strict-Transport-Security "max-age=15768000"

    </VirtualHost>

    # intermediate configuration, tweak to your needs SSLProtocol all -SSLv2 -SSLv3 SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS SSLHonorCipherOrder on

    We will also disable mahara http only virtual host and enable the new virtual host config.

    $ sudo a2dissite mahara $ sudo a2ensite mahara-ssl 

    The new host that is virtual need Apache mod_ssl and mod_headers modules. We have to allow those modules.

    $ sudo a2enmod ssl $ headers that are sudo a2enmod*****************)

    Now, restart Apache 2 service so it will reload its configuration. We need to restart instead of reload since we enabled a new module.

    $ sudo service apache2 restart 

    After configuring Mahara with https we need to change one Mahara configuration. Open config.php

    Find the line:

    // $;wwwroot that is cfg-> 'https://myhost.com/mahara/'; 

    Replace with

    $cfg->wwwroot = 'https://mahara.exampleserver.xyz'; 

    Email help

    Mahara have actually mail help, we'll perhaps not proceed through e-mail settings within guide. But we highly recommend utilizing 3rd party e-mail solution like Mailgun or Sendgrid for Mahara in the place of creating your personal e-mail host.

    Cron setup

    On root individual add crontab entry below. Please modification somesecret value below with urlsecret you currently alter whenever creating Mahara.

    * * * * * curl https://mahara.exampleserver.xyz/lib/cron.php?urlsecret=somesecret 

    Summary

    In this guide we discovered how-to mahara that is install Ubuntu 14.04.

    We installed all the prerequisites, create user and database on MySQL for Mahara and also configure Apache 2 virtual hosts to be able to serve mahara.

    We also configured https settings for mahara so we run Mahara securely and configure crontab for Mahara.

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here