Install and configure moodle in CentOS 6.3 with video streaming and recording

Moodle is a E-learning platform free as in free beer. Moodle is a CMS (Course Management System) and also known as a LMS (Learning Management System) or a VLE (Virtual Learning Environment).

I was in need to install a configure a system like this and I’ve chosen Moodle not also because is one of the best out there, but because is also free.

One of the key features that i was also needing was a video streaming and recording facility.  Moodle has it all (through plugins).

What I’m going to describe here is an installation of Moodle from the very beginning:

I’ve installed a CentOS 6.3 minimal – I’m going from here.

Necessary a MySQL database (although Moodle supports others),  HTTP server (I’m going with Apache) and PHP.

Edited:  As gshaw0 pointed out, there is no need to add additional repositories if you only want to install Moodle without the video streaming features ! Thank you gshaw0 !


PHP has some requirements about extensions and we need to configure other repositories, such as rpmforge and EPEL.


To install rpmforge, just get the package for your distribution and architecture.

Note: If you don’t have wget (or it’s a headless server) you must install it.

Get the package (replace with the correct package)

Install it

After install, go to /etc/yum.repos.d/ and edit rpmforge.repo and enable the rpmforge-extras repository, replacing 0 (zero) with 1 in the enabled = 0 line


Get the correct package for your CentOS version (i’m using 6.3)

Now, we can install the php extensions required by moodle

There aren’t all the extensions available for PHP as rpm you can install with yum, but pecl and pear are of help.

Install those we can install with yum

Note: According to moodle docs,  iconv, ctype and tokenizer are now included in PHP by default.

Some extensions are already built-in in PHP. To find out which just execute:

Example for curl:

The result, among other things, should be:

According to my php, the following extensions are built-in:

iconv, ctype, tokenizer, curl, openssl, ldap, zip, gd, simplexml, spl, pcre, json

Install the rest of the php extensions


Install the MySQL server

Start the server and follow the on screen instructions for the initial installation and configuration

Create the database

Note: Change database name, user and password according to your preferences

Save the values for later use.


Download Moodle from it’s server

decompress the file

Now you get a Moodle directory. If this is going to be a dedicated server for Moodle, I suggest you copy the contents of the Moodle directory to your server document root. This way, you can access the server by

If it is a shared server, copy the Moodle directory to your server document root directory and configure it accordingly.


This is were all the uploaded files, session files, temporary files are going to be stored. Moodle documentation suggests permissions as 0777 (write, read, execute for everyone) – I don’t thing this is necessary. Only the web server user/group should be able to write here.

Let’s assume /var/www

As suggested by Moodle documentation:

My suggestion:

If this is going to be a shared server, view the Moodle installation docs for more information.

Install Moodle

Let’s install it.

Moodle documentation suggests to use the CLI (Command Line Interface) to run the setup.

Let’s change the owner of the files for the installation

Execute the installer:

Answer the several questions the installer asks you

and in the end, you should see:

Revert the owner of the files:

Try to access it:

PS: If you can’t access it, see if you have iptables running.


Moodle uses a php file that must be run in background in  regular intervals to perform several tasks. Read here for more information.

NOTE: The Moodle server will not run well if this process is not done.

After the installation of cron, check what user is running the apache web server (IT SHOULD NOT BE ROOT).

The result should be something like this:

The bold line is the result we want.

Now, add the cron job with that user:

and add the line

Save and quit


Moodle seriously recommends that a PHP accelerator should be installed.  There are many, but i’m going to install APC.

And APC accelerator should be active.

For more information about performance, check the “Performance Recommendations“.

Video Streaming and Recording within Moodle

Note: I’ll be using the same server. OpenMeetings has some requirements about the server. Check them in the installation page.

For more available packages for Video Streaming, check the post “Free and Open Source Web Conferencing (Online Meetings, Webinars) Tools for e-Learning” from eFront.

One of the features i’m searching for Moodle to be able to perform is Video Streaming and Recording. This feature is a must have.  After searching and reading, I’ve choose OpenMeetings. It is simple to install and simple to use.

It has a Moodle  plugin and the configuration is straightforward, but we must install the server before.


Install Server

Go to downloads page and download OpenMeetings Server

Before, unpacking it, necessary to install some requirement packages

OpenMeetings requires ORACLE JRE 6

Installing Java

Go to and download the Linux RPM

After download, as root:

After install, check the version

It should be something like:

If something else (check the version YOU have installed), probably you should use alternatives to change it. Check the site If Not True Then False to see how to use alternatives to change the Java version.

Since i didn’t had any java (openjdk or java-gcj), i didn’t need to use alternatives.


To use some features (image upload and import to whiteboard), ImageMagick is necessary.

Importing PDFs

To be able to import PDFs to whiteboard, there are two packages that need to be installed.

Ghostscript is easy as: (probably is already installed):

SWFTools is also installable with yum

Make sure swftools version is 0.9 or above as previous versions have a bug (according to OpenMeetings website).

Recording and importing avi, flv, mov and mp4 into whiteboard

Necessary to install ffmpeg and sox

But, according to the website, ffmpeg must have the libmp3lame option enabled –libmp3lame.

You now have two choices:

Get the source rpm, install it, change the SPEC file to have the option –libmp3lame and rebuild the package


Get the ffmpeg source package and compile it yourself.

I’m going with the source package

Rebuilding ffmpeg

NOTE: There’s a general rule not to rebuild packages as the ROOT user. You can read about it here. I’m just doing it as root because this is a Virtual Machine I’m using to test the installation, but you should read about it.

Get the ffmpeg source rpm from here.

should be (as of the writing of this): ffmpeg-0.6.5-1.rf.src.rpm

After download, install it:

Install the necessay packages

You should now have a directory called rpmbuild. Inside there is a directory called SPECS. Inside there should be a file called ffmpeg.specs.  This file contains the configuration used to compile ffmpeg.

Edit the file and locate the %build macro. After the macro, should see something like this:







These are the configuration options that the package will be configured and later compiled with.

Locate the line

and change it to

Save and quit

Install required packages:

And now rebuild ffmpeg

rpmbuild -bb ffmpeg.spec (-bb means build binary).

More information about rebuilding rpms can be found here and here .

NOTE: If you get an error about libdirac (although dirac-devel is installed), install libstdc++-devel

And you can now see, ffmpeg will be compiled with the option we wanted:

Go and have some beer. This can take a while.

If everything goes well, you can now install ffmpeg. The RPM will be located inside the rpmbuild directory, in RPMS/<arch>.

rpm -ivh * (you should have more than one ffmpeg-* rpm).

And finally, install sox.

Enabling import of .doc, .docx, .ppt, .pptx,…

EDIT: As bait pointed out, OpenOffice is still needed for docs/ppts/etc… files to be used with OpenMeetings . You can get more information here.  I’ll edit the post later and add the headless instalation. Thank you bait !

For this to work, we need JODconverter and OpenOffice converter. Fortunately, earlier versions required OpenOffice to be installed. No more this is necessary since version 2.x .

Note: OpenOffice Converter is no longer necessary.

To get JODConverter, go the its page, at Google code.

Unzip it and put it where you want. I’m going to move it to /opt

NOTE: Later is necessary to configure OpenMeetings with the path

OpenMeetings by default works with apache derby database, but it can be configured to use MySQL. I’m going with MySQL.

At this point, we already have everything we need to install and configure OpenMeetings.

Create a directory and move the OpenMeetings file you’ve download (at this time, apache-openmeetings-incubating-2.0.0.r1361497-14-07-2012_1108.tar.gz)

It will now uncompress and create a series of files and directories.

Move the directory to another place. I’ll use /opt

Before proceeding with running it, let’s configure it to use MySQL, if you want. If not, just proceed to “Running and Configuration”

Download the MySQL connector from here

Uncompress it and copy the file mysql-connector-java-5.1.22-bin.jar (your version can be other) to /opt/openmeetings/webapps/openmeetings/WEB-INF/lib/

Let’s proceed with the configuration. This is available at the OpenMeetings website.

First, create a backup of the persistence.xml file

Edit the file persistence.xml and search for the lines: (almost at the end of the file)


, Username=root

, Password=”/>

and fill in your database detais.

NOTE: Make sure your MySQL database is using UTF-8 as the server charset.

You can change this, editing /etc/my.cnf and adding the line in the [mysqld] section:

Save and restart mysql

/etc/init.d/mysqld restart


Running and Configuration

Now, start the

and go to


After fill in your values, and login in, you’re done with the server.


Moodle Plugin

Just browse to and download the plugin

copy it to your moodle server to <moodle_install_dir>/mod directory

uncompress it

and change the permissions

Go to Moodle and login (as administrator)

The plugin installation page should appear to complete the installation.

And now you should have a working Moodle with Video Streaming and Recording

Hope this tutorial be of your help.

Authentication using LDAP (work in progress)

Preparing the system

Note: For this to work, you need to have a working LDAP server (Openlda).  I’m not covering here how it’s done. There’s plenty of tutorials online on how to do it. But before, if you don’t know what LDAP is, I recommend read about it and what is it for.

LDAP authentication is a bit tricky, especially if you’re using SSL in your server.

Here are some tricks, from Moodle documentation about LDAP – It worked for me, to enable SSL.

If you’re not using SSL, then proceed to Configuring Moodle with LDAP (below)

Copy your certificate files to the Moodle server, to the /etc/pki/tls/certs directory. Once there, just issue the cacertdir_rehash command.

cacertdir_rehash pwd

and the certificate file(s) now have links to them.

Now, it’s necessary to configure the openldap. Open the file /etc/openldap/ldap.conf

Search the line:

and change it to


It doesn’t matter, because in /etc/ssl, certs is a symlink to /etc/pki/tls/certs

Save the file and exit

Probably you’re going to need to restart the apache server (or other if you’re not using Apache).

Now, check the connection to your ldap server

If you get something like this:

Then it’s working.

Configuring Moodle with LDAP

Now, go to your Moodle instalation, and to the administration options

First, necessary to enable the LDAP plugin:

Go to SETTINGS -> Site Administration -> Plugins -> Authentication -> Manage Authentication and enable LDAP Server, by pressing the “Closed Eye” in the Enable Column.

After that, press settings and configure according to your configuration (and needs):

I have an Openldap server, so i’m using the configurations for it here. I’m only putting the values I’ve changed. All the others are the default values used by Moodle



if using SSL

ldaps://<IP or DNS LDAP SERVER>:636

if not

ldap://<IP or DNS LDAP SERVER>

Version 3 (default)

LDAP encoding: utf-8

Bind Settings

Hide passwords: YES (prevents from being stored in Moodle)

Distinguished name: cn=Manager,dc=domain,dc=com (The user you use to access your LDAP for search users)

Password: <the password>

User Lookup Settings

User type: posixAccount (rfc2307) – For Openldap

Contexts: ou=people,dc=domain,dc=com (the context where your users are in)

Search subcontexts: No

Deference aliases: No

User attribute: uid (The user attribute used in the LDAP for searching for users)

Member attribute: memberuid (The same, but for groups membership)

Force change password

Force change password: No (passwords are not in Moodle)

Use standard page for changing password: No

password format: MD5 hash (this is mine. Yours can be different)

LDAP Expiration settings

Expiration: LDAP (LDAP has all the passwords)

Grace logins: No

15 thoughts on “Install and configure moodle in CentOS 6.3 with video streaming and recording

  1. having error as follows :

    # yum install SDL-devel imlib2-devel freetype-devel zlib-devel a52dec-devel libdc1394-devel dirac-devel faac-devel faad2-devel gsm-devel lame-devel opencore-amr-devel librtmp-devel schroedinger-devel texi2html libogg-devel libtheora-devel libvdpau-devel x264-devel speex-devel
    Loaded plugins: fastestmirror, refresh-packagekit, security
    Loading mirror speeds from cached hostfile
    * base:
    * extras:
    * updates:
    Setting up Install Process
    No package imlib2-devel available.
    No package a52dec-devel available.
    No package dirac-devel available.
    No package faac-devel available.
    No package faad2-devel available.
    No package lame-devel available.
    No package opencore-amr-devel available.
    No package librtmp-devel available.
    No package schroedinger-devel available.
    No package libvdpau-devel available.
    No package x264-devel available.
    Resolving Dependencies
    — cut —
    OS CentOS 6.3

  2. and this one as well
    # yum install swftools
    Loaded plugins: fastestmirror, refresh-packagekit, security
    Loading mirror speeds from cached hostfile
    * base:
    * extras:
    * updates:
    Setting up Install Process
    No package swftools available.
    Error: Nothing to do

  3. Thanks for this very useful and well written post 🙂

    It might be worth adding that you don’t need the additional repos if you only want to install Moodle without the video streaming features (all the Moodle required php extensions were available on the default CentOS 6.4 repo during my test install)

  4. openoffice/libreoffice still needs to be installed for docs/ppt files to be used with openmeetings. all they changed was that jodconverter tries to launch openoffice/libreoffice before looking at

      1. how rude of me, i forgot to thank you for the guide. everything else worked flawlessly. i’m using centos 6.4 32-bit and latest rpmforge, i was able to install ffmpeg from yum. just type yum install ffmpeg. i tested all the listed video formats and they all worked well.

  5. Gracias por este blog.
    I plant to install Moodle in CentOS and this post is really helpful!

  6. Grate tutorial. Im trying to config 2 node moodle cluster on centOS6.4 with luci. I’ve set all pre-requisites and added VIP,scripts and mount point for both httpd and mysqld. My question is how to set VIP in nodes, so that moodle will install in nodes using cluster VIP instead of node IP.


  7. What software is a good fit to stream teaching content(Mp3 and Mp4) that we currently have and anything new we would like to added we can use the above directions. What can you recommend either free or pay for software as a service? Thank you for any direction

Leave a Reply

Your email address will not be published. Required fields are marked *