Testing Moodle on Debian 9

So I bought a Raspberry Pie and put Debian 9 on it so that I can play around with it as a home server. Currently I am configuring Moodle on it, so here are my notes:

Debian 9 (stretch) has 2.7.17 in the repositories. This is fairly old, so I will be installing the git version instead.

First:

sudo apt-get update

Second:

sudo apt-get install apache2 mysql-client mysql-server php7.0 libapache2-mod-php7.0

Third:

sudo apt-get install graphviz aspell php7.0-pspell php7.0-curl php7.0-gd php7.0-intl php7.0-mysql php7.0-xml php7.0-xmlrpc php7.0-ldap php7.0-zip php7.0-soap php7.0-mbstring


Forth:

sudo service apache2 restart

Fifth:

sudo apt-get install git-core

Sixth:

cd /opt

Seventh:

sudo git clone git://git.moodle.org/moodle.git

Eighth:

cd moodle

Ninth:

sudo git branch -a

Since the guide I'm following is installing Moodle 3.1, and I don't want any incompatibilities, this is what I will be installing as well.


10th:

sudo git branch --track MOODLE_31_STABLE origin/MOODLE_31_STABLE

11th:

sudo git checkout MOODLE_31_STABLE

12th:

sudo cp -R /opt/moodle /var/www/html/

13th:

sudo mkdir /var/moodledata

14th:

sudo chown -R www-data /var/moodledata

15th:

sudo chmod -R 777 /var/moodledata

16th:

sudo chmod -R 0755 /var/www/html/moodle

17th:

sudo mysql -u root -p

18th:

CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

19th:

create user 'username'@'localhost' IDENTIFIED BY 'passwordforuser';

NOTE: Make sure to change 'username' 'passwordforuser' to whatever password you would like. (to change the password, you can used the following command: set password for moodle@localhost = password('newpassword');)

20th:

MariaDB [(none)]> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodle@localhost IDENTIFIED BY 'password';

NOTE: Again, adjust username and password.

21st:

MariaDB [(none)]> quit;

22nd:

sudo chmod -R 777 /var/www/html/moodle

23rd:

sudo chmod -R 0755 /var/www/html/moodle

24th:

Open your browser and go to http://IP.ADDRESS.OF.SERVER/moodle
Follow the prompts:

Change the path for moodledata: /var/moodledata

Host server: localhost
Database: moodle
User: username (the user you created when setting up the database)
Password: userpassword (the password for the user you created)
Tables Prefix: mdl_

25th:

sudo chmod -R 0755 /var/www/html/moodle









Comments

Unknown said…
Excelente tutorial, muchas, pero que muchas gracias
Anonymous said…
Thanks, this paper helps me to set up a moodle server in 10 minutes. Just remove the "sudo" it is not requiered by debian.

Popular posts from this blog

Base64 decode to file

Swiftboating from the Left - Paul Harris's "The Real McCain"

Installing Virtualbox's Guest Additions on Debian and getting shared folders to work