Skip to main content

HOW TO: Install Moodle 3.0 - 3.5 in CentOS 6/7

Here are the commands for installing Moodle 3.0 - 3.5 in CentOS 6/7.

1. Update your System

$ yum update -y$ sudo yum update -y  (for Ubuntu 16.04/18.04)
2. Install required LAMP(Linux, Apache, MySQL, phpmyadmin) version on CentOS 6/7

$ yum install httpd mariadb mariadb-server php php-mysql $ sudo
yum install httpd mariadb mariadb-server php php-mysql (for Ubuntu 16.04/18.04) $ yum install php-iconv php-mbstring php-curl php-openssl php-tokenizer php-xmlpc php-soap php-ctype php-zip php-gd php-simplexml php-spl php-pcre php-dom php-xml php-intl php-json php-ldap php-pecl-apc
(use sudo for Ubuntu 16.04/18.04)
Start httpd and mysql services for CentOS
$ systemctl enable httpd
$ systemctl start  httpd
$ systemctl enable mariadb
$ systemctl start MariaDB
(use sudo for Ubuntu 16.04/18.04)

$ sudo service httpd restart
$ sudo service MariaDB restart

Create root admin password of MySQL, or later you can configure the path,  username and password of DB in Moodle/config.php. Also, you need to create a config.php file if it's not created during Moodle installation. The file will be available as config-dist.php. At the end of the commands you can find the config.php file and edit them according to the path and other credentials.
# mysqladmin -u  root password password


Create a database and a database user and assign all privileges to that newly created database user.
Sample output
# mysql -u root -p 
MariaDB [(none)]> create database moodle;
MariaDB [(none)]> create user 'unixmen'@'localhost' identified by 'password';
MariaDB [(none)]> grant all priviledges on moodle.* to 'unimxmen'@'localhost';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
Bye



Download latest version of Moodle, replace accordingly like 3.0 - 3.5. Here I've installed Moodle 3.4v.
$ cd  /var/www/html
$ wget https://download.moodle.org/stable34/moodle-3.4.tgz
$ tar -xvf moodle-3.4.tgz
$ chown -R apache:apache /var/www/html/moodle
$ chmod -R 755 /var/www/html/moodle

(use sudo for Ubuntu 16.04/18.04)
In next step you've to create moodledata folder which will be used by Moodle to store caches and data for later migration usage. Under /var/www/ make a folder as  ‘moodledata’ which will be used by moodle, change permissions (chmod) and ownership (chown) for that directory as required.
$ cd /var/www/
$ mkdir moodledata 
$ chmod -R 755 /var/www/moodledata
$ chown -R apache:apache /var/www/html/moodledata


Restart httpd services or apache
$ systemctl restart httpd
$ sudo service apache2/httpd restart ----> for Ubuntu
/var/www/html/moodle/config.php
<?php  // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype    = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = moodle;
$CFG->dbuser    = 'username';
$CFG->dbpass    = 'password';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',
  'dbcollation' => 'utf8mb4_general_ci',
);
$CFG->wwwroot   = 'http://localhost/moodle';
$CFG->dataroot  = '/var/www/moodledata';
$CFG->admin     = 'admin';
$CFG->directorypermissions = 0777;
require_once(__DIR__ . '/lib/setup.php');
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!

Comments

Popular posts from this blog

Software Versions You Must Have..!

Google Chrome       Version 29 and Version 37 of Google Chrome works much better than any other version.I updated my Google Chrome but it was lagging,not responding, crashed,contents were loaded very slow and few more.So,finally I found Google Chrome 37 working better,bugs fixed and you can download this to fix the previous problems. 2. KM Player Really awesome player to watch HD Videos,movies.Compatible with all extensions of videos you want to watch whether it is mkv,3gp,flv,HD,4K etc.KM Player has very good 3D mode.You can watch multiple videos at a time.I found version 3.6 & 3.9 useful,but in between versions were very Ads providing, lagging every time when you open the Player. 3. iTunes & Quick Time Player  Hats off to the creator 'Apple Inc.'. iTunes- name is enough.I use default audio player as iTunes.You can feel the sound clarity when you are changing it to other mode like Pop,Rock,Acoustic,Bass etc. iT...

End of support for Windows 10, Windows 8.1 and Windows 7

Here's more you can read about the support:  link How you can move to Windows 11 Frequently asked questions   What can I do with my old computer? Trade it  in or  recycle it  with local organizations. Will my Windows 10 PC stop working? No. Your PC will continue to work, but support will be discontinued. How is Windows 11 more secure? Windows 11 is the most secure Windows ever built, with comprehensive end-to-end security that covers antivirus, firewall, internet protections, and more.  Read more  about Windows security.