{"id":2246,"date":"2016-07-18T14:07:23","date_gmt":"2016-07-18T18:07:23","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2246"},"modified":"2017-11-24T15:12:29","modified_gmt":"2017-11-24T20:12:29","slug":"install-moodle-ubuntu-16-php7","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/","title":{"rendered":"How to install Moodle 3.1 on Ubuntu 16 with PHP 7"},"content":{"rendered":"<h1>How to install Moodle 3.1 on Ubuntu 16 with PHP 7<\/h1>\n<p><a rel=\"nofollow\" href=\"https:\/\/moodle.org\/\" target=\"_blank\">Moodle\u2122<\/a> is an excellent tool that instructors can use to augment online courses, creating private websites to help keep students on track and to monitor their progress. It&#8217;s also a very budget-friendly software, being free and open-source under the GNU General Public License.<\/p>\n<h2>Getting Started<\/h2>\n<p>To complete this guide, you will need the following:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\"><b>Cloud Server<\/b><\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\"><b>Dedicated Server<\/b><\/a>) running Ubuntu 14.<br \/>\n\u2022 All commands should be run as the root user<br \/>\n\u2022 An installed LAMP stack including Apache and PHP 7<\/p>\n<h2>Tutorial<\/h2>\n<p>Moodle requires certain software packages and PHP modules. Install these prerequisites first, in order to install Moodle 3.1. <\/p>\n<p><code>apt-get install graphviz aspell php7.0-pspell php7.0-curl php7.0-gd php7.0-intl php7.0-mysql php7.0-xmlrpc php7.0-ldap php7.0-zip php7.0-mbstring php7.0-soap php7.0-xml libapache2-mod-php7.0<\/code><\/p>\n<p>After installing the new modules, it will be necessary to restart Apache so it recognizes them.<\/p>\n<p><code>systemctl restart apache2.service<\/code><\/p>\n<p>Git, a common version control software, is essential to keeping Moodle up to date. If you don&#8217;t have it already, install git-core from the repository.<\/p>\n<p><code>apt-get install git-core<\/code><\/p>\n<p>Using git, you can download and install Moodle 3.1. <\/p>\n<p><code>cd \/opt<br \/>\ngit clone git:\/\/git.moodle.org\/moodle.git<\/code><\/p>\n<p>It will prompt you for the desired version. In this guide we&#8217;ll choose 3.1.<\/p>\n<p><code>cd moodle\/<br \/>\ngit branch -a<br \/>\ngit branch --track MOODLE_31_STABLE origin\/MOODLE_31_STABLE<br \/>\ngit checkout MOODLE_31_STABLE<\/code><\/p>\n<p>Now, locate your Document root directory and copy the content there.<\/p>\n<p><code>cp -R \/opt\/moodle \/var\/www\/html\/<\/code><\/p>\n<p>Create a directory for Moodle. Add some permissions so Apache can access it.<\/p>\n<p><code>mkdir \/var\/www\/moodledata<br \/>\nchown -R www-data \/var\/www\/moodledata\/<br \/>\nchmod -R 777 \/var\/www\/moodledata<br \/>\nchmod -R 0755 \/var\/www\/html\/moodle<\/code><\/p>\n<h2>Configure MySQL to work with Moodle<\/h2>\n<p>After Moodle is installed, it will need its own database in which to store data. We&#8217;ll use MySQl for this guide. First, open your mysqld.cnf in a text editor.<\/p>\n<p>nano \/etc\/mysql\/mysql.conf.d\/mysqld.cnf<\/p>\n<p>Add these lines to the bottom of the file.<\/p>\n<p><code class=\"gris\">default_storage_engine = innodb<br \/>\ninnodb_file_per_table = 1<br \/>\ninnodb_file_format = Barracuda<\/code><\/p>\n<p>Restart the MySQL daemon so that it can recognize the changes. <\/p>\n<p><code>systemctl restart mysql.service<\/code><\/p>\n<p>Now you can create the Moodle database and accompanying user.<\/p>\n<p><code>mysql -u root -p<\/code><\/p>\n<p><code class=\"gris\">CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;<br \/>\ncreate user 'moodleuser'@'localhost' IDENTIFIED BY 'moodlepassword';<br \/>\nGRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'moodlepassword';<br \/>\nquit;<\/code><\/p>\n<p>Complete the setup<\/p>\n<p>The online setup requires that you change the permissions of just one directory temporarily.<\/p>\n<p><code>chmod -R 777 \/var\/www\/html\/moodle<\/code><\/p>\n<p>Via your browser, visit the setup page and add in your database informations. For the database driver, choose Improved MySQL (native\/mysqli).<\/p>\n<p><code class=\"gris\">http:\/\/your_ip\/moodle<\/code><\/p>\n<p>Once setup is completed, you can rollback the changed permissions on the Moodle folder.<\/p>\n<p><code>chmod -R 0755 \/var\/www\/html\/moodle<\/code><\/p>\n<p>The final step is to add some paths to the installation. Visit Moodle in your browser. Navigate to Site Administration > Server > System Paths. This is where you can add the missing paths.<\/p>\n<p><code class=\"gris\">Path to Du: \/usr\/bin\/du<br \/>\nPath to Apsell: \/usr\/bin\/aspell<br \/>\nPath to dot: \/usr\/bin\/dot<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>Now that Moodle is setup and working on your server, you can use it as a versatile complement to your online course. Additionally, if you&#8217;re looking for a particular feature not included in the default installation, it can most likely be found among the 1000+ plugins available online. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How to install Moodle 3.1 on Ubuntu 16 with PHP 7 Moodle\u2122 is an excellent tool that instructors can use to augment online courses, creating private websites to help keep students on track and to monitor their progress. It&#8217;s also a very budget-friendly software, being free and open-source under the GNU General Public License. Getting<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71],"tags":[],"class_list":["post-2246","post","type-post","status-publish","format-standard","hentry","category-applications"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to install Moodle 3.1 on Ubuntu 16 with PHP 7 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to install Moodle 3.1 on your Ubuntu 16 server with PHP 7. Read now &amp; Create you own online courses!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install Moodle 3.1 on Ubuntu 16 with PHP 7 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to install Moodle 3.1 on your Ubuntu 16 server with PHP 7. Read now &amp; Create you own online courses!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-18T18:07:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-11-24T20:12:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/\",\"name\":\"How to install Moodle 3.1 on Ubuntu 16 with PHP 7 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"datePublished\":\"2016-07-18T18:07:23+00:00\",\"dateModified\":\"2017-11-24T20:12:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you how to install Moodle 3.1 on your Ubuntu 16 server with PHP 7. Read now & Create you own online courses!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install Moodle 3.1 on Ubuntu 16 with PHP 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install Moodle 3.1 on Ubuntu 16 with PHP 7 - Globo.Tech","description":"This tutorial will show you how to install Moodle 3.1 on your Ubuntu 16 server with PHP 7. Read now & Create you own online courses!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/","og_locale":"en_US","og_type":"article","og_title":"How to install Moodle 3.1 on Ubuntu 16 with PHP 7 - Globo.Tech","og_description":"This tutorial will show you how to install Moodle 3.1 on your Ubuntu 16 server with PHP 7. Read now & Create you own online courses!","og_url":"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/","og_site_name":"Globo.Tech","article_published_time":"2016-07-18T18:07:23+00:00","article_modified_time":"2017-11-24T20:12:29+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/","url":"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/","name":"How to install Moodle 3.1 on Ubuntu 16 with PHP 7 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-07-18T18:07:23+00:00","dateModified":"2017-11-24T20:12:29+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you how to install Moodle 3.1 on your Ubuntu 16 server with PHP 7. Read now & Create you own online courses!","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/install-moodle-ubuntu-16-php7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to install Moodle 3.1 on Ubuntu 16 with PHP 7"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2246"}],"version-history":[{"count":4,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2246\/revisions"}],"predecessor-version":[{"id":3849,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2246\/revisions\/3849"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}