Book Image

Moodle 3 Administration - Third Edition

By : Alex Büchner
Book Image

Moodle 3 Administration - Third Edition

By: Alex Büchner

Overview of this book

Moodle is the de facto standard for open source learning platforms. However, setting up and managing a learning environment can be a complex task since it covers a wide range of technical, organizational, and pedagogical topics. This ranges from basic user and course management, to configuring plugins and design elements, all the way to system settings, performance optimization, events frameworks, and so on. This book concentrates on basic tasks such as how to set up and configure Moodle and how to perform day-to-day administration activities, and progresses on to more advanced topics that show you how to customize and extend Moodle, manage courses, cohorts, and users, and how to work with roles and capabilities. You’ll learn to configure Moodle plugins and ensure your VLE conforms to pedagogical and technical requirements in your organization. You’ll then learn how to integrate the VLE via web services and network it with other sites, including Mahara, and extend your system via plugins and LTI. By the end of this book, you will be able to set up an efficient, fully fledged, and secure Moodle system.
Table of Contents (24 chapters)
Moodle 3 Administration Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuration reference: system settings


This is the actual reference for configuration settings. The following explanations have been taken from help pages, forum posts, and comments in source code.

Default parameters

These are settings that have been created by the installer, derived from config-dist.php. Most parameters are compulsory in order for Moodle to operate, so be careful when changing any of them. The parameters are listed in the order in which they appear by default in config.php:

Parameter

Description

$CFG->dbtype (String)

The database system that is used. The four valid values are mysql (MySQL), pgsql (Postgres), mssql (MS SQL Server), mariadb (MariaDB), and oci (Oracle).

$CFG->dblibrary (String)

Currently only native is allowed as an entry.

$CFG->dbhost (String)

The name of the database host. localhost or 127.0.0.1 (if the database is located on the server); as Moodle or any other URL (resolved or unresolved), if located on another server.

$CFG->dbname (String)

The name of the database.

$CFG->dbuser (String)

The username of the database account.

$CFG->dbpass (String)

The password of the database account.

$CFG->prefix (String)

By default, all tables in Moodle are prefixed with mdl_. This should only be changed if you run multiple Moodle installations using the same database.

$CFG->dboptions (Array)

Values that determine database behavior: dbpersist (whether an existing database connection can be reused to improve performance, potentially decreasing stability); dbsocket (when a UNIX socket is used); and dbport (a TCP port if different from default).

$CFG->wwwroot (String)

This is the full web address (including http://) where Moodle has been installed.

$CFG->dataroot (String)

This is the absolute directory name where Moodle's data dictionary is located. The directory has to be readable and writable, but must not be accessible via the Web.

$CFG->admin (String)

The admin pages in Moodle are located in the admin directory. If this has to be changed then specify the new directory here as some ISPs don't allow its usage. This approach can also potentially help secure the site from attacks.

$CFG->directorypermissions (Special)

These are the permissions (in Unix format) that are applied for directories Moodle is creating. The default is 0777 (rwx).

Optional parameters

Almost 400 parameters set in config.php are not set by the installer, nor can they be modified via the Moodle administrator interface. These optional parameters allow you to modify the behavior of Moodle without the requirement to change any code.

We only cover a representative list of settings, ignoring those that are only relevant to developers and designers. We have also disregarded obsolete and obscure parameters, as well as ones that have a counterpart in the admin settings. Parameters have been listed in alphabetical order and some have been grouped together for simplicity. Available types are array (A), binary (B), numeric (N), list (L), and string (S):

Name

Type

Description

admineditalways

B

Set to true; enables admins to edit any post at any time.

amf_introspection

B

Security setting for the AMF web service protocol.

apacheloguser

N

Logging Apache: 0=off, 1=user id, 2=full name, 3=username.

apachemaxmem

N

Memory threshold over which Apache children will be reaped after they finish serving the request.

bounceratio

N

Default is 20. See $CFG->handlebounces.

customfiletype

A

Adding entries to Server | File types, for instance

$CFG->customfiletypes = array(
    (object)array(
        'extension' => 'mobi',
        'icon' => 'document',
        'type' => 'application/x-mobipocket-ebook',
        'customdescription' => 'Kindle ebook'
    )
);

customfrontpageinclude

S

You can replace the front page with your own version; https://moodle.org/ uses this approach. Only the center area will be replaced—not the header, footer, or blocks.

customscripts

S

Enabling this will allow custom scripts (to be specified with the full path name) to replace existing Moodle scripts. For example, if $CFG->customscripts/course/view.php exists then it will be used instead of $CFG->wwwroot/course/view.php. At present this will only work for files that include config.php and are called as part of the URL (index.php is implied). Custom scripts should not include config.php.

Warning: Replacing standard Moodle scripts may pose a security risk and/or may not be compatible with upgrades. However, this is useful when having to patch a particular page without actually overwriting the core code.

debugusers

S

Comma-separated list of user IDs that always see debug messages.

defaultblocks

A

Default block variables for new courses—for instance, participants, activity_modules, search_forums, admin, course_list, news_items, calendar_upcoming, recent_activity. This setting can be overridden for different course types, such as defaultblocks_social, defaultblocks_weeks, and defaultblocks_topics.

dirroot

S

The absolute directory name where Moodle has been installed.

disablemycourses

B

This setting will prevent the My Courses page being displayed when a student logs in. The site front page will always show the same (logged-out) view.

disableonclickaddoninstall

B

Disables the on-click plugin installation feature and hides it from the server administration user interface.

disablestatsprocessing

B

Prevents stats processing and hides the GUI.

disableupdateautodeploy

B

Disables update deployment. Useful when deployment is done via Git checkouts.

disableupdatenotifications

B

Disables update notifications. Useful when deployment is done via Git checkouts.

disableusercreationon

restore

B

Completely disables user creation when restoring a course. Enabling this setting results in the restore process stopping when a user attempts to restore a course requiring users to be created.

divertallemailsto

S

Divert all outgoing e-mails to this address to test and debug emailing features.

emailconnectionerrorsto

S

E-mail database connection errors to someone. If Moodle cannot connect to the database, then e-mail this address with a notice.

filedir

S

You can specify an alternative to dataroot.

filelifetime

N

Seconds for files to remain in caches (default is 86400 = 24 hours). Decrease this if you are worried about students being served outdated versions of uploaded files.

filepermissions

 

Same as directorypermissions in the default parameters, but for created files.

forced_plugin_settings

A

Plugin settings have to specified as an array of arrays:

array('plugin1' => array('param1' => 'value1', ('param2' => 'value2', …), ('plugin2' => array('param1' => 'value1', ('param2' => 'value2', …), …);

forcedefaultmymoodle

B

If set, the My Moodle page cannot be customized by users.

forcefirstname

forcelastname

S

To anonymize user names for all students. If set, then all non-teachers will always see this for every person.

gradeoverhundredprocentmax

N

If unlimitedgrades is set, you can specify a maximum value (1 = 100%, default = 10).

handlebounces

B

This is for handling e-mail bounces. Used in conjunction with minbounces and bounceratio.

httpswwwroot

S

wwwroot for SSL pages.

includeuserpasswordsin

backup

B

Allows user passwords to be included in backup files. Use only if you can guarantee that all your backup files remain private as password hashes can be unencrypted.

keeptempdirectorieson

backup

B

Keeps the temporary directories used by backup and restores them without being deleted at the end of the process. See also the Managing courses in bulk section in Chapter 4, Course Management.

langlocalroot

S

Alternative directory to $CFG->dataroot/lang.

maildomain

S

Your e-mail domain.

mailprefix

S

mdl+ is the separator for Exim and Postfix, mdl- is the separator for qmail.

minbounces

N

Default is 10. See $CFG->handlebounces.

mnetkeylifetime

N

Number of days when the networking key expires. See Chapter 16, Moodle Networking, for details.

noemailever

B

When working with production data on test servers, no e-mail or other messages should ever be sent to real users.

opensslcnf

S

Location of the openssl.cnf file.

passwordsaltmain

S

Random string added to the md5 password hash. See Chapter 11, Moodle Security and Privacy, for details.

preferlinegraphs

B

This setting will make some graphs (for instance, user logs) use lines instead of bars.

preventscheduledtaskchanges

B

Disables editing of tasks in Server | Scheduled tasks.

reverseproxy

B

Enable when setting up advanced reverse proxy load-balancing configurations and port forwarding.

showcrondebugging

B

Adds debug info to cron output.

showcronsql

B

Show executed SQL queries during cron execution

skiplangupgrade

B

Disables automatic language update and lets translators (lang pack maintainers) keep their moodledata/lang/* to update manually.

sslproxy

B

Enable when using external SSL appliance for performance reasons.

supportuserid

N

E-mails to supports can be redirected to another user.

tagsort

S

Sorts tags in a tag cloud by a specified field, default = 'name'.

themedir

S

Adds an extra theme directory outside $CFG->dirroot.

themeorder

A

Priority of themes from highest to lowest. Default is array('course', 'category', 'session', 'user', 'site').

themerev

B

Prevents theme caching.

tracksessionip

B

Moodle will track the IP of the current user to make sure it hasn't changed during a session. This will prevent the possibility of sessions being hijacked via XSS, but it may break things for users using proxies that change all the time (such as AOL).

trashdir

S

Alternative location for $CFG->dirroot/trashdir.

undeletableblocktypes

A

The blocks in this list are protected from deletion—for example, navigation, settings.

upgradekey

S

Password protection during the upgrade process. See https://docs.moodle.org/en/Upgrade_key for details.

upgraderunning

B

Pretends a Moodle update is running.

upgradeshowsql

B

Shows executed SQL queries during upgrades.

usepaypalsandbox

B

For testing PayPal using the PayPal developer sandbox.

usezipbackups

B

Use ZIP compression in backups instead of the default TGZ.