User Tools

Site Tools


computing:moodle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
computing:moodle [2018/08/04 23:45] oemb1905computing:moodle [2019/07/06 17:54] oemb1905
Line 29: Line 29:
   sudo tar -xvzf moodle.tgz -C /var/www/domain.com/public_html/   sudo tar -xvzf moodle.tgz -C /var/www/domain.com/public_html/
      
-Now that you have installed the moodle directory into your Wehttps://codetalkers.services/Server's VirtualHost directory, you are ready to set up the Moodle Data directory, which should be outside of the root of the Web Server.  Additionally, change the ownership to the www-data user that Apache uses and give the owner and admin group full permissions as follows:+Now that you have installed the moodle directory into your Web Server's VirtualHost directory, you are ready to set up the Moodle Data directory, which should be outside of the root of the Web Server.  Additionally, change the ownership to the www-data user that Apache uses and give the owner and admin group full permissions as follows:
  
   sudo mkdir -p /var/www/domain.com/moodledata   sudo mkdir -p /var/www/domain.com/moodledata
Line 38: Line 38:
  
   sudo mysql -u root -p   sudo mysql -u root -p
-  CREATE DATABASE __nameofdatabase__ DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci+  CREATE DATABASE __nameofdatabase__ DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
   create user '__usernameofdatabase__'@'localhost' IDENTIFIED BY '__passwordfordatabaseuser__';   create user '__usernameofdatabase__'@'localhost' IDENTIFIED BY '__passwordfordatabaseuser__';
   GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON __nameofdatabase__.* TO '__usernameofdatabase__'@'localhost' IDENTIFIED BY '__passwordfordatabaseuser__';   GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON __nameofdatabase__.* TO '__usernameofdatabase__'@'localhost' IDENTIFIED BY '__passwordfordatabaseuser__';
Line 52: Line 52:
   sudo chmod -R 777 /var/www/domain.com/public_html/moodle   sudo chmod -R 777 /var/www/domain.com/public_html/moodle
  
-After this, use your web browser of choice and navigate to domain.com/moodle/ and go through the configuration steps.  You will need to specify the __usernameofdatabase__ and the __passwordfordatabaseuser__ you specified above.  Also, pay special attention to the Moodle Data directory and ensure that it populated correctly - sometimes it specifies the wrong directory.  Lastly, on Debian you will encounter and error in the php.config that needs to be resolved.  This glitch is covered on [[https://moodle.org/mod/forum/discuss.php?d=330272|Moodle.net Forums]] and thanks to Marina for identifying that annoying, yet easy to fix, configuration error!+After this, use your web browser of choice and navigate to domain.com/moodle/ and go through the configuration steps.  You will need to specify the __usernameofdatabase__ and the __passwordfordatabaseuser__ you specified above.  Also, pay special attention to the Moodle Data directory and ensure that it populated correctly - sometimes it specifies the wrong directory.  Lastly, on Debian you will encounter an error in the php.config that needs to be resolved.  This glitch is covered on [[https://moodle.org/mod/forum/discuss.php?d=330272|Moodle.net Forums]] and thanks to Marina for identifying that annoying, yet easy to fix, configuration error!
  
   cd /var/www/domain.com/public_html/moodle/   cd /var/www/domain.com/public_html/moodle/
Line 59: Line 59:
 In the first five lines, the configuration specifies "mysqli" and this needs to be changed to "mariadb" instead.  Once this is done, you should be able to complete the installation options given on the web page.  It is now time to set up Moodle and use the Learning Management System for what it is designed for - learning with FreeSoftware!  Here is a [[https://www.youtube.com/watch?v=DsQNAprWBfg|Moodle Tutorial]] I found helpful.  Now that we are done with the tutorial, take a look at my finished product [[https://jonathanhaack.com/moodle|haackslms]].  In the first five lines, the configuration specifies "mysqli" and this needs to be changed to "mariadb" instead.  Once this is done, you should be able to complete the installation options given on the web page.  It is now time to set up Moodle and use the Learning Management System for what it is designed for - learning with FreeSoftware!  Here is a [[https://www.youtube.com/watch?v=DsQNAprWBfg|Moodle Tutorial]] I found helpful.  Now that we are done with the tutorial, take a look at my finished product [[https://jonathanhaack.com/moodle|haackslms]]. 
  
 +Moodle recommends the following directory hardening measures:
 +
 +1. moodledata directory and all of its contents (and subdirectories, includes sessions):
 +
 +owner: apache user (apache, httpd, www-data, whatever; see above)
 +group: apache group (apache, httpd, www-data, whatever; see above)
 +permissions: 700 on directories, 600 on files
 +
 +2. moodle directory and all of its contents and subdirectories (including config.php):
 +
 +owner: root
 +group: root
 +permissions: 755 on directories, 644 on files.
 +
 +If you allow local logins for regular users, then 2. should be:
 +
 +owner: root
 +group: apache group (apache, httpd, www-data, whatever; see above)
 +permissions: 750 on directories, 640 on files.
 +
 +Think of these permissions as the most paranoid ones. You can be secure enough with less tighter permissions, both in moodledata and moodle directories (and subdirectories). 
 +
 +This tutorial is a designated "Invariant Section" of the "Technotronic" section of Haack's Wiki as described on the [[https://jonathanhaack.com/dokuwiki/doku.php?id=start|Start Page]].
  
  --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2018/08/04 16:45//  --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2018/08/04 16:45//
computing/moodle.txt · Last modified: 2021/11/20 21:35 by oemb1905