We build a Ubuntu server (version 20, without user interface) with a username consisting of your name and the first letter of your surname. Mine would be vicentf.
Once we have the server ready, we must install all dependencies, apache2, mysql and php: (using vpn or another network)
net-tools apache2 mysql-client mysql-server php libapache2-mod-php aspell ghostscript clamav php7.4-pspell php7.4-curl php7.4-gd php7.4-mysql php7.4-xml php7.4-ldap
After that configure mysql and restart apache2 to reload the modules:
sudo mysql
#Inside do --> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'NEWPASSWORD';
#NEWPASSWORD must have uppercase and lowercase letters, at least 8 characters and numbers.
sudo mysql_secure_installation #say no to every step
sudo service apache2 restart
We're going to download Moodle through Git. This is a web application to manage repositories. Developers upload the code to Git to people can get the source files and use them. And you can control the version of your programs also.
Install git with apt and go to /opt because we're going to install this web application (Moodle) in this folder.
So we can download the program through this command:
sudo git clone git://git.moodle.org/moodle.git
Screenshot from /opt/moodle using ll command or ls -l (show your username)
Then we access to moodle folder and we'll see branches (different versions) that developers have published:
sudo git branch -a
Then you can get one version, for example:
sudo git branch --track MOODLE_40_STABLE origin/MOODLE_40_STABLE
Last step is check the version we specified:
sudo git checkout MOODLE_40_STABLE
Download the file and put it in /opt with scp command. Then unzip the file and continue.
After that, we are going to create a symbolic link to html folder and set up a moodledata folder and permissions:
sudo ln -s /opt/moodle /var/www/html/moodle_vf
sudo mkdir /var/www/moodledata
sudo chown -R www-data /var/www/moodledata
sudo chmod -R 777 /var/www/moodledata
sudo chmod -R 0755 /var/www/html/moodle_vf
Screenshot of /var/www and /var/www/html folders with ll or ls -l (showing username)
Set up MySQL Server because latest versions require change storage engine to innodb and file format to Barracuda. Also, we set to each file save info in 1 table. Change bind-address to 0.0.0.0 to access from any IP. To do this, go to this file: /etc/mysql/mysql.conf.d/mysqld.cnf:
Screenshot of the file
Restart mysql:
sudo service mysql restart
If you get an error, comment file format line of that file and restart again.
After that, connect to mysql to create database, user and give permissions:
sudo mysql -u root -p
CREATE DATABASE nom_bbdd DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'nom_usuari'@'%' IDENTIFIED BY 'contrasenya';
GRANT ALL PRIVILEGES ON nom_bbdd.* TO 'nom_usuari'@'%' WITH GRANT OPTION;
Screenshot database instructions
Change permissions to moodle folder in html or moodle to 777.
Screenshot of each step
Follow the installation steps until finish. When it would be ready, you must create an administrator moodle user. REMEMBER USER AND PASSWORD.
If you have an error while the installation, try to check which packages must be installed after istall a moodle (only check errors, not warnings).
When you finish, change permissions to moodle folder and files to 0755
Screenshot: config.php file inside moodle folder and write where is the following info:
Database type
Database url
Database username and password
Database prefix
Moodle url
Data folder path
Administration username and password
Screenshot of your moodle main page showing url
Check that these folders exist:
Du: set up to a quicker load files
Aspell: check orthography in editors
Dot: to generate graphycs
Go to Administrator panel > Server > Paths and change
Screenshot of this configuration after save changes. Show name of the wiki and 3 checks that verify folders were added properly.