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

OLPC XS (One Laptop per Child School Server)is designed to complement the XO laptop. It is a Linux-based OS (a Fedora-based distribution) engineered to be installed on generic low-end servers.

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. These instructions are written from build 160 available since March 11, 2008. 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. Note that Moodle Guru Martin Langhoff is now architect of the XS Server software, so Moodle will probably have a more central role in the OLPC project in the future.

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 from the hard drive and to load the appropriate network hardware, etc.

reboot

Assign password and disable dhcp server

When the booted from the hard drive (this may take a longer time if you have a static IP address to set -- it is expected to be assigned an address), login using root as the user and your password that you set at installation. Because of a bug, you will need to reset the root password using this command:

passwd

Also, the XS is set up as a dhcdp server to assign network addresses to XO laptops. Unless you need such a server, disable it with this command so it does not mess up your development network.

chkconfig dhcpd off


Optional -- Set up Static IP Address

The server will be connected to the network locally by getting an IP address through your 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

With a static address, 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 php, MySQL and other needed components

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

yum install mysql-server php php-mysql php-mbstring php-gd php-eaccelerator php-xmlrpc php-imap cvs

Setup MySQL Database

First, start the MySQL database

service mysqld start

Set a 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 CHARSET 'utf8';
mysql> exit;

Have mysql start when booted

chkconfig mysqld on

Get Moodle from CVS

Go to the directory where Moodle will be installed.

cd /var/www

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. Use the European Union CVS server (you can replace eu with uk, es, or us in this step)

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 changes, you should restart Apache for the new settings to take effect.

service httpd restart

Setup Moodle

If you are 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


If you have a web address that points to your server, use that instead.

From a browser on another machine, enter

http:// ----- your web address -----
  • For the database user, enter root
  • For Password, enter the password for the database that you created 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

Other recommended settings

A few standard settings should be adjusted to take full advantage of server memory and hard drive space. These recommendations assume at least 1GB of RAM and plenty of hard drives space for all your users.

First, change the amount of memory for caching scripts in eaccelerator. Experience dictates that this should be between 40 and 60 megabytes.The OS default is only about 32 MB, so if you do not change this setting, some of your scripts will not be cached in memory.

nano /etc/php.d/eaccelerator.ini

Change the size of "0" (which uses the default) to about 64.

eaccelerator.shm_size = "64"

Next, make three changes to php.ini

nano /etc/php.ini

This will allocated more memory and allow files to be uploaded up to 80MB. This should be enough for most multi-media files. Hard drive space is cheap and the default is only 2MB. It is recommended that you change the settings to the following values:

memory_limit = 40M
post_max_size = 80M
upload_max_filesize = 80M

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.

See also