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.
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.
1 2 3 4 5 | 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; 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
<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.
2 Comments
Hello,
Thank you for the quick guide.
I faced an issue at the last step. – “Installation must be finished from the original IP address, sorry.”
I read the workaround but I could not find the table as it was not created yet.
Workaround:
Update the database directly with your current IP address (table: mdl_user, field: lastip, SQL: UPDATE mdl_user set lastip=’159.245.48.2′ where username=’admin’;).
How I can solve this issue?
Thanks in advance
Thanks for sharing this post,
is very helpful article.