Ubuntu MOODLE server installation tutorial

This documentation will describes  how to install Moodle 3.* on your virtual server. Install default PHP extensions for Moodle and configure PHP for optimal server work.

First step is to purchase your virtual server from DIGITAL OCEAN or Amazone. Server (AWS) or others services.

As an example we took Ubuntu server from DIGITAL OCEAN Ubuntu 16.04 without any installations:

Details of the server would be:

OS: Ubuntu 16.04

PHP version: 7.0

Mysql: 5.7

Apache version: 2.4

Connect to your server visa ssh protocol

Update LINUX

sudo apt-get update

Update Date ZONE

sudo dpkg-reconfigure tzdata

Install Apache

sudo apt-get install apache2

Apache enable Rewrite rule and restart it

sudo a2enmod rewrite

sudo service apache2 restart


Install MYSQL

sudo apt-get install mysql-server mysql-client

Create Scheme

mysql -uroot -p{YOUR_PASSWORD}

Install PHP 7 and PHP Extensions

sudo apt-get install libapache2-mod-php7.0 php7.0-mysql php7.0-curl

Install PHP Extensions

sudo apt-get install php7.0-zip

sudo apt-get install php-mbstring

sudo apt-get install php7.0-xsl

sudo apt-get install php7.0-gd

sudo apt-get install php7.0-soap

sudo apt-get install php-xml

sudo apt-get install php-ldap

sudo apt-get install php7.0-dev

sudo apt-get install php-xmlrpc

sudo apt-get install php-gd

Configure file  php.ini

file location: /etc/php/7.0/apache2/php.ini

Edit this fields:

session.gc_maxlifetime = 1800






post_max_size = 100M

Install Git 

sudo apt-get install git

Clone Moodle 3.3 from stable repository

git clone --depth=1 -b MOODLE_33_STABLE git://git.moodle.org/moodle.git  /var/www/moodle
sudo mkdir moodledata

Generate Permissions on Writable directories

sudo chown -R root /var/www/moodle/

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

sudo find /var/www/moodle -type f -exec chmod 0644 {} \;

Generate Permissions on moodledata directory

sudo chmod 0777 moodledata/ -R
sudo chown  www-data:www-data moodle/ -R

Sudo chown  www-data:www-data moodledata/ -R

Configure Domain (APACHE) 

configure file 000-default.conf with

vim /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
 ServerName your-domain.com
 DocumentRoot /var/www/moodle
 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

Restart Apache

sudo sudo service apache2 restart

Run your domain  and install your moodle


Source links: https://docs.moodle.org/33/en/Step-by-step_Installation_Guide_for_Ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.