Home Web Development Moodle Administration Essentials

Moodle Administration Essentials

books-svg-icon Book
eBook $25.99 $17.99
Print $32.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $25.99 $17.99
Print $32.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
About this book
Publication date:
July 2015
Publisher
Packt
Pages
156
ISBN
9781784395476

 

Chapter 1. Moodle in a Nutshell

In this first chapter, we deal with a short background of Moodle and what it does. We will introduce the architectural structure of Moodle and how the different parts work together. We will also go through the steps for installing Moodle on a Linux server and see how to perform ongoing upgrades.

 

Background of Moodle


Moodle is an open source web-based course management system that is used by organizations, schools, universities, and training companies globally to provide online learning and the online component of blended learning. It is the world's most widely used open source course management system.

Moodle has a large community that collaborates in both developing and using the application through the community forums at https://moodle.org/. Moodle HQ has a team of full-time core developers who work on the ongoing support and development of the application. There is a global network of certified Moodle service providers that financially support the Moodle HQ by providing commercial services to organizations who use Moodle.

Moodle was originally released in 2002 by Martin Dougiamas to help teachers take advantage of the online environment to create online courses. Since then, there have been regular releases, with releases coming out on average every 6 months. The project is led and coordinated by Martin at Moodle HQ in Perth, Australia.

Moodle has a modern and easy-to-use interface that works well on desktops and mobile devices.

Users get a customizable dashboard where they can display their course information, calendar, and messages and manage their personal files on the system. Users can manage their own profile to control the level of notifications that they receive from the system, including being able to have forum posts sent out in daily batches.

The course management of Moodle enable easy communication, collaboration, and content creation for teachers and students in addition to comprehensive assessment tools, including the online quiz tool. Teachers can simply create content in Moodle using the accessible text editor or upload files, learning objects, and multimedia into the Moodle course including embedding third-party content such as SlideShare, YouTube, and other social systems into the pages of the course.

Teachers can easily track students' progress through the course content and activities, and students can monitor their own progress, with an understanding of what is left to accomplish.

From an administration perspective, Moodle is very flexible. For example, it has many options available for user authentication and course enrolment due to the many plugins that are available. These offer organizations many approaches to manage how they integrate Moodle into their other systems.

 

Architecture of Moodle


Moodle stands for Modular Object-Oriented Dynamic Learning Environment, which explains the background to the plugin structure of the Moodle application as it is all modular.

There are many plugin types in Moodle including authentication, enrolment, themes, course formats, and each of these control an aspect of Moodle such as, an authentication plugin, which enables the administrator to control how users log into Moodle.

Moodle is written in PHP and can be run on a number of web servers that support PHP, including Apache and IIS.

Moodle supports a number of database types including MySQL, PostgreSQL, MSSQL, Oracle, and SQLite. However, the most supported and tested would be MySQL and PostgreSQL.

Moodle also stores files in a directory on the server, which is referred to as the moodledata directory. Moodle stores all of its files in this directory including temporary files, session data, and user uploaded files.

Always check the minimum server requirements for the version of Moodle that you are planning to install. These are found in the release notes on the MoodleDocs site. The latest version will be found at https://docs.moodle.org/en/Installing_Moodle#Requirements.

So, when considering the Moodle installation, you must consider the PHP files, the moodledata directory, and the database.

 

Installing Moodle


We are now going to deal with the specification required for installing Moodle on a Linux server.

Server specifications

Moodle is most typically installed on Linux servers using Apache, MySQL, and PHP, known as the LAMP platform. Hence, this installation combination is the most tried, tested, stable, and supported. This is what we will be using in the coming examples.

Hardware

There is no way to set a requirement for the hardware for a Moodle site without understanding how many users will be using the site and how they will be using it. Moodle is an enterprise system, so be sure that you give it sufficient memory, CPU, and disk space. Active monitoring of the performance can help you identify if more is needed. For the most up-to-date guidance, you should check the Moodle docs, the https://moodle.org/ forums, or contact a certified Moodle service provider.

For the installation and upgrade examples in this chapter, if you do not have a Linux server at hand, you can use a Linux virtual server from any cloud provider, such as Amazon cloud, Digital Ocean, Linode, or similar. Just be sure to choose an image with an up-to-date LAMP stack that meets the minimum requirements for your Moodle version.

Software

Moodle provides detailed specifications for required software for each Moodle version.

Check out https://docs.moodle.org/dev/Releases for further details. For instance, https://docs.moodle.org/dev/Moodle_2.8_release_notes#Server_requirements has the 2.8 version list.

Code specifications

We are now going to cover the installing of Moodle, where to download code from (including which version), and the settings that are used to run the installation process.

Moodle download

We always recommend that you download your Moodle code directly from https://moodle.org/. The following are the steps for downloading Moodle:

  1. Firstly, you need to decide which version of Moodle you wish to install. Here, we will be installing the latest stable version of Moodle 2.8.

  2. On your server, locate and go to the directory where you plan to host your moodle site.

  3. Then, you can either download the ZIP file from https://download.moodle.org/ and unzip it, or use Git to pull the code from the Moodle Git repository. We recommend Git for its ease of use, particularly for upgrading, which we shall cover later in this chapter.

  4. If using Git, use the following Git command:

    git clone -b MOODLE_28_STABLE git://git.moodle.org/moodle.git
    
  5. The resulting directory will be called moodle. This directory should be located in your web server directory so that it can be accessed via the Internet.

  6. If you need to specify a different directory name, such as learning, use the following Git command instead:

    git clone -b MOODLE_28_STABLE git://git.moodle.org/moodle.git learning
    
  7. Alternatively, if you prefer to not have a subdirectory called moodle, move all of the contents directly into your web server directory.

File permissions

You need to make the moodle files secure as they are publically accessible via the Internet.

Ensure that all moodle files are owned by the root user and are only readable by the web server user as follows:

chown -R root /path/to/moodle
chmod -R 0755 /path/to/moodle

Database setup

Next, in your designated database, you need to set up an empty database and a dedicated user with sufficient access.

For instance, in MySQL, the following mysql command line queries would suffice:

CREATE DATABASE <databasename> DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON <databasename>.* TO <username>@<dbhost> IDENTIFIED BY '<password>';

Note

You should not use the database root or admin account for security reasons.

You will need to take note of the following details for the installation process later:

  • dbhost: This is usually localhost, if on the same server as the Moodle site.

  • dbname: This is the name of the empty database.

  • dbuser: This is the username for the dedicated user.

  • dbpass: This is the password for the dedicated user.

Moodledata directory setup

You will also need to set up a dedicated file directory to hold all of the moodle files.

Note

This moodledata directory cannot be located within the moodle web directory or within the web server directory as otherwise this would be a security risk.

However, the web server needs write access to the moodledata directory as browser actions will generate data file creation, editing, and deletion.

Hence, use the following command lines in a suitable server directory:

mkdir <moodledatadirectoryname>
chmod -R 0777 /path/to/moodledatadirectory

Moodle installer

The moodle installer can be run in two ways:

  • Command line installer

  • Web installer

If running the command-line installer, it's advisable to run it as the web server user, for instance www-data for Ubuntu/Debian or apache for Centos.

Hence:

chown www-data /path/to/moodle
cd /path/to/moodle/admin/cli
sudo -u www-data /usr/bin/php install.php
chown -R root /path/to/moodle

The main configuration settings are the URL, the directory path to both the moodle code files and the moodledata files, and the database details. If in doubt, use the default settings and remember that these settings can be easily edited after the installation process if needed in the /path/to/moodle/config.php file. You will also need to supply an administrator account username with a secure password, which you need to retain permanently. If you lose this, it can be changed from the command line if required.

To run the web installer instead, go to your Moodle site's main URL within your browser and submit the same configuration settings as for the command-line version. Once the installer has finished, you will have access to your Moodle site.

Essential configurations

After the actual code and database installation, there are a number of systems that need to be configured to ensure the Moodle site is operating correctly. These are as follows:

  • Email

  • System paths

  • Cron

Email settings

Navigate to Administration | Site administration | Plugins | Message Outputs | Email.

Enter and save your SMTP settings as required to ensure that Moodle is able to send out e-mails. This is essential for functions such as email-based self-registration:

System paths

Navigate to Administration | Site administration | Server | System paths.

Enter and save your specified paths to ghostscript, du, aspell, and dot binaries:

Cron

Cron is essential to the processing of many Moodle background functions.

The moodle cron script is located at /path/to/moodle/admin/cli/cron.php.

This cron script needs to be scheduled in the server's own cron program for UNIX or Linux.

For instance, on Ubuntu/Debian servers, to edit the cron program:

  1. Use the command line:

    crontab -u www-data –e
    
  2. Do normal edits with standard vi commands.

  3. Add the line to the crontab:

    */1 * * * * /usr/bin/php /path/to/moodle/admin/cli/cron.php >/dev/null
    
  4. Adjust the exact time configuration as required, the above example runs once every minute.

  5. Alternatively, use this line to log the cron results for tracking, please note, this file will get very large.

    */1 * * * * /usr/bin/php /path/to/moodle/admin/cli/cron.php >> /path/to/moodledata/temp/cron.log 2>&1
    
  6. Then do Ctrl + O, to write, and then Ctrl + X to exit.

  7. The cron program will now be updated.

 

Updating Moodle


As mentioned earlier, Moodle HQ releases updates on a regular basis, which include bug fixes and security patches. Hence, it is important to know how to update the Moodle codebase to keep it secure.

Upgrading from one version to another

Note

Most importantly, any Moodle site older than 2.2 being upgraded to above 2.2 must be first upgraded to 2.2 completely, and then upgraded to 2.X.

Your first step is to create a copy of your live site and practice the upgrade process on it from the beginning to the end, ensuring that everything upgrades as expected.

Cloning your Moodle site

These are the recommended steps to create a clone of your Moodle live site:

  1. Moodle code directory: Create a brand new directory and fully copy all directories and files from the live moodle code directory into it, following the installation guidelines for its location and permissions.

  2. Moodle data directory: Create a brand new moodledata folder, again following the installation guidelines for its location and permissions.

  3. Database: The following are the steps to create a new database:

    1. Create a new database in your database application, again following the installation guidelines.

    2. Create a new database user with relevant permissions to the new database, again following the installation guidelines.

    3. Populate the new database from a full MySQL or other database dump file of the live Moodle database.

    4. For instance, to create a MySQL dump in normal command line:

      mysqldump -h localhost -u <dbuser> --password=<dbpass> -C -Q -e --create-options <dbname> > dbnameclone.sql
      
    5. This also requires you to ensure correct character encoding is used if needed as a MySQL dump is not 100% reliable for all UTF-8 encoding.

    6. To populate the new database with the dump file:

    7. Check you are in the correct new database in MySQL command line and only then use the following query:

      source dbnameclone.sql;
      
  4. Config.php: This urgently needs to be changed so edit this in the new moodle code directory to point to the new moodledata directory, the new database, and the new URL as it will initially have the settings to the live site, which urgently needs to be changed.

  5. The cloned site should now be operational.

  6. Login: Check that the clone site is accessible.

  7. Upload a file resource to check that the moodledata directory permissions and locations are all working correctly.

  8. Review a course and check that it appears as it should.

  9. Update your user profile with a minor change and check that the new values are in the new database, not the live database.

  10. There is also an admin tool on your Moodle site to find and replace any potential hard-coded URLs for resources such as images. This is located at admin/tool/replace/index.php. Please note that this will only work on sites, which use either MySQL or Postgres.

    Note

    The following upgrade steps should, therefore, be run firstly and completely on your cloned site and only then on your live site.

Upgrade preparation

Put your site into maintenance mode by navigating to Administration | Site administration | Server | Maintenance mode. This prevents non-admin users from logging into the site and altering any of its contents, such as course resources, submitting assignments, posting to forums, and so on.

Note

Any of these types of alterations will not only render your backups obsolete, but also compromise the integrity of the final upgraded site.

Before you start any upgrades, you need to take a full backup of your Moodle site. This involves three components:

  • moodle code directory: This may contain external plugins and other customized changes to core Moodle

  • moodledata directory: This contains all stored moodle data files, which the Moodle code relies on for course resources, log files, and so on

  • moodle database: This contains all database records related to the Moodle site

Moodle code directory

Take a full backup of this directory and also have a list of all external plugins and any core code customizations, which have been implemented.

Moodle data directory

Take a full backup of this directory. Its location is found in the config.php script.

Moodle database

Take a full MySQL dump of the relevant Moodle database. This also requires you to ensure correct character encoding used if needed as the MySQL dump is not 100 percent reliable for all UTF-8 encoding.

Moodle download

As with an initial Moodle installation, we always recommend that you download your Moodle code directly from https://moodle.org/. For this example, we will be updating to Moodle Version 2.8.

You can either download the ZIP file from https://download.moodle.org/ and unzip it, or use Git to pull the code from the Moodle Git repository.

  1. First of all, on your server, locate and go to the directory containing the moodle site directory which you are upgrading.

  2. Download and unzip the ZIP file from https://moodle.org/ or use the following Git command (for versions other than 2.8, use the relevant branch name):

    git clone -b MOODLE_28_STABLE git://git.moodle.org/moodle.git <directory>
    

    Note

    Please note that this will overwrite the existing data in the target moodle code directory with the latest 2.8 moodle code.

Once you have completed the updating of the Moodle code directory, you then need to complete the following steps:

  1. Where external plugins have more up-to-date code for your upgrade version, replace the older plugin code completely, which is explained more in Chapter 6, Managing Site Plugins.

  2. Where you have made previous customizations to core Moodle code (which is not a recommended practice for this exact reason!), you will need to locate each file in turn and manually add the customized code into them.

  3. Copy the config.php script from the backup into the target moodle code directory.

  4. Check that all the moodle code directories, subdirectories, and files are web server readable.

  5. Check that your usual cron usage is enabled, either that the admin/cron.php script is executable via the browser or more typically that the site is listed in the cron program for your server, which is explained more in Chapter 8, Miscellaneous Admin Tasks.

  6. Go to the notifications page by navigating to Administration | Site administration | Notifications to kick off the final upgrade process and click on Continue:

  7. Once the upgrade process has been completed, purge all caches by navigating to Administration | Site administration | Development | Purge all caches. This will ensure that the browser displays the latest Moodle site and not any cached information.

  8. Test the site fully according to your organization's requirements. We would suggest at a minimum:

    1. Login as Admin, teacher, and student

    2. Upload a file resource

    3. Review a course and its contents

    4. Update your user profile

  9. Take your site out of maintenance mode, if previously enabled, by navigating to Administration | Site administration | Server | Maintenance mode.

Maintaining the version code

Each Moodle version branch is updated weekly to ensure that all code is up-to-date, which may include fixes to recently discovered issues.

Hence, if your site is 2.8, it will also be a version of 2.8, for instance 2.8.3. If you decide to upgrade to a more recent version of 2.8, for instance 2.8.6, you should still follow the exact same procedure as we explained earlier for the upgrade process. This ensures that if there are any issues during the upgrade process, you have an easily accessible original version to instantly roll back to.

When to update

Moodle has minor releases every 2 months and major releases every 6 months. It is advisable to update with every minor release if possible, and at least yearly with a major release.

There is also a long-term support release (currently 2.7 and the next one is 3.0) that can offer the opportunity to only do a major update every 3 years.

 

Summary


In this chapter, we looked at the background of Moodle, its architecture, and the installation and upgrade process.

In the next chapter, we will look at the essential areas of user account management, creating users, editing users, and customizing user details as required.

Latest Reviews (4 reviews total)
Buen resumen de la tarea de administrador
good offer price and very useful for your e-books and videos
Moodle Administration Essentials
Unlock this book and the full library FREE for 7 days
Start now