{"id":18310,"date":"2015-12-16T12:42:48","date_gmt":"2015-12-16T18:42:48","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=18310"},"modified":"2022-12-29T11:19:54","modified_gmt":"2022-12-29T17:19:54","slug":"install-moodle-3-0-on-a-linux-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-moodle-3-0-on-a-linux-vps\/","title":{"rendered":"Install Moodle 3.0 on a Linux VPS"},"content":{"rendered":"
Moodle is an all-in-one learning platform which is very flexible and highly customisable. It is robust and secure which is the main\u00a0reason why it is trusted by institutions and organizations worldwide. In this tutorial, we will explain how to install Moodle 3.0 on a Linux VPS<\/a><\/strong>.<\/p>\n <\/p>\n Login to your server via SSH and update your system.<\/p>\n For Ubuntu:<\/p>\n For CentOS:<\/p>\n Moodle 3.0 requires LAMP to be installed on your server. Make sure that you have Apache web server, MySQL database server and PHP already installed. In addition, Moodle requires a number of PHP extensions like mbstring, curl, gd, xml, simplexml, zip, soap etc. to be already installed on your Linux VPS<\/a>, so make sure that all of the required PHP extensions are installed on your server. You can find the full list of required PHP extensions as well as all the recommended PHP settings at https:\/\/docs.moodle.org\/30\/en\/PHP<\/a>.<\/p>\n Once your server is ready, you can proceed with the installation of Moodle 3.0.<\/p>\n Navigate the the ‘\/var\/www\/html\/’ directory:<\/p>\n Download the latest stable release:<\/p>\n Extract the archive:<\/p>\n Change the ownership of the files.<\/p>\n For Ubuntu:<\/p>\n For CentOS:<\/p>\n Next, create a MySQL database for Moodle. Log into MySQL as root:<\/p>\n Create a new database and use ‘utf8_unicode_ci’ for collation:<\/p>\n Add a database user and set up a password:<\/p>\n Feel free to add a database user and set up\u00a0a\u00a0password that matches your needs. Make sure that ‘yourdomain.com’ is replaced with your actual domain name. Once you make the changes, save the file and restart your Apache web server for the changes to take effect.<\/p>\n To continue with the online installation of Moodle, you should open your favorite web browser and enter your domain name into the address bar.<\/p>\n Once Moodle is completely installed on your Linux VPS, you will need to set up a cron job. Here is a typical cron entry:<\/p>\n In order Moodle to be able to send you emails, you need to have a working mail server installed on your VPS, or, you should have access to an SMTP mail server.<\/p>\n Of course you don\u2019t have to do any of this if you use one of our Linux VPS hosting<\/a> services, in which case you can simply ask our expert Linux admins to install Moodle 3.0<\/strong> for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n PS<\/span>.<\/strong> If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" Moodle is an all-in-one learning platform which is very flexible and highly customisable. It is robust and secure which is … <\/p>\nsudo apt-get update && sudo apt-get -y upgrade<\/pre>\n
sudo yum -y update<\/pre>\n
cd \/var\/www\/html\/<\/pre>\n
wget https:\/\/download.moodle.org\/download.php\/direct\/stable30\/moodle-latest-30.tgz\r\n<\/pre>\n
tar -xzvf moodle-latest-30.tgz<\/pre>\n
chown -R www-data: \/var\/www\/html\/moodle<\/pre>\n
chown -R apache: \/var\/www\/html\/moodle<\/pre>\n
mysql -u root -p<\/pre>\n
mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;<\/pre>\n
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodle_user@localhost IDENTIFIED BY 'YoUrPaSsWoRd';\r\nmysql> FLUSH PRIVILEGES;\r\nmysql> \\q<\/pre>\n
\nNow, create an Apache virtual host for Moodle 3.0 and add the following content:<\/p>\n<VirtualHost *:80>\r\n ServerAdmin admin@yourdomain.com\r\n DocumentRoot \/var\/www\/html\/moodle\r\n ServerName yourdomain.com\r\n ServerAlias www.yourdomain.com\r\n <Directory \/var\/www\/html\/moodle\/>\r\nOptions Indexes FollowSymLinks MultiViews\r\nAllowOverride All\r\nOrder allow,deny\r\nallow from all\r\n <\/Directory>\r\n ErrorLog \/var\/log\/httpd\/yourdomain.com-error_log\r\n CustomLog \/var\/log\/httpd\/yourdomain.com-access_log common\r\n<\/VirtualHost>\r\n<\/pre>\n
* * * * * \/usr\/bin\/php \/var\/www\/html\/moodle\/admin\/cli\/cron.php >\/dev\/null<\/pre>\n