How to install Moodle in Ubuntu)
This is a step-by-step guide on how to install Moodle on Ubuntu 16.04. Moodle (Modular object-oriented dynamic learning environment Modular-object-oriented dynamic learning environment) is a free and open-source learning management system, provides a personalized learning environment for teachers, students, and administrators. Moodle is created by the Moodle project and centrally led and coordinated by the Moodle headquarters.
Moodle has many very practical functions, such:
- Modern and easy-to-use interfaces
- Personalized dashboard
- Collaboration tools and activities
- Integrated calendar
- Simple text editor
- Progress tracking
- Announcement
- Numerous...
In this tutorial, We will guide you to install the latest version of Moodle on Ubuntu 16.04 VPS using Apache web server, MySQL, and PHP 7. (LCTT annotation: the installation of later versions of Ubuntu is similar .)
1. Log On Through SSH
First, use the root user to log on to Ubuntu 16.04 VPS through SSH:
ssh root@IP_Address -p Port_number
2. Update the operating system software package
Run the following command to update the system software package and install some dependent software:
apt-get update &&apt-get upgrade
apt-get install git-core graphviz aspell
3. Install the Apache Web Server
Run the following command to install the Apache Web server from the Ubuntu software Repository:
apt-get install apache2
4. Start the Apache Web Server
Once the installation is complete, start Apache and enable it to automatically start when the system starts. Use the following command:
systemctl enable apache2
5. install PHP 7
Next, we will install some additional PHP modules required by PHP 7 and Moodle. The command is:
apt-get install php7.0 libapache2-mod-php7.0 php7.0-pspell php7.0-curl php7.0-gd php7.0-intl php7.0-mysql php7.0-xml php7.0-xmlrpc php7.0-ldap php7.0-zip
6. install and configure the MySQL database server
Moodle stores most of the data in the database, so we will use the following command to install the MySQL database server:
apt-get install mysql-client mysql-server
Runmysql_secure_installation
Configure the MySQLroot
Password to ensure MySQL security.
Toroot
The user logs on to the MySQL server, creates a database for Moodle, and can access it. The following are specific operation instructions:
mysql -u root -p
mysql> CREATE DATABASE moodle;
mysql> GRANT ALL PRIVILEGES ON moodle.* TO 'moodleuser'@'localhost' IDENTIFIED BY 'PASSWORD';
mysql> FLUSH PRIVILEGES;
mysql> \q
RememberPASSWORD
Replace it with a safe password.
7. Obtain Moodle from the GitHub Repository
Next, switch to the current working directory and copy Moodle from the official GitHub Repository:
cd/var/www/html/
gitclone https://github.com/moodle/moodle.git
Switchmoodle
Directory to check all available branches:
cd moodle/
git branch -a
Select the latest stable version (currentlyMOODLE_34_STABLE
), Run the following command to tell git which branch can be tracked or used:
git branch --track MOODLE_34_STABLE origin/MOODLE_34_STABLE
And switch to this specific version:
git checkout MOODLE_34_STABLE
Switched to branch 'MOODLE_34_STABLE'
Your branch is up-to-datewith'origin/MOODLE_34_STABLE'.
Create a directory for storing Moodle data:
mkdir/var/moodledata
Set the ownership and access permissions correctly:
chown-R www-data:www-data /var/www/html/moodle
chown www-data:www-data /var/moodledata
8. Configure the Apache Web Server
Use the following content to create an Apache Vm for your domain name:
nano/etc/apache2/sites-available/yourdomain.com.conf
ServerAdmin admin@yourdomain.com
DocumentRoot/var/www/html/moodle
ServerName yourdomain.com
ServerAlias www.yourdomain.com
OptionsIndexesFollowSymLinksMultiViews
AllowOverrideAll
Order allow,deny
allow from all
ErrorLog/var/log/httpd/yourdomain.com-error_log
CustomLog/var/log/httpd/yourdomain.com-access_log common
Save the file and enable the VM:
a2ensite yourdomain.com
Enabling site yourdomain.com.
To activate the new configuration, you need to run:
service apache2 reload
Finally, restart the Apache Web server to make the configuration take effect:
service apache2 reload
9. Follow the prompts to complete the installation.
Now, click http://yourdomain.com (LCTT Note: Enter the above domain name in the address bar of the browser to access the Apache WEB Server), follow the prompts to complete the installation of Moodle. For more information about how to configure and use Moodle, see its official documentation.
If you use our optimized Moodle hosting host service, you do not have to install Moodle on Ubuntu 16.04. In this case, you only need to ask our professional Linux system administrator to install and configure the latest version of Moodle on Ubuntu 16.04. They will provide 24 × 7 response services in a timely manner. (LCTT ~)
PS. If you like this post about how to install Moodle on Ubuntu 16.04, please share it with your friends on social networks or leave your reply. Thank you.
Via: https://www.rosehosting.com/blog/how-to-install-moodle-on-ubuntu-16-04/
Author: RoseHosting Translator: Steven zdg988 Proofreader: wxy
This article was originally compiled by LCTT and launched with the honor of Linux in China