Moodle is an open-source learning management system that facilitates educators to create interactive and personalized learning environments for their students. In this tutorial, we will guide you through the step-by-step process of installing Moodle on Elementary OS Latest.
Before we start with the installation steps, make sure that you have the following prerequisites in place:
The first step in installing Moodle on your system is to download the latest version from the Moodle official website. You can download it using the following command:
$ sudo wget https://download.moodle.org/download.php/direct/stable310/moodle-latest-310.tgz
After the download is complete, you need to extract the Moodle archive using the tar command. The extracted files will be stored in the directory where this command is executed. Use the following command to extract the downloaded archive:
$ sudo tar -xvzf moodle-latest-310.tgz
Once you have extracted the archive, move the Moodle files to the Apache web directory, which is /var/www/html on Elementary OS Latest. You can copy the files using the following command:
$ sudo cp -r moodle /var/www/html/
To configure the Apache server to work with Moodle, create a new virtual host configuration file in the /etc/apache2/sites-available directory.
$ sudo nano /etc/apache2/sites-available/moodle.conf
Then, copy and paste the following configuration into the file:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/moodle
ServerName example.com
ServerAlias www.example.com
<Directory /var/www/html/moodle/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save and exit the file.
Now, enable the newly created virtual host config using the a2ensite command:
$ sudo a2ensite moodle.conf
Also, enable the rewrite and SSL modules using the following command:
$ sudo a2enmod rewrite ssl
Finally, restart the Apache server using the service command:
$ sudo service apache2 restart
Create a new database for your Moodle instance using the following command:
$ sudo mysql -u root -p
Once you are logged in to the MySQL shell, execute the following commands to create a new database, a new database user, and provide the required permissions:
CREATE DATABASE moodle;
CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON moodle.* TO 'moodleuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Make sure to replace the 'moodleuser' and 'password' with your desired values.
Launch your preferred web browser and access the Moodle URL by navigating to your server's IP address or domain name while appending to "/moodle". For example: http://example.com/moodle.
You should see the Moodle installation page now. Follow the installation wizard to complete the installation process.
When prompted for the database details, provide the following information:
Now, follow the on-screen instructions to complete the installation process.
That's it! You have successfully installed Moodle on Elementary OS Latest. You can now start creating courses and managing your students.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!