Search icon CANCEL
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 3 Administration, Third Edition

You're reading from   Moodle 3 Administration, Third Edition An administrator's guide to configuring, securing, customizing, and extending Moodle

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher
ISBN-13 9781783289714
Length 492 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alex Büchner Alex Büchner
Author Profile Icon Alex Büchner
Alex Büchner
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

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 Logging and Reporting 11. Moodle Security and Privacy 12. Moodle Performance and Optimization 13. Backup and Restore 14. Moodle Admin Tools 15. Moodle Integration 16. Moodle Networking A. Configuration Settings Index

Installation via the Command Line Interface

Moodle provides 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 www-data 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-data /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 the available parameters is displayed using the --help command:

sudo –u www-data /usr/bin/php admin/cli/install.php --help
Installation via the Command Line Interface

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

sudo -u www-data /usr/bin/php admin/cli/install.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.

Tip

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

You have been reading a chapter from
Moodle 3 Administration, Third Edition - Third Edition
Published in: Feb 2016
Publisher:
ISBN-13: 9781783289714
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 €18.99/month. Cancel anytime