How to Install Moodle on OpenSUSE Latest
Moodle is an open-source learning management system that allows educators to create and manage courses online. In this tutorial, we will guide you through the process of installing Moodle on OpenSUSE Latest.
Prerequisites
- A server running OpenSUSE Latest.
- A web server (Apache or Nginx).
- PHP version 7.3 or higher.
- MySQL or MariaDB database.
Step 1: Update System
Before you start installing Moodle, update your system by running the following command:
sudo zypper update
Step 2: Install Required Packages
Next, install the required packages for running Moodle by running the following command:
sudo zypper install apache2 mariadb mariadb-client mariadb-tools php7 php7-mysql php7-mysqli php7-gd php7-zip
After installing, enable and start the Apache service by running the following commands:
sudo systemctl enable apache2
sudo systemctl start apache2
Step 3: Setup MySQL Database
Create a new database for Moodle and a user with full privileges on that database. You can create them by running the following commands:
sudo mysql -u root -p
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 "password" with a secure password.
Step 4: Download and Extract Moodle
Navigate to the /var/www/html directory and download the latest version of Moodle from their official website by running the following commands:
cd /var/www/html
sudo wget https://download.moodle.org/download.php/direct/stable311/moodle-latest-311.tgz -O moodle.tgz
Uncompress the downloaded file using the following command:
sudo tar -zxvf moodle.tgz
This will extract the Moodle files into a directory named "moodle".
Step 5: Configure Moodle
Create a new Moodle configuration file by copying the sample configuration file:
sudo cp /var/www/html/moodle/config-dist.php /var/www/html/moodle/config.php
Open the Moodle configuration file in your favorite text editor:
sudo nano /var/www/html/moodle/config.php
Edit the following lines to match your database settings:
$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'moodleuser';
$CFG->dbpass = 'password';
$CFG->prefix = 'mdl_';
$CFG->wwwroot = 'http://your-domain/moodle';
Save and exit the file.
Step 6: Set Directory Permissions
Set the necessary directory permissions by running the following commands:
sudo chown -R wwwrun:www /var/www/html/moodle/
sudo chmod -R 755 /var/www/html/moodle/
sudo chmod -R 777 /var/www/html/moodle/data/
Step 7: Access Moodle
Finally, access Moodle from a web browser by navigating to the following URL:
http://your-domain/moodle
You will be redirected to the Moodle installation wizard. Follow the steps to complete the installation.
Conclusion
Congratulations! You have successfully installed Moodle on OpenSUSE Latest. You can now start creating and managing courses online.