How-to Install MOODLE 3.11 on UBUNTU 20.04 LTS Server
Tux, in creative commons
During the pandemic, the question on how education can continue with the different "lockdowns" in placed in different areas of our country became a question.
MOODLE, or the "Modular Object-Oriented Dynamic Learning Environment." Being an open-source solution, became a primary candidate for our institution as the Learning Managment System, (LMS) of choice.
Thus, being the systems and network administrator, it became my task to deploy this LMS from one of our server machines, and work on it remotely at home.
Here's the how-to on how I deployed this service on one of our server machines.
A. Install Ubuntu 20.04 server
Since this will be running on a virtual server, the server of choice needs to be minimal, thus my choice of ubuntu 20.04. (Note that this was in 2020, and the Ubuntu server with Loong term support then was version 20.04.
B. Install LAMP Stack on your newly installed Ubuntu Server
I have chosen the Linux, Apache, MySQL, and Php stack for this deployment since this is the simplest of at the time, although Php 8.1 was the default version and needs to be changed after deployment given that MOODLE 3.11 can only run on 7.4.
C. Install Phpmyadmin
For easy management of MySQL, Phpmyadmin was included.
- sudo apt update
- sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
- select apache2 when asked to select.
- sudo phpenmod mbstring
- sudo systemctl restart apache2
- sudo mysql
- ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword'; (change 'mynewpassword' to a password of your choice)
- on a web browser check if you can access the newly installed phpmyadmin by typing https://your_domain_or_IP/phpmyadmin
D. Install MOODLE 3.11
D.1 Change php version
- sudo apt update && sudo apt upgrade
- php -v
- sudo add-apt-repository ppa:ondrej/php
- sudo apt-get update
- sudo apt install php7.4 libapache2-mod-php7.4
- sudo update-alternatives --config php, select php 7.4
- sudo a2dismod php8.1
- sudo a2enmod php7.4
D.2 Install additional php packages
- sudo apt install graphviz aspell ghostscript clamav php7.4-pspell php7.4-curl php7.4-gd php7.4-intl php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-ldap php7.4-zip php7.4-soap php7.4-mbstring git
- sudo systemctl restart apache2
D.3 Download MOODLE 3.11
- cd /etc/opt
- sudo git clone git://git.moodle.org/moodle.git
- cd moodle
- sudo git branch -a
- sudo git branch --track MOODLE_311_STABLE origin/MOODLE_311_STABLE
- sudo git checkout MOODLE_311_STABLE
- sudo cp -R /opt/moodle /var/www/html/
- sudo chmod -R 0777 /var/www/html/moodle; (Change this later to 0755)
- sudo mkdir /var/moodledata
- sudo chown -R www-data /var/moodledata
- sudo chmod -R 0777 /var/moodledata; (Change this later to 0755)
D.4 Configure the MySQL Server for MOODLE
- sudo mysql -u root -p
- CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- CREATE USER 'moodle-user'@'localhost' IDENTIFIED BY 'password';
- GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO 'moodle-user'@'localhost';
- quit
Adjust php.ini settings requirement using a text editor
- cd /etc/php/7.4/apache2
- sudo nano php.ini
I hope you have learned something from this post, have fun.
Disclaimer:
All product names, company logos, brands, and service names that were mentioned or used in this Web log, (Blog) are for identification purposes only, and are the property of their respective owners, and does not imply endorsement nor affiliation of the Blog owner with this companies.
Post a Comment