Moodle currently available in the officially Ubuntu repository, but it still in version 1.9. On Ubuntu server 12.04.

 

Step 1: First, Make sure Apache2 web server, MySQL database and PHP5 (called LAMP Server) already installed on Ubuntu server 12.04.

sudo apt-get install lamp-server^

Step 2: Make sure LAMP server has been installed on Ubuntu Server 12.04.

sudo apt-get install lamp-server^ php5-intl

Step 3: Download the installation archive from the Moodle download page, download it using wget command

wget -O moodle-latest.tgz http://sourceforge.net/projects/moodle/files/Moodle/stable23/moodle-latest-23.tgz/download

Step 4: Extract moodle-latest.tgz and copy or move in to directory /var/www

tar -zxvf moodle-latest.tgz

sudo mv moodle /var/www

Step 5: Change an ownership of all Drupal installation files to user and group (www-data).

sudo chown -R www-data:www-data moodle/

Step 6: Create directory for moodle data, then set access directory moodle data to user and group (www-data)

sudo mkdir /var/moodledata

sudo chown -R www-data:www-data /var/moodledata

Step 7: Create a MySQL database for moodle installation. Log in to mysql server as root user

mysql -u root -p

Step 8: Create mysql database with name “dbmoodle”

CREATE DATABASE dbmoodle;

ALTER DATABASE dbmoodle charset=utf8;

 

Step 9: Create MySQL database user with username “moodleuser”

CREATE USER moodleuser;

Step 10: Set password for user “moodleuser”

SET PASSWORD FOR moodleuser = PASSWORD("moodlepass");

Step 11: Set privilege for “moodleuser”, and then log out from MySQL server

GRANT ALL PRIVILEGES ON dbmoodle.* TO moodleuser@localhost IDENTIFIED BY "moodlepass";

quit

 

Step 12: Now Moodle ready to install via web browser, open your favorite browser then navigate to [http://ipserver/moodle], and the installation can be completed in the browser.