Setup Learning locker


A Learning Record Store is a massively scalable database designed specifically for storing learning activity data. If you’re using software that creates data with the Experience API (xAPI or Tin Can) specification, you’ll need a Learning Record Store to store, sort and share that data.

All sorts of software can be an activity provider in the xAPI world; from elearning content authoring tools, to learning management systems (LMSs), Apps, Serious Games and more.

Capturing this data in a reliable and consistent manner is vital to using xAPI; if the data you collect is stored incorrectly or not valid to the xAPI standard, you’ll find yourself with a whole lot of useless data in years to come.


How to install Learning Locker
We will setup learning locker in Ubuntu 14.04 LTS version with at-least 1 GB RAM and 10GB Hard disk space
Prerequisite
* LAMP
* OpenSSH
* Mail


sudo apt-get install lamp-server^

Setting LRS
Install necessary components using apt-get.

Change the key server

 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:
80 --recv 7F0CEB10

Set up MongoDB
First we need to install mongoDB with below command. Please dont install with normal apt as the version will be too old.

 echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart 
dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb-org

To verify Mongo Installation you need to type sudo service mongod status

If you have version conflict please upgrade your mongoDB with below command

 sudo pecl upgrade mongo 

Installation of Supporting Components

 sudo apt-get install curl nano apache2 php5 php5-mongo 
php5-mcrypt git node npm mysql-server postfix

You need to set up root password for MYSQL even though we are not using it for learning locker to avoid errors. Postfix config you can set it as Internet site and use default mail

 sudo apt-get update 

Check all the services are running, (Apache,MongoDB,mysql and Postfix)

sudo service apache2 status
sudo service mongod status
sudo service mysql status
sudo service postfix status

Enable PHP mcrypt cryptographic extension

 sudo php5enmod mcrypt 

Install bower
To avoid errors we need to install bower

 sudo npm install -g bower 

Install PHP-composer. Composer is a dependency manager

cd
curl -sS https://getcomposer.org/installer | php
sudo apt-get update
sudo apt-get install php5-curl
sudo mv composer.phar /usr/local/bin/composer

Get Learning Locker

Let’s clone the Learning Locker repository from github:

sudo apt-get install git
cd /var/www
sudo git clone https://github.com/LearningLocker/learninglocker.git

Output should be similar to the following below

Cloning into ‘learninglocker’…
remote: Counting objects: 7682, done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 7682 (delta 16), reused 0 (delta 0)
Receiving objects: 100% (7682/7682), 2.33 MiB | 605.00 KiB/s, done.
Resolving deltas: 100% (5216/5216), done.
Checking connectivity… done.

Setup the database (MongoDb)
We need to set up mongo database and user

mongo
use learninglocker
db.createUser( { user: “learninglocker", pwd: "learninglocker", 
roles: [ "readWrite" ] } );
exit
sudo service mongod restart

Change php configuration file inside learninglocker project

Edit /var/www/learninglocker/app/config/database.php this file
Now scroll down and change db name, username and password.

return [
  'fetch' => PDO::FETCH_CLASS,
  'default' => 'mongodb',
  'connections' => [
                'mongodb' => [
        'driver'   => 'mongodb',
        'host'     => 'localhost',
        'port'     => 27017,
        'username' => 'lrsusername',
        'password' => 'lrspassword',
        'database' => 'learninglocker' // Default name 
(removing this makes Travis fail).
    ],
        ],
        'migrations' => 'migrations',
];

Run composer to complete installation

cd /var/www/learninglocker/
sudo composer install --no-interaction --no-dev

 

Run Database migration

cd /var/www/learninglocker/
sudo php artisan migrate

MONGODB UPDATE ERROR FIX

If you are facing any error while artisan migrate. Please install the below fix and try again once more

sudo apt-get install php5-dev
sudo pecl upgrade mongo

Change ownership of every files in the directory

cd /var/www/learninglocker
sudo chown -R www-data:www-data *

Change Apache settings
Edit /etc/apache2/sites-available/000-default.conf

sudo vim /etc/apache2/sites-available/000-default.conf

Make the necessary changes as below

ServerAdmin admin@example.com
DocumentRoot /var/www/learninglocker/public

        Allowoverride All

Activate apache modules and restart

sudo a2enmod rewrite negotiation php5
sudo service apache2 restart

Enter the ip in a browser and see LearingLocker.

Enabling HTTPS in learning locker

You need to note two things while enabling https for learning locker
1) Edit the Index.php inside public folder of your LRS and insert the below lines after php open tag

<?php
$_SERVER[SERVER_PORT]=443;
$_SERVER[HTTPS]='on';

2) If you are using any proxy server add the below lines inside learninglocker/app/start/global.php

Request::setTrustedProxies(array(
    '192.168.23.33' // IP address of your intermediary
));

After this you can install SSL certificate. Please check the below link to set up Let’s Encrypt certificate
http://wp.me/pG86g-8G

Advertisements

One thought on “Setup Learning locker

Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: