Difference between revisions of "Moodle"

From ArchWiki
Jump to: navigation, search
(Merge extension section)
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Web Server]]
 
[[Category:Web Server]]
 +
From [http://en.wikipedia.org Wikipedia]:
 +
:''[[Wikipedia:Moodle|Moodle]] (abbreviation for Modular Object-Oriented Dynamic Learning Environment) is a free source e-learning software platform, also known as a Course Management System, Learning Management System, or Virtual Learning Environment (VLE). ''
  
This article describes how to set up the Moodle server on an Arch Linux system.  
+
This article describes how to set up the Moodle server on an Arch Linux system. Usage is not covered. For more help visit [http://www.moodle.org its home page].
 
+
== What is Moodle ? ==
+
 
+
Wikipedia describes it well - Moodle : a Modular Object-Oriented Dynamic Learning Environment is a free and open-source e-learning  software platform, also known as a Course Management System, Learning Management System, or Virtual Learning Environment. It has a significant user base with 45,721 registered and verified sites, containing 32 million users in 3 million courses (as of January 2010)
+
 
+
This entry describes the installation, not the usage - a whole wiki in itself. For help generally, visit http://www.moodle.org
+
 
+
Note: almost all the commands here are done in admin mode, reached by the su command.
+
  
 
==Install the LAMP Stack==
 
==Install the LAMP Stack==
  
The instructions to install LAMP are [[LAMP|here]]
+
Follow the instructions to install LAMP [[LAMP|here]].
 
+
Follow the instructions and testing described in this section. From the "advanced options" section of the LAMP Documentation, install the libGD module. This involves install php-gd and modifying /etc/php/php.ini
+
 
+
For some reason when I install PHP into Apache it requires two restarts before test.php is interpreted as PHP code not text. I have noticed this before.
+
  
 
==Download and install Moodle==
 
==Download and install Moodle==
  
Download the most current version of Moodle from http://download.moodle.org/ - this installation was done with 1.9.7, and there may be minor changes to the install routine in later versions.
+
Download the most current version of Moodle from http://download.moodle.org/ - this installation was done with 2.3.1+, and there may be minor changes to the install routine in later versions.
  
I used the current weekly package moodle-weekly-19.tgz as recommended.
+
Unzip it into {{ic|/srv/http}}:
  
Unzip it into /srv/http (as root).
+
# tar xzvf moodle-latest-23.tgz -C /srv/http
  
tar xzvf /home/paulr/downloads/moodle-weekly-19.tgz -C /srv/http
+
Make it read/writeable by Apache:
  
Make it read/writeable by Apache
+
  # chown -R http:http /srv/http/moodle
 
+
  chown -R http:http /srv/http/moodle
+
  
 
==Preconfiguration==
 
==Preconfiguration==
Line 39: Line 27:
 
===File access===
 
===File access===
  
Edit /etc/php/php.ini
+
Add {{ic|/srv}} to {{ic|/etc/php/php.ini}}:
  
Before:
+
  open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/''':/srv/'''
  open_basedir == /srv/http/:/home/:/tmp/:/usr/share/pear/
+
After:
+
open_basedir == /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/
+
  
This allows PHP to access the /srv/moodledata directory (thanks to forum user "Ravenman") for this fix.
+
This allows PHP to access the {{ic|/srv/moodledata directory}} (thanks to forum user "Ravenman") for this fix.
  
 
===Create the MoodleData Directory===
 
===Create the MoodleData Directory===
  
This needs to be readable and writeable by Apache, so
+
This needs to be readable and writeable by Apache:
 
+
mkdir /srv/moodledata
+
chown http:http /srv/moodledata
+
 
+
===Enabling bits of PHP===
+
 
+
Install php-curl and openssl if they aren't already installed.
+
 
+
pacman -S php-curl openssl xmlrpc-c
+
 
+
uncomment the following lines in /etc/php/php.ini (remove the semicolon from the start of the line)
+
 
+
;extension==curl.so
+
;extension==iconv.so
+
;extension==openssl.so
+
;extension==xmlrpc.so
+
  
(note: these lines are not contiguous in the php.ini file)
+
# mkdir /srv/moodledata
 +
# chown http:http /srv/moodledata
  
additional requirement for Moodle 20
+
=== Configure PHP extension ===
  
uncomment the following lines in /etc/php/php.ini (remove the semicolon from the start of the line)
+
Install {{pkg|php-intl}} and {{pkg|php-gd}}:
 +
# pacman -S php-intl php-gd
  
;extension==json.so
+
Uncomment the following lines in {{ic|/etc/php/php.ini}} (remove the semicolon from the start of the line):
;extension==zip.so
+
;extension==soap.so
+
;extension==intl.so
+
  
  pacman -S php-intl
+
  extension=curl.so
 +
extension=gd.so
 +
extension=gettext.so
 +
extension=iconv.so
 +
extension=intl.so
 +
extension=mysqli.so
 +
extension=openssl.so
 +
extension=soap.so
 +
extension=xmlrpc.so
 +
extension=zip.so
  
 
===Restart Apache===
 
===Restart Apache===
Line 85: Line 62:
 
You now need to restart Apache to make these changes current. Note that if you get any errors while installing Moodle, and make subsequent changes, you will need to restart Apache after each set of changes.  
 
You now need to restart Apache to make these changes current. Note that if you get any errors while installing Moodle, and make subsequent changes, you will need to restart Apache after each set of changes.  
  
  /etc/rc.d/httpd restart
+
  # rc.d restart httpd
  
 
==Installation==
 
==Installation==
  
Go to http://localhost/moodle/install.php - this starts the Moodle installer. There then follows a sequence of configuration screens, most of which should be left at the defaults.
+
Go to {{ic|http://localhost/moodle/install.php}} - this starts the Moodle installer. There then follows a sequence of configuration screens, most of which should be left at the defaults.
  
 
*Select the language
 
*Select the language

Revision as of 00:44, 19 December 2012

From Wikipedia:

Moodle (abbreviation for Modular Object-Oriented Dynamic Learning Environment) is a free source e-learning software platform, also known as a Course Management System, Learning Management System, or Virtual Learning Environment (VLE).

This article describes how to set up the Moodle server on an Arch Linux system. Usage is not covered. For more help visit its home page.

Install the LAMP Stack

Follow the instructions to install LAMP here.

Download and install Moodle

Download the most current version of Moodle from http://download.moodle.org/ - this installation was done with 2.3.1+, and there may be minor changes to the install routine in later versions.

Unzip it into /srv/http:

# tar xzvf moodle-latest-23.tgz -C /srv/http

Make it read/writeable by Apache:

# chown -R http:http /srv/http/moodle

Preconfiguration

Some changes need to be made to the default setup so Moodle will work.

File access

Add /srv to /etc/php/php.ini:

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/

This allows PHP to access the /srv/moodledata directory (thanks to forum user "Ravenman") for this fix.

Create the MoodleData Directory

This needs to be readable and writeable by Apache:

# mkdir /srv/moodledata
# chown http:http /srv/moodledata

Configure PHP extension

Install php-intl and php-gd:

# pacman -S php-intl php-gd

Uncomment the following lines in /etc/php/php.ini (remove the semicolon from the start of the line):

extension=curl.so
extension=gd.so
extension=gettext.so
extension=iconv.so
extension=intl.so
extension=mysqli.so
extension=openssl.so
extension=soap.so
extension=xmlrpc.so
extension=zip.so

Restart Apache

You now need to restart Apache to make these changes current. Note that if you get any errors while installing Moodle, and make subsequent changes, you will need to restart Apache after each set of changes.

# rc.d restart httpd

Installation

Go to http://localhost/moodle/install.php - this starts the Moodle installer. There then follows a sequence of configuration screens, most of which should be left at the defaults.

  • Select the language
  • You should pass the first page of tests (PHP Settings). If not check you installed libGD, the most likely problem.
  • Leave the default locations as they are. An error here is likely to be a data directory problem - check the directory exists, that it has the right ownership and that open_basedir in /etc/php/php.ini is set correctly.
  • On the MySQL Screen, enter the user (root) and that user's password in the screen. If you get an error here, go to the test.php created when you set up the LAMP stack and check mysql is working, and also check the passwords.
  • On the Environment screen, you should pass all the tests - if not the errors give you a clue what is missing - an uninstalled program or a failure to uncomment one of the lines in /etc/php/php.ini
  • If you are English, you do not need to download language packs.
  • If the config.php has failed - probably because of lack of write access to the moodle subdirectory - the most likely reason is the ownership of the /srv/http/moodle structure which should be http:http - this was set earlier but you might have skipped that bit.
  • The remainder of the install should be automatic. It takes 2 or 3 minutes on my computer to set up all the SQL Databases and so on.
  • The final page allows you to set up the administrator user for Moodle. You need to enter a password, name and set the country as a bare minimum. Don't forget the password !

Happy Moodling !

See also

  • MySQL - Article for MySQL
  • LAMP - Self contained web-server that supports PHP, Perl, and MySQL

External links