Shurn the Awesomer
Creating a Classroom Suite with Moodle and BigBlueButton

Creating a Classroom Suite with Moodle and BigBlueButton

Written on Sat, 10 December 2016

Moodle is quite a feature rich Learning Management System. If you're like me, wishes to install moodle on your own server, here's a guide to show you how. Afterwards, I'll even show you how to install BigBlueButton to get it to work with Moodle. Combining LMS with a web conferencing tool and you get a full online classroom suite. What more power can you get from that?

In this tutorial, I'll be using Ubuntu 16.04 for Moodle and Ubuntu 14.04 for BigBlueButton. It is most unfortunate that the latest stable version of BigBlueButton won't work on the latest Ubuntu LTS. Although BigBlueButton 1.1 will support 16.04, there is no official news on its release date.

Installing Moodle


As usual, log into root account for ease of command line typing. If not, you will have sudo every other command.

sudo su

Update your Ubuntu Machine to the latest version.

apt-get update
apt-get -y dist-upgrade

Install Prerequisites

apt-get -y install postgresql postgresql-contrib apache2 php libapache2-mod-php php7.0-pgsql php7.0-xml php7.0-curl php7.0-zip php7.0-gd php7.0-mbstring php7.0-xmlrpc php7.0-soap php7.0-intl

Installing Postgres


This step is optional if you are using RDS. I highly recommend using RDS for database as you can take advantage of RDS features.

Set Password by logging in as user postgres, and going into postgres terminal

su - postgres
psql
\password postgres


Prepare a database and a user for moodle

CREATE USER moodleuser WITH PASSWORD 'yourpassword';
CREATE DATABASE moodle WITH OWNER moodleuser;


List the database to ensure you have created it properly.

\l


Now exit from postgres terminal

\q


And log out from postgres user

exit

Installing Moodle


Git clone the moodle application

cd /var/www
rm html/index.html
git clone --depth=1 -b MOODLE_32_STABLE git://git.moodle.org/moodle.git html
chmod -R 0775 html
find html -type f -exec chmod 0664 {} \;

You must create a secure moodle data directory. This directory will be used to store data related to your Moodle isntallation. It is not meant for public internet. If your computer is a shared terminal, please consult your administrator to see what permissions is most suitable.

mkdir moodledata
chmod 775 moodledata

Now browse to your Moodle installation on your web browser. You would be greeted to select your language. Proceed with your preferred language. I prefer English and the tutorial will be in English.

You will then need to confirm that the paths on your server is accurate. Most importantly, the moodle data directory. If you have followed the tutorial, the path will be /var/www/moodledata.

Choose your database. If you have followed the tutorial so far, you would choose PostgreSQL.

Enter the configuration for your PostgreSQL. If you have followed the tutorial so far, your host will be localhost. If you have used RDS instead, you will have to use the details provided by RDS.

Finally, the general configurations for Moodle.

When you are done with the installation, Moodle may not be able to write to the directory, so you might need to do it yourself. Create the file and paste the codes provided at the end of the installation.

nano html/config.php

Setting up cron job


Setting up cron job for moodle is important for moodle to function normally.

crontab -u www-data -e
*/1 * * * * /usr/bin/php /var/www/html/admin/cli/cron.php >/dev/null


Now cron job will run every 1 minute.

Setting up clamav


You should never trust anybody on the internet. That's why you need to install clamav in the server and scan every file that comes along.

apt-get install clamav


To update virus definition, run this:

freshclam


You can also use cron job to update virus definition automatically.

crontab -e


Add the follow for hourly updates. Change the rate of update if this is too much for you.

0 * * * * freshclam


In Moodle, enable the antivirus plugin under Site Administration > Plugins > Antivirus Plugin > Manage antivirus plugins. Then set up the configurations under ClamAV antivirus page.

That's it for Moodle. If you are interested in having online classrooms, proceed to the next part of the tutorial.

Installing BigBlueButton 1.0


So far I have not been able to get a working BigBlueButton installation on any EC2 instances on anything less than 4GB ram. So the minimum requirement is T2.medium instance.

Update Ubuntu libraries to the latest and reboot.

apt-get update && apt-get -y dist-upgrade && reboot

In order for your ubuntu to be supported till April 2019, you need to update the kernel to xenial release.

apt-get install --install-recommends linux-generic-lts-xenial && reboot

Now, you may wish to remove any unused package remaining in your Ubuntu.

apt-get autoremove

Ensure that multiverse in enabled in your source list. Otherwise, enable it.

grep "multiverse" /etc/apt/sources.list


To enable it, use this command:

echo "deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse" | sudo tee -a /etc/apt/sources.list


Do another update and dist-upgrade if you have added the multiverse.

apt-get update && apt-get -y dist-upgrade && reboot

Installing the latest libreoffice


You cannot use the default libreoffice in the repository as it is not stable. You will need to use libreoffice 4.4 and above. As of writing, the latest version is 5.2.

apt-get install software-properties-common
add-apt-repository ppa:libreoffice/libreoffice-5-2


You will also need ECDSA keys in the audio connection between the browser and FreeSWITCH server.

add-apt-repository -y ppa:ondrej/php

FFMPEG installation


For reasons beyond the scope of this tutorial, FFMPEG is not available in Ubuntu 14.04, so you have to compile it on your own.
Create a file called install-ffmpeg.sh and add the following codes into the file.

sudo apt-get install build-essential git-core checkinstall yasm texi2html libvorbis-dev libx11-dev libvpx-dev libxfixes-dev zlib1g-dev pkg-config netcat libncurses5-dev

FFMPEG_VERSION=2.3.3

cd /usr/local/src
if [ ! -d "/usr/local/src/ffmpeg-${FFMPEG_VERSION}" ]; then
sudo wget "http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2"
sudo tar -xjf "ffmpeg-${FFMPEG_VERSION}.tar.bz2"
fi

cd "ffmpeg-${FFMPEG_VERSION}"
sudo ./configure --enable-version3 --enable-postproc --enable-libvorbis --enable-libvpx
sudo make
sudo checkinstall --pkgname=ffmpeg --pkgversion="5:${FFMPEG_VERSION}" --backup=no --deldoc=yes --default

Now run the compilation script.

chmod +x install-ffmpeg.sh
./install-ffmpeg.sh

Run the following to ensure the FFMPEG is installed with version 2.3.3

ffmpeg -version

Actual BigBlueButton installation


It's time to install BigBlueButton by adding the package repository.

wget http://ubuntu.bigbluebutton.org/bigbluebutton.asc -O- | sudo apt-key add -
echo "deb http://ubuntu.bigbluebutton.org/trusty-1-0/ bigbluebutton-trusty main" | sudo tee /etc/apt/sources.list.d/bigbluebutton.list
sudo apt-get update
apt-get install bigbluebutton


This will take some time, so grab a coffee and relax while the installation progress.

Optional API demo


If you would like to, you can install a demo API to test that your installation is working.

apt-get install bbb-demo


This installation demo is exactly the same as the Official Demo Server.
Once you are done testing, you should remove it.

apt-get purge bbb-demo

Optional hostname setup


If you are hosting your set up on the internet, you will likely need to use your hostname instead of IP address. You will need to run the following command with your hostname:

bbb-conf --setip yourhostname.tld

That's it! You have a working BigBlueButton server to do any form of conferencing. I assume that you installed BigBlueButton because you wanted to have online classrooms with moodle right? Proceed on to integrate Moodle and BigBlueButton.

Getting Moodle to work with BigBlueButton


You will need to download the moodle plugin for both applications to work together.

Install the moodle plugin under Site Administration > Plugins > Install plugins. Select the file you have download and upload it to the site with the "Install plugin from the ZIP file" button. Follow the instructions and you will eventually be at the configuration page for the BigBlueButton setup.

You need to enter the URL which to connect to BigBlueButton. For the shared secret, you will need to go to your BigBlueButton and type the following command:

bbb-conf --secret


Then copy and paste the shared secret to the moodle configuration. You may leave the rest of the configuration by its default, or configure as you desire.

Congratulations. You are now able to run Moodle classrooms with BigBlueButton.