Difference between revisions of "Moodle/C2/Server-setup-before-installing-Moodle/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 48: Line 48:
  
 
|-
 
|-
||Copy-paste: sudo apt update >> type the system password >> type Y to accept changes
+
||Copy-paste: sudo apt update >> type the system password
 
||First, we will '''update''' the '''system packages'''.
 
||First, we will '''update''' the '''system packages'''.
  
Line 56: Line 56:
  
 
This '''command''' refreshes your '''package list'''.
 
This '''command''' refreshes your '''package list'''.
 
So type '''Y''' when asked to accept changes.
 
  
 
|-
 
|-

Revision as of 21:46, 19 February 2026

Title of the script: Server setup before installing Moodle

Author: Nancy Varkey

Keywords: Moodle, Moodle LMS, LMS, Learning Management System, Educational LMS, Open-source LMS, server setup for Moodle installation, Moodle installation, Moodle server setup

Visual Cue Narration
Title Slide Welcome to the spoken tutorial on the Server setup before installing Moodle.
Pre-requisite slide:

You will need:

  • A machine with Ubuntu 22.04 OS
  • Minimum 50 GB of free space on your machine
  • Internet connection
To follow this tutorial, you will need a machine with Ubuntu 22.04 OS.

You will need minimum 50 GB of free space on your machine.

You will also need internet connection.

Press Ctrl + Alt + T keys together. Open the terminal by pressing Ctrl + Alt + T keys together.
On-screen-text inside the terminal window >>

“Press Enter to run every command on the terminal.”

Please note: After typing each command, press Enter to run it.
Slide: server-setup.txt file

For your convenience, a text file named server-setup.txt has been provided to you.

Please copy-paste the commands from that file.

A text file named server-setup.txt has been provided for your convenience.

Please copy-paste the commands from that file as you follow this tutorial.

Copy-paste: sudo apt update >> type the system password First, we will update the system packages.

To do so run: sudo apt update

Whenever prompted, type the system password.

This command refreshes your package list.

Copy-paste: sudo apt install nginx Next, we will install the web server, nginx.

So run: sudo apt install nginx

Nginx will serve your Moodle site.

Copy-paste: sudo rm -f /etc/apt/sources.list.d/php.list Now, we will clean up old PHP sources to avoid conflicts.

So run: sudo rm -f /etc/apt/sources.list.d/php.list

Copy-paste: sudo rm -f /etc/apt/sources.list.d/ondrej-php* We also need to remove any Ondrej PHP repository files.

So run: sudo rm -f /etc/apt/sources.list.d/ondrej-php*

Copy-paste: sudo apt update After this, we will update the package list again.

So type: sudo apt update

Copy-paste: sudo apt install -y software-properties-common ca-certificates lsb-release apt-transport-https The next step is to install tools needed for adding repositories.

So run: sudo apt install -y software-properties-common ca-certificates lsb-release apt-transport-https

Copy-paste: sudo add-apt-repository ppa:ondrej/php -y Add the PHP repository from Ondrej by typing this command: sudo add-apt-repository ppa:ondrej/php -y
Copy-paste: sudo apt update Update the package list once more by typing:

sudo apt update

Copy-paste: sudo apt install -y php8.3 php8.3-fpm php8.3-cli php8.3-mysql php8.3-xml php8.3-curl php8.3-mbstring php8.3-zip php8.3-intl php8.3-soap php8.3-gd php8.3-bcmath php8.3-xmlrpc php8.3-imagick Next, we will install PHP 8.3 and the necessary extensions for Moodle.

So run this command.

Type: php -v

Point to PHP 8.3.27

After installation, check your PHP version by typing this command:

php -v

You should see PHP 8.3.27.

Copy-paste: sudo apt install software-properties-common Now, we need to ensure that we have the latest software properties.

So run: sudo apt install software-properties-common

Type: sudo apt update Update the package list once again by typing:

sudo apt update

Copy-paste: sudo apt install mariadb-server mariadb-client Next, we’ll install MariaDB, the database server for Moodle.

So run: sudo apt install mariadb-server mariadb-client

Type: mysql --version

Point to version 15.1.

Let’s verify that MariaDB is installed by typing:

mysql --version

It should show version 15.1.

Type: sudo mysql_secure_installation To secure your database, run this command:

sudo mysql_secure_installation

Point to password for spoken, enter for none, switch to unix_socket authentication Y/n Do the needful actions as suggested by the prompts on the terminal.
Type: sudo mariadb Next, we will create a Moodle database and user.

Log into MariaDB by typing sudo mariadb

Once inside, Copy-paste and press Enter after each command:

CREATE DATABASE moodledb DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'moodle123';

Once inside, run these 2 commands one after the other.
Point to the bold-text words in the commands executed in the above row. Please note, we have named the database as moodledb.

Also, we have named the admin user as moodleuser.

And given the password as moodle123.

Copy-paste: GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodledb.* TO moodleuser@'localhost'; The next step is to grant permissions.

So run this command.

Type: FLUSH PRIVILEGES; >> press Enter

Type: exit; >> press Enter

Then we will apply these changes by running:

FLUSH PRIVILEGES;

exit;

Terminal prompt We are back to the terminal prompt.
Copy-paste: sudo ufw allow http >> press Enter

Copy-paste: sudo ufw allow https >> press Enter

Next, we will configure our firewall.

Allow HTTP traffic by typing: sudo ufw allow http

And allow HTTPS traffic by typing: sudo ufw allow https

Type: sudo ufw status

Point to “inactive”

After this, let’s check the firewall status by typing:

sudo ufw status

It should be inactive.

Copy-paste: sudo gedit /etc/php/8.3/fpm/pool.d/www.conf Next, we have to configure PHP-FPM settings.

Open the configuration file by typing: sudo gedit /etc/php/8.3/fpm/pool.d/www.conf

Press Ctrl+F to find these lines if you cannot locate them easily with a visual search Set or verify these lines of code:

user = www-data group = www-data listen.owner = www-data listen.group = www-data listen = /run/php/php8.3-fpm.sock

Copy-paste: sudo systemctl restart php8.3-fpm Finally, restart PHP-FPM to apply changes:

sudo systemctl restart php8.3-fpm

Only narration This completes the essential server setup steps.

After this, we will install and configure Moodle.

Slide: Acknowledgement Thank you for following along. You are now on your way to hosting Moodle 4.5 on Ubuntu 22.04!
Slide: Acknowledgement This spoken tutorial is brought to you by EduPyramids Educational Services Private Limited, SINE, IIT Bombay.

Contributors and Content Editors

Nancyvarkey