E-Learning with Moodle
Helping Hand
The Moodle course management system is useful for e-learning and for practical work in the computer room.
E-learning comes in all shapes and sizes: Besides online-only approaches that attempt to disseminate all of the content in a training or study program via the Internet, hybrid approaches that include standard classroom teaching are also available. Such hybrid approaches are often referred to as "blended learning." However, software that supports e-learning needs to do more than just offer a collection of data and user management features for a course.
Moodle [1] is a course management system (CMS, or Learning Management System, LMS) that was originally developed by computer scientist and educator Martin Dougiamas on the bases of various didactic considerations.
Rather than focusing on file management, the software concentrates on course design and gives trainers, teachers, and lecturers numerous options for adding interactive elements to their courses, including group (home) work and tests.
Some of Moodle's really useful features are elements, such as glossaries or wikis, that trainers can link to with tasks for their students. One task could be to create five new glossary entries, for example. This means that the students add to the knowledge base stored on the learning system. After being checked by the trainer, the new entries could be added to the general knowledge pool, which is available to all participants and can be reused in later courses.
Moodle Installation
Moodle requires a working web server – typically Apache 2.x on most systems – and you need to create a new domain in the Apache configuration or modify the settings of an existing domain by adding a /moodle subdirectory.
Many Moodle installations contain normal web content besides the LMS; in this case, it makes sense to use a subdirectory. If you do not have any additional content for the domain, you can create an Apache rewrite rule to jump directly from the root directory to the /moodle directory.
Listing 1 shows a sample Apache configuration for a fictive new domain named moodletest.local. Incidentally, the rewrite engine will not work on openSUSE unless you add the rewrite module to the APACHE_MODULES variable in /etc/sysconfig/apache2.
Listing 1
Sample Configuration
# moodletest.local.conf <VirtualHost *> ServerName moodletest.local ServerAlias www.moodletest.local DocumentRoot /var/www/moodletest.local # you only need the next two lines if you have no # content apart from the Moodle system RewriteEngine On RewriteRule ^/$ /moodle/ [R] ErrorLog /var/log/apache2/moodletest.local/error.log CustomLog /var/log/apache2/moodletest.local/access.log Combined </VirtualHost>
The virtual host file should be located in /etc/apache2/sites-available for Debian systems, and you will need to link from /etc/apache2/sites-enabled. OpenSUSE users can simply copy the file to the /etc/apache2/vhosts.d/ folder and add a .conf file suffix to let the server find it. If you are testing the installation on your home computer, you will need an entry in /etc/hosts like
127.0.0.1 moodletest.local
to be able to use this hostname in the web browser later. To create a directory for the Apache logfiles, enter mkdir -p /var/log/apache2/moodletest.local at the command line.
Debian users run apt-get to install the php4-gd, libgd-gd2-perl, mysql-server- 5.0, php4-mysql, and php4-curl packages and then configure the MySQL server:
# dpkg-reconfigure mysql-server-5.0
On openSUSE 11.1, you must set up the required software by running zypper to install the php5, php5-gd, mysql, apache2-mod_php5, php5-mysql, php5-curl, php5-mbstring, php5-openssl, php5-xmlrpc, and php5-zlib packages. When you've finished that step, enable the MySQL server by entering the following command:
# rcmysql start; mysqladmin -u root password password
The server should be running now, and you have already assigned a root password.
MySQL Database for Moodle
Next, create a MySQL database named moodle and grant access to a moodle user account with the password moo!dle. In Listing 2 you will see the commands needed to do this. Then you can reparse the configurations for Apache and MySQL by entering /etc/init.d/apache2 reload and /etc/init.d/mysql reload.
Listing 2
Creating a MySQL Database
# mysql -u root -p mysql> create database moodle; Query OK, 1 row affected (0.00 sec) mysql> grant all on *.* to 'moodle'@'localhost' identified by 'moo!dle'; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye
The commands in Listing 3 install Moodle in the subdirectory /var/www/moodletest.local/. If you prefer to use a different folder, you can modify the path here and in the following steps.
Listing 3
Installing Moodle in a Subdirectory
$ export WEBROOT= /var/www/moodletest.local $ mkdir -p $WEBROOT; cd $WEBROOT $ wget http://download.moodle.org/ stable19/Umoodle-weekly-19.tgz $ tar xzf moodle-weekly-19.tgz
Moodle needs a data directory that defaults to /var/www/moodledata. The user account on which Apache is running needs read and write access for this directory. To identify the user ID under which the web server is running, check the process list for apache or httpd (Listing 4, lines 1 through 3). The first Apache process always runs as root, so ignore it. In the example here, which uses a Debian system, the correct user account is www-data; other distributions run Apache as wwwrun. Now you can set up the moodledata directory (Listing 4, lines 4 through 6).
Listing 4
Setting Up the moodledata Directory
Moodle Setup
To start the web-based configuration, open the http://moodletest.local/moodle page in your web browser. If needed, you can select a language on the first page of the dialog. Continue takes you to the second page, where Moodle checks the PHP configuration and displays the results. For all of these topics, you should see Success in green type. Continue through the following dialogs by pressing Continue.
The next step is to define where you want Moodle to store its data (Figure 1). If you are following the recommendations from this example, the default (/var/www/moodledata) will do just fine. If you are running independent Moodle installations parallel to one another, you need to change this. The web address, http://moodletest.local/moodle in this example should be okay, too – after all, you have to enter the right address to call the configuration interface.
Moodle will prompt for the login credentials for the MySQL database (Figure 2). Here, I created a database user moodle with the password moo!dle; you can accept the default server name, localhost. If you are using a remote MySQL server instead of the local server used in this example, you will need to enter the correct server name here.
Next, accept the default database name moodle and the table prefix mdl_. A prefix on all of your table names makes it easier to use the tables of multiple Moodle versions (and any other applications you might be using) on a single database. Of course, this only makes sense if you do not have sufficient privileges to create another MySQL database.
The next dialog displays the results of various checks: You should see OK in the Status column on the right. The next page is for information purposes only. The installer creates a config.php file in the root directory of your Moodle installation; this is /var/www/moodletest.local/moodle/ here. Caution: The database password is in cleartext.
Now accept the terms of the GPL license for Moodle; again, you can let the installer handle all of the steps that follow automatically. To do so, check Automatic setup. This removes the need to keep clicking to get to the next page. The following steps can take some time, and the status messages could fill the screen multiple times.
Finally, you will end up on the Setup administrator account page where you can set up a Moodle account for the administrator of the new system (Figure 3). The important things here are the login name and password – Moodle will suggest a username of admin. Also, you need to fill in some of the other fields, although you can leave the optional entries for later.
The installation continues with information about the new Moodle page (Figure 4). Here, you can enter long and short page identifiers and, if needed, add a short piece of text for the start page.
Switching the Self-registration from Disable to Email-based self-registration allows users of your Moodle page to register with the system. This assumes that your computer has Sendmail, Postfix, or some other mail daemon and can dispatch mail; as an alternative, you can set up access to a remote SMTP server for dispatching mail. At the end of the page, you can accept the changes by clicking Save Changes. This action completes the setup and takes you to the start page – as the administrator (Figure 5).
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.