Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Moodle 2 Administration

You're reading from   Moodle 2 Administration Moodle is the world‚Äôs most popular virtual learning environment and this book will help systems administrators and technicians administer the system effectively. Based on real-world scenarios with plenty of screenshots, it‚Äôs an essential practical gui

Arrow left icon
Product type Paperback
Published in Oct 2011
Publisher Packt
ISBN-13 9781849516044
Length 420 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (24) Chapters Close

Moodle 2 Administration
Credits
About the Author
About the Reviewers
1. www.PacktPub.com
2. PacktLib.PacktPub.com
3. Preface
1. Moodle Installation FREE CHAPTER 2. The Moodle System 3. Courses, Users, and Roles 4. Course Management 5. User Management 6. Managing Permissions: Roles and Capabilities 7. Moodle Look and Feel 8. Moodle Plugins 9. Moodle Configuration 10. Moodle Reporting 11. Moodle Security and Privacy 12. Moodle Performance and Optimization 13. Backup and Restore 14. Installing Third-party Add-ons 15. Moodle Integration via Web Services 16. Moodle Networking Configuration Settings

Configuration reference an overview


The configuration file config.php contains a number of settings and variables that heavily influence how Moodle operates. It is located in the main directory of your Moodle system ($CFG->dirroot) and can be edited with any text editor.

Note

Be careful when modifying config.php! Moodle depends heavily on its content and any faults can cause the software to malfunction.

It is recommended that you create a backup of the config.php file before modifying it, so you can roll back to it in case of problems. Also, make sure that the file permissions are set properly as the file contains the database username and password. In a Linux environment, the owner and the group should be set to root, and the permissions should be set to 644.

The values in the config.php file that we are interested in are the ones that start with a dollar symbol. Each parameter has the following information format:

$<object>-><parameter> = <value>;

<object> is the part of Moodle in which the parameter is used ($CFG or $THEME). Third-party modules or custom distributions might have introduced their own objects; for example, $TOTARA. We will focus on $CFG objects as these are most relevant to administrators.

<parameter> is the name of the configuration setting. Each setting has a unique identifier.

<value> is the type of values the parameter accepts. This depends on the type of the setting. The following table provides the information for each of the key types:

Type

Moodle field

Values

Binary

Checkbox

True or 1 and False or 0.

Numeric

Number field

The number itself.

String

Text field

Text has to be surrounded by single quotes.

Password

Password field

Passwords have to be surrounded by single quotes.

List

Drop-down menu

Each value is represented by a number or a string. Unfortunately, there is no consistency for the allocation. For example, while the debug parameter accepts the values 0, 5, 15, 6143 and 38911, the sitemailcharset parameter accepts 0, EUC-JP and GB18030! The easiest way to find out what values are valid is to change the values in Moodle and check the config changes report (Reports | Config changes). Alternatively, you can check the mdl_config table in the database.

Array

Multi-select menu

The same applies as for the List type. Values are separated by commas. Again, check the config changes report to be on the safe side.

Each parameter has to be terminated by a semicolon. To comment out a parameter, precede it with two forward slashes.

Before we deal with the different types of settings, let's have a look at the number of tools that might be useful. As there is no list of available settings, you will have to generate your own. To do so, execute the following shell command in your $CFG->dirroot:

grep -r -h -o '\$CFG->[a-z][[:alnum:]_]*' . | sort-u

This will generate a list of all available $CFG variables in alphabetical order.

If you are experimenting with configuration variables, you might consider installing the Admin setting presets block, which lets users with the site configuration capability to export the site settings to .xml presets, import other sites .xml presets, load (totally or partially) presets settings, and rollback the applied changes if necessary. You can find more information about the tool at: docs.moodle.org/en/Admin_presets_block.

Moodle provides a report that lets you monitor all the changes to any configuration settings via the administration interface. You can find the report at Reports | Config changes:

Another tool that might be useful when dealing with configuration settings across multiple Moodle sites is called Moodle flavours. A flavour is a set of Moodle site settings, plugins, and language packs (docs.moodle.org/dev/Moodle_flavours).While its key objective is to package, distribute, and deploy the same settings and add-ons to multiple Moodle sites, it can also be used to back up and restore the configuration settings of your Moodle site. You can download the latest version of the plugin from moodle.org/plugins/view.php?plugin=local_flavours. Once installed (see Chapter 14, Installing Third-party Add-ons), you can select the settings to be packaged up in a flavour:

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image