Book Image

Moodle 2 Administration

Book Image

Moodle 2 Administration

Overview of this book

Moodle has evolved from an academic project to the world's most popular virtual learning environment. During this evolution, its complexity has risen dramatically and so have the skills that are required to administer the system.Moodle 2 Administration is a complete, practical guide to administering Moodle sites. It covers how to set up Moodle in any learning environment, configuration and day-to-day admin tasks, as well as advanced options for customizing and extending Moodle.The author, who has been administering systems for over 20 years, has adopted a problem-solution approach to bring the content in line with your day-to-day operations. The practical examples will help you to set up Moodle for large groups and small courses alike. This is a one-stop reference for any task you will ever come across when administering a Moodle site of any shape and size.
Table of Contents (24 chapters)
Moodle 2 Administration
Credits
About the Author
About the Reviewers
www.PacktPub.com
PacktLib.PacktPub.com
Preface

Installation via the Command Line Interface


Moodle 2 has introduced a Command Line Interface (CLI), which lets you perform a number of administrative tasks from the Unix shell prompt. There is no CLI for Windows-based systems. CLI-based installations are useful if you need to automate setups, for example, in an environment where you have to host multiple Moodle instances.

The CLI is not for the faint-hearted, so be careful when using it. You have to execute the installation script as the same user used for the web server, usually wwwroot or apache. You can run the installation script install.php in interactive mode (you will have to enter any parameters by hand) or in non-interactive mode, where the script will run silently.

From your dirroot, you can initiate the interactive script as follows:

sudo u www-root /usr/bin/php admin/cli/install.php

More interesting is the non-interactive mode as this can be used for scripting and automation purposes. The list of all available parameters is displayed using the --help command.

sudo u www-root /usr/bin/php admin/cli/install.php --help

An example command line would look like the following, where you will have to adjust the parameters to your local setup:

sudo -u www-root /usr/bin/phpinstall.php --wwwroot=http://123.54.67.89/moodle --dataroot=/var/moodledata/ --dbtype=mysqli --dbhost=localhost --dbname=moodle --dbuser=moodle --dbpass=Password123! --fullname=moodle2 --shortname=moodle2 --adminpass=Password123! --non-interactive --agree-license

There are more Moodle tasks that can be administered via the CLI, for example, resetting passwords or putting Moodle in maintenance mode. We will show the relevant syntax at the appropriate places throughout the book.

Note

If your installer crashes, you might have to increase your PHP memory_limit and post_max_size settings.