How to install Moodle 3.5 on Ubuntu 18.04

To install Moodle 3.5 on Ubuntu 18.04
Moodle is an open-source Learning Management System (LMS) and it has become one of the most popular LMSs among educators around the world as a tool for creating single robust, secure and integrated system that can help you create personalized learning environments and online courses as a dynamic website.In this tutorial, we will cover the installation of Moodle on Ubuntu 18.04.

Prerequisites
To install LAMP(Apache, MariaDB, php7)
In MariaDB (create database and user and give privileges to that user )

Php installation with required following modules

add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.0 php7.0-mysql php7.0-curl php7.0-json php7.0-cgi libapache2-mod-php7.0 php7.0-mcrypt php7.0-xmlrpc 
php7.0-gd php7.0-mbstring php7.0  php7.0-common  php7.0-xmlrpc php7.0-soap  php7.0-xml php7.0-intl  php7.0-cli  php7.0-ldap 
php7.0-zip php7.0-readline php7.0-imap php7.0-tidy php7.0-recode php7.0-sq php7.0-intl

Installation
Download a Moodle package using the following URL

root@linuxhelp1:~# wget https://download.moodle.org/download.php/direct/stable35/moodle-latest-35.tgz
--2018-06-05 10:24:17--  https://download.moodle.org/download.php/direct/stable35/moodle-latest-35.tgz
Resolving download.moodle.org (download.moodle.org)... 104.20.218.25, 104.20.219.25, 2400:cb00:2048:1::6814:da19, ...
Connecting to download.moodle.org (download.moodle.org)|104.20.218.25|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 46289797 (44M) [application/g-zip]
Saving to: ‘;moodle-latest-35.tgz’;

moodle-latest-35.tgz    100%[==============================>]  44.14M   841KB/s    in 42s     

2018-06-05 10:25:00 (1.04 MB/s) - ‘;moodle-latest-35.tgz’; saved [46289797/46289797]


After Downloading extract the downloaded package

root@linuxhelp1:~# tar -zxvf moodle-latest-35.tgz
moodle/
moodle/report/
moodle/report/performance/
moodle/report/performance/classes/
moodle/report/performance/classes/privacy/
.
.
moodle/blocks/calendar_upcoming/version.php
moodle/blocks/calendar_upcoming/lang/
moodle/blocks/calendar_upcoming/lang/en/
moodle/blocks/calendar_upcoming/lang/en/block_calendar_upcoming.php
moodle/blocks/calendar_upcoming/block_calendar_upcoming.php
moodle/behat.yml.dist

Move the extracted file into the HTML directory

root@linuxhelp1:~# mv moodle /var/www/

Navigate to the apache document root directory

root@linuxhelp1:~# cd /var/www/

Change ownership and permission of the as Moodle follows

root@linuxhelp1:/var/www# chown -R www-data.www-data moodle
root@linuxhelp1:/var/www# chmod -R 775 moodle

Create a new virtual host configuration for accessing the Moodle

root@linuxhelp1:/var/www# vim /etc/apache2/sites-available/moodle.conf
<VirtualHost *:80>
ServerName www.linuxhelp1.com
DocumentRoot /var/www/moodle/

<Directory /var/www/moodle/>
AllowOverride All
allow from all
</Directory>

</VirtualHost>

Enable site access

root@linuxhelp1:/var/www# a2ensite moodle.conf
Enabling site moodle.
To activate the new configuration, you need to run:
  systemctl reload apache2


Disable default access

root@linuxhelp1:/var/www# a2dissite 000-default.conf
Site 000-default disabled.
To activate the new configuration, you need to run:
  systemctl reload apache2

Enable rewrite module

root@linuxhelp1:/var/www# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
  systemctl restart apache2

Restart the apache service to make the changes effect

root@linuxhelp1:/var/www# systemctl restart apache2

Now you can proceed the further installation and configuration from the browser by navigating to the following URL: http://<ipaddress or domain name

Here we have to choose the language to use the Moodle CMS

Choose the installation paths

Create a new directory and set permission and ownership

root@linuxhelp1:/var/www# mkdir moodledata
root@linuxhelp1:/var/www# chown -R www-data.www-data moodledata
root@linuxhelp1:/var/www# chmod -R 775 moodledata


Restart the apache service to make the changes effect

root@linuxhelp1:/var/www# systemctl restart apache2

Choose the Database as shown below

Configure the Database setup as follows

Choose the installation as shown below

Add the following lines into config-> my.ini (xampp server) or open my.cnf (Apache server)

root@www:~# vim /etc/mysql/mariadb.cnf
[..]
[client]
default-character-set = utf8mb4

[mysqld]
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_large_prefix

character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
skip-character-set-client-handshake

[mysql]
default-character-set = utf8mb4
[..]

Restart the Mysql service to make the changes effect

root@www:~# systemctl restart mariadb

Verify the compatibility for installing Moodle as shown below

After the configuration, you will see the following page as shown below

Configure the Admin user setup

Configure the Site information as follows

After the Successful login, you will see the Admin dashboard of Moodle as shown below

You will see the Homepage of Moodle as shown below


With this, the method to install Moodle 3.5 on Ubuntu 18.04 comes to an end.

Tag : Moodle Ubuntu
Comment
sagarpawar
Oct 22 2018
vim /etc/apache2/sites-available/moodle.conf not working
Add a comment
FAQ
Q
What is Moodle?
A
Moodle is an open-source Learning Management System (LMS) and it has become one of the most popular LMSs among educators around the world as a tool for creating single robust, secure and integrated system that can help you create personalized learning environments and online courses as a dynamic website.
Q
Do I have to be really good with technology to use Moodle?
A
To use Moodle, you only need the basic web browsing skills. To install it you need a little more knowledge, but guidance is provided.
Q
Is Moodle just for online learning?
A
It can be. However, in most cases Moodle is used to support and combine face-to-face interaction with e-learning, m-learning and other forms of learning.
Q
How to resolve the database connection issue after moodle wizard setup?
A
Please provide valid Moodle Db credentials inside this /etc/mysql/mariadb.cnf.
Q
What is the latest version of Moodle?
A
You can always look for the latest releases of Moodle in https://download.moodle.org/download.php/direct/stable35/.