How to install Moodle 2.9 on CentOS/RHEL 7/6/5
Moodle (Modular Object-Oriented Dynamic Learning Environment) is a free open-source learning management system or e-Learning platform, that makes it easy for you to provide online support for your course. Moodle provides a place where you can easily create web pages with information about your course and provide links to word documents, slides, and other resources that your students will want to access.
The department and the university provide a wealth of materials and resources, but catering for so many different types of students it can be hard for learners to find those that are most relevant to them. You can use your Moodle to provide links directly to the resources that will be most useful for your students whether e-library resources, skills courses, or information
Advantages:
Other Features & Tools:
Install Required Packages
Install order to setup Moodle first we need to install all required packages. First we need to install and configure LAMP and after that all PHP extension.
install LAMP on CentOS/RHEL 5/6
Install LAMP on CentOS/RHEL 7
# yum install php-iconv php-mbstring php-curl php-openssl php-tokenizer php-xmlpc php-soap php-ldap php-pecl-apc # yum install php-ctype php-zip php-gd php-simplexml php-spl php-pcre php-dom php-xml php-intl php-json # yum install wget
Download Moodle and Decompress
After downloading all require packages now we download Moodle and decompress it. You can directly download latest version of moodle from https://download.moodle.org/
# cd /var/www/html # wget https://download.moodle.org/download.php/direct/stable29/moodle-latest-29.zip # unzip moodle-latest-29.zip
Set the following permissions for apache user to moodle directory:
# chmod -R 755 /var/www/html/moodle # chown -R apache.apache /var/www/html/moodle
Create data directory for Moodle
Moodle obliges a directory to store all its files, session information and so on. The web server needs to be able to write to this directory. This directory must NOT be accessible directly via the web.
# mkdir /var/www/html/moodledata
Set the following permissions for apache user to moodle directory:
# chmod -R 777 /var/www/html/moodledata # chown -R apache.apache /var/www/html/moodledata
Configure Web Server VirtualHost
Now we will create a VirtualHost in Apache configuration file /etc/httpd/conf.d/moodle.techoism.com.conf
<VirtualHost *:80> ServerName moodle.techoism.com ServerAlias www.moodle.techoism.com DocumentRoot /var/www/html/moodle ErrorLog /var/log/httpd/moodle.techoism.com_error_log CustomLog /var/log/httpd/moodle.techoism.com_access_log combined DirectoryIndex index.html index.htm index.php index.php4 index.php5 <Directory /var/www/html/moodle> Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch Allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch </Directory> </VirtualHost>
Restart Apache Server to reload changes.
For CentOS 5/6 # service httpd restart For CentOS 7 # systemctl restart httpd
Finally Start Moodle Web Installer
Open up your web browser and navigate to http://moodle.techoism.com and follow instruction:
In next step we will mention Web Address, Moodle directory and Data directory path.
Select the database driver and press next.
Enter Database name and other require information and press next.
Now click on Continue to accept the License Agreement.
Now the installer will check for all require modules are installed, press continue.
Installing all Moodle modules. Click continue when complete.
Create a Administrator account and click Update.
Now do all require setting, press save.
Now your moodle site has been successfully installed.
See Also:
How To Install Moodle on Ubuntu using Nginx
Enjoy it!
Data directory (/var/www/html/moodledata) cannot be created by the installer.
Apparently the access rights still don’t work right; not sure what’s going on here really as I’ve tried everything.
Hi,
Thanks for using our blog.
Installer will not create the data directory (/var/www/html/moodledata) you need to create it and give full permissions before installation.
Note: If you are installing Moodle on a server that supports SELinux (e.g. RedHat or Fedora desktop) then you will need to ensure that your data directory’s security context is set correctly. httpd_sys_content_rw_t is required for all content which needs to available to httpd scripts. Use the chcon command to set the context, for example chcon -R -t httpd_sys_content_rw_t var/www/html/moodledata
Thanks for you note Federico.
I have Ubuntu installed on my server so I was searching for a tutorial on how to install Moodle on an Ubuntu server using Nginx. Luckily, I found this blog post: https://www.rosehosting.com/blog/install-moodle-on-an-ubuntu-14-04-vps-with-mariadb-php-fpm-and-nginx/ and finished the installation.
If you have any requirement then please tell us so we can provide article for you or you can also send email on our official email I’d support@techoism.com.
Thanks for your support.
I have write the article for Ubuntu also. Please check.
http://www.techoism.com/how-to-install-moodle-on-ubuntu-using-nginx/
chcon -Rvu system_u -t httpd_sys_content_rw_t /var/www/html/moodledata/
I’d recommend you to use a managed platform to host your Moodle website. You can install it 1 click, which is much efficient than this method. Here is an example.
http://www.cloudways.com/blog/moodle-on-amazon-cloud-aws/
Yes! The link you provided for AWS Server and the article is for those who don’t use AWS Server.
Thanks for you compliment.
We are running this blog from last 5-6 months.