Installing Moodle on Ubuntu


This is from a Document created by Navankur in Dec 2011 (with minor changes/additions) Use sudo where appropriate

Note: If multiple moodles have to be installed in a machine, then the following will not work for the second installation onwards. Also, a lot of installation steps would no longer be necessary, since all of them would have been completed for the first moodle. Go here for instructions
1) php -v (This checks if php is installed, and reports the version of the installation. Good to check this against the recommended php version required by moodle)

If php is not installed, you may get a message saying,If it is installed, or upon installation you should be able to see the version,
2) Find out if a lamp server is already installed on the machine. If lamp server is not installed, install it as,
tasksel install lamp-server
(If tasksel is not installed, you may have to install that as well.
sudo apt-get install tasksel)
This installation will ask for the mysql password. Note this somewhere!!

3) Install moodle as,
apt-get install moodle

4) Include universal package to the source.list file
/etc/apt/source.list
(A link describing what to add can be found here: http://www.debianadmin.com/adding-ubuntu-repositories.html)

5) apt-get update

6) apt-get dselect-upgrade
(This may install some new packages and upgrade existing packages.)

7) Reboot the system once the packages have been updated/installed.

8) Login to the Mysql database as,
mysql -u root -p

9) Create a database for moodle. (This database name should be noted down for later, when moodle asks for it during installation) if a database with name “moodle” does not already exist, you can create on with this name.

create database moodle default character set utf8 collate utf8_unicode_ci;

(If database already exists, then use update instead of create)

update database moodle default character set utf8 collate utf8_unicode_ci;

grant all privileges on moodle.* to moodle@localhost identified by ‘<password>’;
flush privileges;
exit;

Alternately, this can also be done from the phpmyadmin,

Installing other required packages,
10) apt-get install unzip zip aspell-en aspell-fr aspell-de aspell-es
11) apt-get install curl php5-curl php5-xmlrpc php5-intl
12) apt-get install clamav-base clamav-freshclam clamav

13) Downloading and untarring the latest moodle package:
Download the latest moodle package from moodle website – download.moodle.org

move the package to /var/www using mv. (you may also directly untar inside the folder instead of moving the tar file.)

cd /var/www
tar -xvf <package-name>

14) Change directory permissions of /var and /var/www/moodle to 777 from 755
chmod 777 /var
chmod 777 /var/www/moodle

15) Moodle Installation (on browser)
Open http://servername.la.asu.edu/moodle/index.php on a web browser
Follow the instructions on the page using default settings.
username: root
password: <password> //Note this password down.

Don’t select unix socket.

16) On the create admin account screen, enter settings and click continue

17) New settings – Front page settings.

Choose a full name and a short name.

18) Change back file permissions of /var and /var/www/moodle to 755 from 777
chmod 755 /var
chmod 755 /var/www/moodle

19) Use rsycn to move the moodledata directory from old server to the new server. (This may or may not be required – if you are doing a fresh installation, then this is not required. If this is a migration from one server to another, we need to do this.)

rsync /var/moodledata from old to new server

20) making moodle work with a hostname instead of localhost.
To make moodle work on a machine with static IP, edit the file,
/var/www/moodle/config.php

and change the entry wwwroot to hostname.la.asu.edu

21) Setting up CAS settings,

Hostname
weblogin.asu.edu
Base URIcas/
Port443
CAS protocol versionCAS 2.0
Languageenglish
Proxy mode
No
CAS logout option
Yes
Multi-authenticationYes
Server validation
No
Host URL
ldap://ds.asu.edu
Version2
LDAP encoding
utf-8
Distinguished nameuid=math_moodle_app,ou=ReadOnly,o=asu.edu
Passwordcheck with someone for this. This is important.
User type
Default
Contextsou=People,o=asu.edu
Search subcontexts
Yes
Dereference aliases
No

Some other references:
http://docs.moodle.org/20/en/Step-by-step_Installation_Guide_for_Ubuntu
https://help.ubuntu.com/community/MySQLMoodle
http://www.botskool.com/forum/computer-programming/linuxunix/install-moodle-ubuntu-1004

LAMP
http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/
https://help.ubuntu.com/community/ApacheMySQLPHP

Sidebar