Installation of Ubuntu Lamp Server Running Moodle2
Installation of Ubuntu Lamp Server Running Moodle2
&
Services
Hakeem Abass
ITM 2
Cork Institute of Technology
3/15/2011
th
Internet & Network Services Assessment 1 15 March 2011
Table of Contents
Introduction ..................................................................................................... 2
What is Moodle ................................................................................................................. 2
Procedure .......................................................................................................................... 2
Downloading & Installing Operating System .............................................. 3-5
Downloading Ubuntu......................................................................................................... 3
Installing Ubuntu ............................................................................................................ 4-5
LAMP Server Installation .......................................................................... 6-13
Login into Ubuntu server ................................................................................................... 6
Installing LAMP Server ................................................................................................ 6-7
Installing PHP5 Packages .................................................................................................. 8
Testing PHP ...................................................................................................................... 9
Restart Apache2 .............................................................................................................. 10
Install & test PHPmyadmin ....................................................................................... 11-13
Moodle Installation ................................................................................... 14-20
Downloading Moodle ..................................................................................................... 14
Unpacking Moodle ......................................................................................................... 15
Moodle data directory ...................................................................................................... 16
Ownership & Permissions ............................................................................................... 16
Restart Apache ................................................................................................................ 16
Install Moodle ................................................................................................................. 17
Moodle database set up ................................................................................................... 18
Configuration .................................................................................................................. 19
Administrator Account .................................................................................................... 20
Conclusion ...................................................................................................... 22
Reference ........................................................................................................ 22
Hakeem Abass-ITM2
1
th
Internet & Network Services Assessment 1 15 March 2011
1. INTRODUCTION
This document describes the installation of “Moodle", an Open Source Content Management
System on Ubuntu Linux so that it uses MySQL as the database. The default database system
is PostgreSQL. This project was carried out using Ubuntu 10.10. The installation was tested
using the latest Moodle application, “Moodle 2.0”.
The Moodle Installation procedure is backward compliance with the older versions of
Moodle, but not sure of future releases of Moodle.
What is Moodle?
2. PROCEDURE
This project was carried out using the VMware workstation cloud environment. From the
start I decided to simplify the installation process by dividing the process into 3 stages.
Hakeem Abass-ITM2
2
th
Internet & Network Services Assessment 1 15 March 2011
After downloading the ISO image successfully, you are now ready to start installation.
Hakeem Abass-ITM2
3
th
Internet & Network Services Assessment 1 15 March 2011
Fig. 2: Configuring and installing from the ISO image on the storage media. This procedure
is the same for Ubuntu server and desktop
Note: At this point, take note of the username and password that you provided, DONT
FOGET IT!
Hakeem Abass-ITM2
4
th
Internet & Network Services Assessment 1 15 March 2011
If finally your screen displays image as above and below, then you have successfully install
the base system and you are ready to go on to the next step of this project.
Hakeem Abass-ITM2
5
th
Internet & Network Services Assessment 1 15 March 2011
#sudo –i
You are then ask to provide your username and password you gave during the Ubuntu
installation
Then,
#apt-get update
#tasksel
Navigate to LAMP server by using the up & down and select the relevant application
and press ‘return’ on the keyboard to start the installation.
Hakeem Abass-ITM2
6
th
Internet & Network Services Assessment 1 15 March 2011
During the installation of the LAMP server you will be ask to provide root password
for MYSQL for „root‟ user, this is also important to remember for later use.
Hakeem Abass-ITM2
7
th
Internet & Network Services Assessment 1 15 March 2011
Install the package PHP5-GD & PHP5-CURL which are required by Moodle.
Hakeem Abass-ITM2
8
th
Internet & Network Services Assessment 1 15 March 2011
#cd /var/www
#nano /var/www/info.php
<?php
Phpinfo();
?>
Hakeem Abass-ITM2
9
th
Internet & Network Services Assessment 1 15 March 2011
Type,
#/etc/init.d/apache2 restart
#cd
Then type,
Hakeem Abass-ITM2
10
th
Internet & Network Services Assessment 1 15 March 2011
http://ipaddress
If the Apache is running fine you should see a page as shown below;
http://ipaddress/info.php
To test the PHP 5 is working, then you should see as shown below;
Hakeem Abass-ITM2
11
th
Internet & Network Services Assessment 1 15 March 2011
During the installation you will be asked to provide password for the user admin.
Hakeem Abass-ITM2
12
th
Internet & Network Services Assessment 1 15 March 2011
http://ipaddress/phpmyadmin
Hakeem Abass-ITM2
13
th
Internet & Network Services Assessment 1 15 March 2011
Installation Steps
Download from Website the latest Moodle build.
Extract the Zipped file.
Make Moodle‟s data directory
Change ownership and permissions for Moodle and moodledata directories.
Restart Apache.
Run & Install Moodle
Set up Moodle Database.
Moodle configuration
Hakeem Abass-ITM2
14
th
Internet & Network Services Assessment 1 15 March 2011
On clicking the „.zip‟ file, you will be redirected to the „sourceforge.net, download website
note down the URL as shown below, because you will be using a powerful Linux tool to get
the download from this website into the server.
Next, power on the Ubuntu Server, and make sure you are in „root‟ directory,
Then type
„wget‟ is the tool e will use to get Moodle from the sourceforge.net‟ website and from „root‟
directory type;
#cd /var/www
The Moodle folder should be downloaded into this directory. Now get Moodle, type;
# wget http://sourceforge.net/projects/moodle/files/Moodle/stable20/moodle-latest-20.zip
Hakeem Abass-ITM2
15
th
Internet & Network Services Assessment 1 15 March 2011
#unzip moodle-latest-20.zip
At this stage you now have in this directory two files when you issue the list command
#ls
As shown below;
#cd /var
#mkdir moodledata
Still in the „var‟ directory, change ownership & permissions on the „moodledata‟;
#cd /var/www
To go to „www‟ directory to change ownership & permissions on the „Moodle‟ folder;
#cd
To go back to „root‟ directory, then;
#/etc/init.d/apache2 restart
Hakeem Abass-ITM2
16
th
Internet & Network Services Assessment 1 15 March 2011
Select Language
Select the language you want. The default is English click on "next”.
Configuration Completed
The program now writes a config file to your system. If this step fails, try doing the sudo
chmod 777 /var/www/moodle command again, as above. Click on 'Next'
Hakeem Abass-ITM2
17
th
Internet & Network Services Assessment 1 15 March 2011
Locations
The next page sets the locations of the moodle installation. These should be/var/www/moodle
and /var/moodledata (the last one is the directory you created above).
Click on next. If this fails, check you set up the /var/moodledata directory as above.
#mysql –u root –p
You will ask to enter your mysql password you enter earlier, and you are the MYSQL prompt
local client, now create the database by typing;
Check on the phpmyadmin, to see if the Moodle database is created, then create user „admin‟;
Hakeem Abass-ITM2
18
th
Internet & Network Services Assessment 1 15 March 2011
Hakeem Abass-ITM2
19
th
Internet & Network Services Assessment 1 15 March 2011
Fig. 25: User created with all the privileges on Moodle Database
This sets the moodle database to be useable by the MySQL user admin with the password 82-
----. This can be changed to any values you like. The quotes around the end are required,
because you will get a database error when you try to start Noodle for the first time.
Hakeem Abass-ITM2
20
th
Internet & Network Services Assessment 1 15 March 2011
Welcome to Moodle
You now have an up and running Moodle server.
Hakeem Abass-ITM2
21
th
Internet & Network Services Assessment 1 15 March 2011
6. Conclusion
This project was intend to teach individual on the advantages of having an application
running on Ubuntu server. The major thing I learnt is how to install and make an application
run on a server securely with the administrator with full permission and ownership.
I was able to install a lot of application free while using the Ubuntu command line interface.
7. REFERENCE
http://moodle.org/
http://www.ubuntu.com/
Hakeem Abass-ITM2
22