Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: OLPC XS installation.

OLPC XS installation

From MoodleDocs
Revision as of 21:23, 17 December 2007 by Alex Lew (talk | contribs) (→‎Optional -- Set up SSH to operate remotely: additional information)

Install Moodle from the OLPC XS Image

Download and burn ISO image

Download the latest image from http://xs-dev.laptop.org/xs/OLPC_XS_LATEST.iso and burn it to a CD with your favorite disk burning program. You will find a limited amount of information at http://wiki.laptop.org/go/XS_Installing_Software. They specifically say that third party software like Moodle should be installed according to other installation instructions, so this is the attempt to provide those instructions.

Boot from the image to create the server on a fresh hard drive. If you have enough memory you can load the image to RAM first to speed installation. You may need to use fdisk to delete (DANGER) any old Windows partitions if you are creating a server from an old Windows machine.

You will install the software with the command:

./olpc-install

The whole installation process may take 10 minutes. You will need to enter a root password. If it displays a bunch of weird characters during installation, ignore that and just let it complete the installation.

Reboot to load the appropriate network hardware, etc.

reboot

Optional -- Set up Static IP Address

The server will be connected through DHCP to the network which will allow you to download the additional installation files. If you connect directly to the Internet through a static IP address, you will want to set up your information with the following interface:

/usr/sbin/system-config-network

If you are not using DHCP, you will probably also need to provide DNS information from your Internet Service Provider. Edit this file with your appropriate information.

nano /etc/resolv.conf

Optional -- Set up SSH to operate remotely

There is a more secure way to get a special key file to get access to the terminal on the server, but commenting out line "PasswordAuthentication no" lets you get access easily from a remote machine. You can then get access to the server through a ssh client like putty.

nano /etc/ssh/sshd_config

Comment out the second "PasswordAuthentication" as below. You should find it under "To disable tunneled clear text passwords, change to no here!"

PasswordAuthentication no

to

#PasswordAuthentication no

reboot to take effect

reboot

Install MySQL Database

This downloads and installs the MySQL Database(~20MB).

yum groupinstall "MySQL Database"

say yes download and to both requests for importing keys

Start the database

service mysqld start

run mysql

mysql

Set a more secure root password for the database

/usr/bin/mysqladmin -u root password 'mySecurePassword'

Note that on a secure production server, you will want to create a different user than root to access the database.

Now log in

mysql -u root -p

Enter your password

Create the Moodle database

mysql> CREATE DATABASE moodle;
mysql> exit

Have mysql start when booted

chkconfig mysqld on

Install php and other components

Now we download and install other required software for Moodle (about 8.4 MB)

yum install php php-mysql php-mbstring php-gd php-eaccelerator cvs

Get Moodle from CVS

Go to the directory where Moodle will be installed.

cd /var/www

Log in to the European Union CVS server (you can replace eu with uk, es, or us in these steps)

cvs -d:pserver:anonymous@eu.cvs.moodle.org:/cvsroot/moodle login

Press return to accept the blank password for anonymous access

Get the latest version of Moodle 1.9 (check for the most recent released version or the version you are most comfortable with. It may be earlier or later than 1.9 stable.

cvs -z3 -d:pserver:anonymous@eu.cvs.moodle.org:/cvsroot/moodle co -r MOODLE_19_STABLE moodle

Create a data directory and set Moodle directory permissions

Create a directory for user and course files (you should still be in the /var/www directory)

mkdir moodledata

Set permissions so that Apache can access the files

chown -R apache:apache moodle
chown -R apache:apache moodledata

On a production server, you will want to tighten up privileges further.

Change Apache to use Moodle as the web site

Note that the server comes with Apache running and looking at /var/www/html. But there is nothing in that folder, so one just gets a redirect. Edit as follows to have it point at Moodle instead:

nano /etc/httpd/conf/httpd.conf

On about line 280 of /etc/httpd/conf, change DocumentRoot "/var/www/html" to

DocumentRoot "/var/www/moodle"

On about line 305 of /etc/httpd/conf, change <Directory "/var/www/html"> to

<Directory "/var/www/moodle">

You can change other values like ServerAdmin and ServerName if appropriate. For all cases, you should restart Apache for changes to take effect.

service httpd restart

Setup Moodle

If only going to test Moodle on your internal network, just enter the local IP address as the web address. You can find the local IP address under DHCP by typing

ifconfig eth0

From a browser on another machine, enter

http:// ----- your web address -----
  • For User enter root
  • For Password, enter the password for the database entered in the earlier

Continue through the dialogs and select Unattended operation and set up the Moodle server.

Install cron

Moodle needs a periodic call to do maintenance work like sending out emails, cleaning up the database, updating feeds, etc. To run the cron every 10 minutes, do the following

Rather than learning vi, use the nano editor

export EDITOR=nano 

Edit the cron file

crontab -e

Add this line and save.

*/10 * * * * wget -q -O /dev/null http://localhost/admin/cron.php

Use CNTL-X to save

Next steps

You will probably want to install additional software like mediawiki etc. But this will give you a complete Moodle installation for use with the OLPC server.

Enjoy!

--Gary Anderson