Moodle is a free and open source course management system (CMS) written in PHP. You can create courses complete learning platform with Moodle. This article will help you to install Moodle 3.5 on Fedora 30/29/28/27/25 system.
First of all, you need to set up a LAMP environment to install CakePHP on your Red Hat system. We assume that you already have PHP, MySQL and Apache installed on your system. If you don’t have, use the following article to install it.
Step 1 – Getting Moodle Application
After installing the composer on your Fedora system. Let’s create CakePHP application named “MyApp” using composer command as below.
cd /var/www git clone -b MOODLE_35_STABLE git://git.moodle.org/moodle.git
Now set the proper permission for your project files. For Red Hat based system Apache default uses apache as the user. So change files ownership as per your setup.
chown -R apache:apache moodle chmod -R 755 moodle
Step 2 – Setup Moodle Data
Create a Moodle data directory outside of the original Moodle directory. Set the proper permissions on the directory. This directory is used by Moodle to store data, files to this directory.
mkdir /var/www/moodledata chmod -R 755 /var/www/moodledata
Step 3 – Create Database for Moodle
For this article, we are using MySQL as the database server. First use the following commands to create a MySQL database and create.
mysql> CREATE DATABASE MoodleDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> GRANT ALL ON MoodleDB.* to 'dbuser'@'localhost' IDENTIFIED BY '_password_';
mysql> FLUSH PRIVILEGES;
Step 4 – Setup Apache for Moodle
Second is deploy with external web servers like Apache it is preferred for production use. Let’s create an Apache VirtualHost configuration file using the following content.
sudo vi /etc/httpd/conf.d/moodle.conf
<VirtualHost *:80> ServerAdmin [email protected] ServerName moodle.example.com DocumentRoot /var/www/moodle <Directory /var/www/html> Allowoverride All </Directory> </VirtualHost>
Change the ServerName and document root as per your setup. Then restart Apache service.
sudo systemctl restart httpd
Step 5 – Run Moodle Web Installer
Now access the moodle in your favorite web browser.
This will open the Moodle web installer page.
Follow the installation wizard to complete the setup. After installation, you will be redirected to Moodle admin dashboard.
You have successfully configured Moodle on your Fedora system.