How to install Moodle - CMS tool in Ubuntu
To Install Moodle in Ubuntu
Moodle is an open source CMS software that is used for creating E-learning websites, course materials, online tests, and many more related things. Its an efficient tool for both the teachers and learners, as its interface is simple to follow. This article covers the in-depth yet comprehensive installation procedure of Moodle.
Features
- User Friendly Interface
- Simple and intuitive text editor
- Rich Media Interaction
- Personalized Dashboards
- Abundant collaborative tools
- Contains built-in Wiki Module
- Supports Discussion Forums, Blogs, RSS feeds, etc.
To install LAMP server
In order to install Moodle in your Ubuntu, prior installation of LAMP server is necessary. It can be done by using the following command.
root@linuxhelp:~# apt-get install lamp-server^ -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting ' apache2-utils' for task ' lamp-server'
Note, selecting ' liblua5.1-0' for task ' lamp-server'
Note, selecting ' mysql-server-core-5.6' for task ' lamp-server'
Note, selecting ' mysql-server-5.6' for task ' lamp-server'
Note, selecting ' libaio1' for task ' lamp-server'
Note, selecting ' mysql-client-core-5.6' for task ' lamp-server'
Note, selecting ' libaprutil1' for task ' lamp-server'
Note, selecting ' libapache2-mod-php5' for task ' lamp-server'
Note, selecting ' php5-mysql' for task ' lamp-server'
.
.
.
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php5
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...
To download and extract the Moodle package
Once LAMP server is installed, change your current directory to the default document root of Apache to download Moodle package.
root@linuxhelp:~# cd /var/www/html/ root@linuxhelp:/var/www/html# wget https://download.moodle.org/download.php/direct/stable30/moodle-latest-30.tgz --2016-10-19 11:59:04-- https://download.moodle.org/download.php/direct/stable30/moodle-latest-30.tgz Resolving download.moodle.org (download.moodle.org)... 104.20.1.239, 104.20.0.239, 2400:cb00:2048:1::6814:1ef, ... Connecting to download.moodle.org (download.moodle.org)|104.20.1.239|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 38213274 (36M) [application/g-zip] Saving to: ‘ moodle-latest-30.tgz’ moodle-latest-30.tgz 100%[==========================================================================================> ] 36.44M 673KB/s in 58s 2016-10-19 12:00:04 (641 KB/s) - ‘ moodle-latest-30.tgz’ saved [38213274/38213274]
The Moodle package can be extracted with the help of tar command as given below.
root@linuxhelp:/var/www/html# tar -xzvf moodle-latest-30.tgz
moodle/
moodle/comment/
moodle/comment/classes/
moodle/comment/classes/external.php
moodle/comment/comment_ajax.php
moodle/comment/tests/
moodle/comment/tests/externallib_test.php
moodle/comment/comment.js
moodle/comment/index.php
moodle/comment/locallib.php
moodle/comment/lib.php
.
.
.
moodle/auth/db/db/install.php
moodle/auth/nologin/
moodle/auth/nologin/lang/
moodle/auth/nologin/lang/en/
moodle/auth/nologin/lang/en/auth_nologin.php
moodle/auth/nologin/version.php
moodle/auth/nologin/auth.php
Once the package is extracted, the user ownership and permissions for the Moodle directory has to be set.
root@linuxhelp:/var/www/html# chown -R www-data:www-data /var/www/html/moodle root@linuxhelp:/var/www/html# chmod -R 775 /var/www/html/moodle
Now create a data directory for Moodle and set the permission as follows.
root@linuxhelp:/var/www/html# mkdir /var/www/moodledata
root@linuxhelp:/var/www/html# chmod 777 /var/www/moodledata/
root@linuxhelp:/var/www/html# chown -R www-data:www-data /var/www/moodledata
To create user Database with MySQL
Keep track of the following process to create a user database for Moodle using MySQL.
root@linuxhelp:/var/www/html# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with or g. Your MySQL connection id is 2 Server version: 5.6.31-0ubuntu0.15.10.1 (Ubuntu) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ' help ' or ' h' for help. Type ' c' to clear the current input statement. mysql> create database moodledb Query OK, 1 row affected (0.03 sec) mysql> CREATE USER ' moodleuser' @' localhost' IDENTIFIED BY ' 123' Query OK, 0 rows affected (0.06 sec) mysql> GRANT ALL ON moodledb.* TO ' moodleuser' @' localhost' Query OK, 0 rows affected (0.00 sec) mysql> flush privileges Query OK, 0 rows affected (0.00 sec) mysql> exit Bye
To configure Virtual Host for moodle
It is necessary to configure Apache Virtual Host to access Moodle, and it can be done with the following command.
root@linuxhelp:~# vim /etc/apache2/sites-available/moodle.conf < VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/moodle ServerName linuxhelp.com ServerAlias www.linuxhelp.com < Directory /var/www/html/moodle/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all < /Directory> < /VirtualHost>
Once Apache Virtual Host is configured, create soft link for it as follows.
root@linuxhelp:~# ls -n /etc/apache2/sites-available/moodle.conf /etc/apache2/sites-enabled/
-rw-r--r-- 1 0 0 300 Oct 19 12:05 /etc/apache2/sites-available/moodle.conf
/etc/apache2/sites-enabled/:
total 0
lrwxrwxrwx 1 0 0 35 Oct 19 11:58 000-default.conf -> ../sites-available/000-default.conf
To install PHP extentions
Now it is required to install the PHP extensions for proper functioning of Moodle. Trigger the following command for the same.
root@linuxhelp:~# apt-get install php5-curl php5-gd php5-xmlrpc php5-intl -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
php5-curl php5-gd php5-intl php5-xmlrpc
0 upgraded, 4 newly installed, 0 to remove and 255 not upgraded.
Need to get 203 kB of archives.
After this operation, 793 kB of additional disk space will be used.
.
.
.
root@linuxhelp:~# apt-get install php5-curl php5-gd php5-xmlrpc php5-intl -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
php5-curl php5-gd php5-intl php5-xmlrpc
0 upgraded, 4 newly installed, 0 to remove and 255 not upgraded.
Need to get 203 kB of archives.
After this operation, 793 kB of additional disk space will be used.
Once PHP extensions are installed, restart the Apache service by setting off the following command.
root@linuxhelp:~# systemctl restart apache2
To install and configure Moodle
Once the previous procedures are completed, its time to install Moodle by calling the URL http://192.168.5.146/moodle on your browser.
you need to change your IP address or Hostname
Choose your desired language.
Choose the Database.
Configure the Database.
Create an user account
Configure your site as you desire.
Comments ( 0 )
No comments available