How to Install Moodle 3.8 on Fedora 32/31/30

Channel: Linux
Abstract: DocumentRoot /var/www/moodlequit Step 4 – Setup Apache for Moodle Second is deploy with external web servers like Apache it is preferred for productio

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.8 on Fedora 32/31/30/29 system.

Prerequisites

First of all, you need to set up a LAMP environment to install Moodle on your Fedora 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.

  • Install Apache, PHP, & MySQL on Fedora
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_38_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.

CREATE DATABASE moodledb DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY '_password_'; GRANT ALL ON moodledb.* to 'moodleuser'@'localhost'; FLUSH PRIVILEGES; quit12345CREATE DATABASE moodledb DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY '_password_';GRANT ALL ON moodledb.* to 'moodleuser'@'localhost';FLUSH PRIVILEGES;quit

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
/etc/httpd/conf.d/moodle.conf
<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName moodle.example.com
    DocumentRoot /var/www/moodle
    <Directory /var/www/moodle>
          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.

 http://moodle.example.com/install.php

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.

Conclusion

You have successfully configured Moodle on your Fedora system.

Ref From: tecadmin

Related articles