Learn how to set up Moodle on Ubuntu. Our Moodle Support team is here to help you with your questions and concerns.
Setting Up Moodle on Ubuntu: A Tutorial
Moodle is a popular open-source LMS. It is widely used by educational institutions, training organizations, and individual instructors.
Our experts have put together these steps to help you set up Moodle on a VPS server running Ubuntu.
Pre-requisites for Installing Moodle
- Make sure you have a VPS server running Ubuntu.
- Get a fully-qualified domain name pointing to your server’s IP address.
Step-by-step Guide
- First, connect to the server via SSH and update system packages:
sudo apt update && apt upgrade -y
- Then, install Apache web server, MySQL client and server, and PHP 7.4 along with the required modules:
sudo apt install apache2 mysql-client mysql-server php7.4 libapache2-mod-php
- After that, install additional software and PHP libraries needed for Moodle:
sudo apt install graphviz aspell ghostscript clamav php7.4-pspell php7.4-curl php7.4-gd php7.4-intl php7.4-mbstring php7.4-xml php7.4-xmlrpc php7.4-zip
- Now, restart Apache to apply the changes:
sudo service apache2 restart
We can check the status of Apache with this command:
sudo systemctl status apache2
- Then, go to the /opt directory and clone the Moodle repository:
cd /opt
sudo git clone git://git.moodle.org/moodle.git
- Next, go to the Moodle directory, list the available branches, and check out the desired branch:
cd moodle
sudo git branch -a
sudo git branch --track MOODLE_39_STABLE origin/MOODLE_39_STABLE
sudo git checkout MOODLE_39_STABLE
- Then, copy the Moodle directory to the Apache document root:
sudo cp -R /opt/moodle /var/www/html/
- After that, create and set permissions for the Moodle data directory:
sudo mkdir /var/moodledata
sudo chown -R www-data /var/moodledata
sudo chmod -R 777 /var/moodledata
sudo chmod -R 0755 /var/www/html/moodle
- Now, open the MySQL configuration file and add these lines:
default_storage_engine = innodb
innodb_file_per_table = 1
innodb_file_format = Barracuda
- Next, save the file and restart MySQL.
- Now, connect to MySQL and create the Moodle database:
mysql -u root -p
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO 'moodleuser'@'localhost';
quit
- Then, set permissions for the Moodle directory:
sudo chmod -R 777 /var/www/html/moodle
- Finally, restart Apache.
- Open the web browser and go to the server’s IP address followed by `/moodle/install.php`. For example:
http://our-server-ip/moodle/install.php
- then, complete the setup by following the instructions in the web installer.
- After installation, log in to the Moodle admin panel to customize settings, manage courses, and oversee user accounts.
With these steps, we will have Moodle up and running on our Ubuntu server in no time.
[Need assistance with a different issue? Our team is available 24/7.]
Conclusion
In brief, our Support Experts demonstrated how to set up Moodle on Ubuntu.
0 Comments