Moodle, the open-source learning management system is utilized by many of the learners across the board. It is significantly the world’s most customizable and relied on online studying solutions.
A manual Moodle LMS setup is the endorsed approach for small to medium Moodle implementations; or in different words, those businesses who plan to use Moodle for small initiatives. It needs to be noted that windows aren’t the encouraging platform for massive Moodle LMS installations because it does now not have the garage capability to hold the records out of your Moodle website online. In case you plan to hold more numbers of records in your Moodle databases, we endorse thinking about an operating machine with 64bit support.
The following steps for installing Moodle are meant for skilled IT professionals. If you do no longer have technical abilities or Moodle revel in in-residence, reach out to us and we’d be greater than happy to have your Moodle LMS implemented for you.
Server and Storage
Before getting started with the Moodle LMS installation, we need to make sure about the configuration of the server which is best and supported by Moodle application. Make sure it will handle the maximum number of users and could make certain your Moodle site doesn’t crash in case you exceed your ability. We recommend AWS EC2 Services to host Moodle application.
It is a great idea to keep a note of the username and passwords that will be used in Ubuntu and Moodle applications.
- Ubuntu root password
- The MySQL username and password that will be used in Moodle
- The Moodle Super Admin username and password
- Additional admin and users credentials of Moodle
Step 1: Install Ubuntu
- Most of the IT experts choose CLI Interface server, due to the fact it’ far more secure and much less liable to hacking.
- Newbie users may find it less complicated to apply a graphical interface.
- If you may most effective be using your Moodle server for local, experimental functions, you may opt to deploy the computer(64 bit preferred) version of Ubuntu
Let us Start
- You may use both vi (Light-weight editor) or vim (heavy-weight editor), however, if you wish to use vim you may need to install it.
sudo apt-get install vim
- In Ubuntu, other than root, the account you created during the install does not have right to install/write to many of the directories. In the blog we will use the term “sudo” or “sudo su” which stands for super user before most of the commands.
Step 2: Install Webserver and Database(Apache/MySql/PhP)
- Now access your terminal and add the following
- Install php7 ppa:
- sudo add-apt-repository ppa:ondrej/php sudo apt-get update
sudo apt install apache2 mysql-client mysql-server php7.4 libapache2-mod-php
(Ubuntu 20.04 now installs PHP8 by default, so be careful to specify the PHP version number or else you will get an error at "line 10602")
- Run ‘sudo mysql_secure_installation’ to set the root password for mysql (Make a note of the credentials -p. You will need it in step 6)
Step 3: Install Additional Softwares.
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
- Once you complete this activities restart your apache server so that all the modules are loaded correctly.
sudo service apache2 restart
- Git will be used to install/update moodle core application
sudo apt install git
Step 4: Install Moodle Application
- First of all setup your local repository and then download Moodle.
- We will download Moodle code in /opt dir
- Download Moodle Data
sudo git clone git://git.moodle.org/moodle.git
- Now change the directory to the downloaded Moodle data path
- Use the following command to retrieve a list of each branch availble
sudo git branch -a
- Now you need to tell git which branch to use or track
sudo git branch --track MOODLE_39_STABLE origin/MOODLE_39_STABLE
- Thereafter checkout the Moodle version specified
sudo git checkout MOODLE_39_STABLE
Step 5: Copy local repository to /var/www/html
sudo cp -R /opt/moodle /var/www/html/
sudo mkdir /var/moodledata
- Give specific permissions to Files and Folder
sudo chown -R www-data /var/moodledata
sudo chmod -R 777 /var/moodledata
sudo chmod -R 0755 /var/www/html/moodle
Step 6: Setup MySql Server
First of all, we need to verify that the default storage engine is InnoDB and the default file format is barracuda.
- During installation of the moodle instance, the latest version of the moodle will automatically select innodb as the default storage engine. The best practice is to make it default anyway. However you need to set the default file format as baracudda!
- If VIM editor is used please substitute vi for vim
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
Note: If you use newer versions of MariaDB in Ubuntu 20.04 these changes in the config file would arise and error (mysql unknown variable ‘innodb_file_format=barracuda’), so comment or don’t make these changes, these values are got by default.innodb_file_format was deprecated in MariaDB 10.2 and removed in MariaDB.
- To save my.cnf file using editor, press esc key, and type :wq to save and close the editor. :w is used to save a file and :q is used to close the editor.
- Then restart SQL server for the changes to take affect.
sudo service mysql restart
- After performing all these activities, we need to create Moodle Database and Moodle user with correct permissions.
- Use the password that you have created earlier in the 1st step
sudo mysql -u root -p
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Note: Use ‘utf8mb4’ for full range (4-byte) support of UTF-8, including Emoji (‘utf8’ only supports 3-byte). You will be compliant by Moodle admin page if you don’t use ‘utf8mb4’ here.
create user 'moodleuser'@'localhost' IDENTIFIED BY 'passwordformoodleuser’;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO 'moodleuser'@'localhost';
Note: ‘moodleuser’ is your username and ‘passwordformoodleuser’ is your password for your moodle account. You can replace username and password with your choice.
- If you are using MySQL 5.6+ and when you issue the create user and get an error about the password hash you need to adjust the password to use the hash value
- You can get this by following the below
This will print the hash of the password like *AD51BAFB2GD003D3480BCED0DH81AB0BG1712535, you will want to use this in the IDENTIFIED BY ‘ part
Step 7: Final Step (Complete Setup)
Note: During moodle installation, a config.php file needs to be created, if you are having any issues you have to make webroot writable only for a short duration.
sudo chmod -R 777 /var/www/html/moodle
Thereafter you have to run the installer and you have to moodle setup. Once the setup is complete you need to revert those permissions given in the previous step sp that it is no longer writable
sudo chmod -R 775 /var/www/html/moodle
open your web browser and go to http://ipaddress/moodle
Follow the prompts
Host server: localhost
User: moodledude (the user you created when setting up the database)
Password: passwordformoodledude (the password for the user you created)
Tables Prefix: mdl_
This will indicate if any elements required to run moodle haven’t been installed.
Next Next Next…..
Follow prompts and confirm the installation
Create Site Administrator Account
Create your moodle user account which will have site administrator permissions.
The password you select has to meet certain security requirements.
Congrats! You can now start using Moodle!