How to Install Moodle on Arch Linux

Moodle is an open source learning management system used widely in educational institutions. In this tutorial, we will go through the steps required to install Moodle on Arch Linux.

Prerequisites

Before proceeding with the installation, you need to ensure that you have the following prerequisites:

Let's get started

Step 1: Install the Required Software Packages

On your Arch Linux server, open the terminal and run the following command to install Apache, PHP, and their respective modules:

sudo pacman -S apache php php-apache php-gd php-intl php-mbstring php-pgsql

Step 2: Install PostgreSQL or MySQL

Next, we need to install the database management system. In this tutorial, we will use PostgreSQL.

sudo pacman -S postgresql
sudo systemctl enable --now postgresql

Then, create a new user and database for Moodle:

sudo -u postgres psql
CREATE USER moodleuser WITH ENCRYPTED PASSWORD 'your_password';
CREATE DATABASE moodledb WITH OWNER moodleuser ENCODING 'UTF8';
GRANT ALL PRIVILEGES ON DATABASE moodledb TO moodleuser;

Step 3: Download and Install Moodle

Now that we have all the required software packages and the database, it's time to download Moodle.

wget https://download.moodle.org/download.php/direct/stable39/moodle-latest-39.tgz
tar -zxvf moodle-latest-39.tgz -C /var/www/html/

Change the ownership of the Moodle directory to the Apache user:

sudo chown -R http:http /var/www/html/moodle

Step 4: Configure Apache for Moodle

Create a new Apache configuration file for Moodle:

sudo nano /etc/httpd/conf/extra/moodle.conf

Add the following lines of code to the file:

Alias /moodle "/var/www/html/moodle"
<Directory "/var/www/html/moodle">
    AllowOverride All
    Options FollowSymLinks
    Require all granted
</Directory>

Save and exit the file.

Then, edit Apache's main configuration file:

sudo nano /etc/httpd/conf/httpd.conf

Add the following line to the end of the file:

Include conf/extra/moodle.conf

Save and exit the file.

Finally, restart the Apache web server:

sudo systemctl restart httpd

Step 5: Run the Moodle Installation Wizard

Open your web browser and go to your server's IP address or domain name followed by "/moodle". You should see the Moodle installation wizard.

Follow the on-screen instructions to complete the installation. You will be required to enter the database details that you created in Step 2.

Once the installation is complete, you should see the Moodle login page.

Conclusion

Congratulations! You have successfully installed Moodle on your Arch Linux server. You can now start using it to manage your educational content.

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!