Chamilo is a free and open source e-learning management system designed and developed for improving access to education and knowledge globally. It is released under the license of GNU General Public License version 3 or latter. It is currently backed up and supported by the Chamilo Association, a non-profit organization with several aims including the promotion of the software, ensuring the software 100% free, the maintenance and creation of network of services providers and software contributors. This piece of software allows us to create a virtual campus for the provision of online or semi-online training. Chamilo comes in two different tastes, one is the Chamilo Learning Managemt System (LMS) whereas the other is the Chamilo Learning Content Mangement System (LCMS) which offers a closely related but alternative platform model to the Chamilo LMS enabling users to manage their content in a particularly broad and flexible way. Here in this tutorial, we are talking about the LMS edition of Chamilo when we say Chamilo. To setup Chamilo in linux machine running Ubuntu 15.04 and CentOS 7, we'll need to follow the below steps.
1. Installing LAMP Stack
LAMP Stack stands for the combination of Apache Web Server, MariaDB or MySQL Database server and PHP modules in a Linux server. So, first of all we'll need to setup a LAMP Stack in our linux machine as Chamilo requires a server having an Apache Webserver (HTTPD), MySQL or MariDB 5.1 or latter and PHP 5.3 or latter installed and configured. Here in this tutorial, we'll install MariaDB instead of MySQL server for database as MariaDB is completely community driven with speed improvements and free extensions. To do so, we'll need to run the following commands under root or sudo privilege with respect to the distribution of linux installed in the machine.
On Ubuntu 15.04
# apt-get update
# apt-get install apache2 mariadb-server libapache2-mod-php5 php5-mysql php-pear php5-gd php5-intl php5-curl php5-xdebug php5-dev php5-ldap php5-xcache
On CentOS 7
# yum install httpd mariadb-server php-mysql php-pear php-gd php-xml php-intl php-curl phpxdebug php-dev php-mbstring php-ldap php-xcache
2. Installing Xapian
After we have installed our LAMP stack, we'll now need to setup Xapian in our linux machine. Though this is an optional package needed for Chamilo, we'll gonna install it in our system so that our Chamilo will work with its full features. Xapian PHP module has some license conflict with that of PHP so that, the binary formats of Xapian PHp module is not distributed only. That is the reason why php5-xapian is not available in the repository of Ubuntu or CentOS. So, what we'll need to do is install it manually using the latest stable release of Xapian. So, first we'll setup the dependencies required for configuring, compiling and installing Xapian in our linux machine.
To setup the required dependencies for the installation of Xapian, we'll gonna run the following commands.
On Ubuntu 15.04
# apt-get update
# apt-get install gcc g++ build-essential uuid-dev
On CentOS 7
# yum install gcc-c++ libuuid-devel
Downloading Xapian Packages
Once the required dependencies are installed, we'll gonna download the latest and stable Xapian packages from its official download page ie http://xapian.org/download . While writing this article, the stable latest release of Xapian was 1.2.21 which we'll find the link from the site and then download the tarballs with wget.
# wget http://oligarchy.co.uk/xapian/1.2.21/xapian-core-1.2.21.tar.xz
# wget http://oligarchy.co.uk/xapian/1.2.21/xapian-omega-1.2.21.tar.xz
# wget http://oligarchy.co.uk/xapian/1.2.21/xapian-bindings-1.2.21.tar.xz
Next, we'll need to extract the downloaded tarballs using tar.
# tar xvfJ xapian-core-1.2.21.tar.xz
# tar xvfJ xapian-omega-1.2.21.tar.xz
# tar xvfJ xapian-bindings-1.2.21.tar.xz
Compiling and Installing
After the extraction has been completed, we'll gonna compile and install our xapian package. First, we'll gonna compile xapian-core then xapian-omega and at last, we'll compile xapian-bindings. While running ./configure command under xapian-bindings, we'll need to make sure that we add --with-php flag so that we can only install xapian php module out of the box.
# make install
3. Configuring PHP
As we have installed all the required PHP modules in the above step, we'll now configure our PHP settings in order to gain the best performance out of Chamilo. To finetune our PHP configuration for Chamilo, we'll need to edit a file named php.ini which is located in different directory with respect to the distribution.
On Ubuntu 15.04
In Ubuntu distributions, php.ini file is located under /etc/php5/apache2/ directory so, we'll gonna edit he file using a text editor.
# nano /etc/php5/apache2/php.ini
On CentOS 7
Whereas, in CentOS, its situated under /etc/ directory so, we can simply edit it by running the following.
# nano /etc/php.ini
Once, the file is opened using a text editor, we'll simply need to append the file to have the following configuration.
date.timezone = 'America/New_York'
max_execution_time = 300
max_input_time = 600
memory_limit = 256M
post_max_size = 100M
upload_max_filesize = 100M
short_open_tag = Off
safe_mode = Off
magic_quotes_gpc = Off
magic_quotes_runtime = Off
session.cookie_httponly = On
extension = xapian.so
4. Starting Apache and MariaDB server
After we have installed the required dependencies, we'll now start our Apache web server and MariaDB database server as we need to configure them to make them ready to go with Chamilo.
On Ubuntu 15.04
As Ubuntu 15.04 is shipped with systemd as the default init system, we'll use systemctl command to start them. To do so, we'll need to run the following command.
# systemctl start apache2 mysql
Then, we'll make them start automatically in every system boot by enabling the daemons.
# systemctl enable apache2 mysql
Synchronizing state for apache2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d apache2 defaults
Executing /usr/sbin/update-rc.d apache2 enable
Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
Executing /usr/sbin/update-rc.d mysql enable
On CentOS 7
Likewise, CentOS 7 is also shipped with systemd as the default init system so, we'll simply need to execute the following command in the console.
# systemctl start httpd mysql
Next, as we did with Ubuntu, we'll simply enable the daemons to start in every system boot.
# systemctl enable httpd mysql
5. Setting MariaDB Root Password
On CentOS 7/Ubuntu 15.04
Now, as we are starting MariaDB for the first time and no password has been assigned for MariaDB so, we’ll first need to configure a root password for it. Then, we’ll gonna create a new database so that it can store data for our Chamilo installation.
To configure MariaDB and assign a root password, we’ll need to run the following command.
This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations.
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
installation should now be secure.
Thanks for using MariaDB!
6. Creating Chamilo Database
We'll now go for creating a new database for our Chamilo LMS so that it can store its data into our MariDB database. To do so, first we'll need to login to our MariaDB console by running the following command.
# mysql -u root -p
Then, it will ask us to enter the password of root user which we had just set in the above step. Then, we'll be welcomed into the MariaDB console in which we'll create our new database, database user and assign its password and grant all privileges to create, remove and edit the tables and data stored in it. Here, we'll set database name, user and password as chamilodb, chamilouser and Pa$$worD123 respectively.
> CREATE DATABASE chamilodb;
> CREATE USER 'chamilouser'@'localhost' IDENTIFIED BY 'Pa$$worD123';
> GRANT ALL PRIVILEGES ON chamilodb.* TO 'chamilouser'@'localhost';
> FLUSH PRIVILEGES;
Note: It is strongly recommended to replace all the above variables ie database name, user and password for security measure.
7. Downloading latest Chamilo LMS
Next, we'll download the latest release of Chamilo LMS ie 1.10 which we can download from the official download page ie https://chamilo.org/chamilo-lms/#downloads . Here, we'll gonna download the compressed zip file using wget file downloader by running the following command in a terminal or console.
# cd /tmp/
# wget https://github.com/chamilo/chamilo-lms/archive/v1.10.0.zip
--2015-11-14 19:56:47-- https://github.com/chamilo/chamilo-lms/archive/v1.10.0.zip
Resolving github.com (github.com)... 18.104.22.168
Connecting to codeload.github.com (codeload.github.com)|22.214.171.124|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 223918345 (214M) [application/zip] Saving to: 'v1.10.0.zip'
v1.10.0.zip 100%[============================>] 213.54M 12.2MB/s in 20s
2015-11-14 19:57:09 (10.8 MB/s) - 'v1.10.0.zip' saved [223918345/223918345]
After the download is completed, we'll extract the zip file using zip command as show below.
# unzip v1.10.0.zip
Then, we'll gonna move the extracted folder into the Apache Webroot ie /var/www/html/ by default.
# mv chamilo-lms-1.10.0 /var/www/html/chamilo
8. Configuring Apache Web Server
We'll add a new virtualhost in the apache web server so that we can define a specific configuration to the Chamilo installation. Creating it will help us to define ports, webroot, domain, alias and other configurations for our Chamilo installation. Here are some configurations we'll setup in this tutorial respective to the distribution of linux we're running.
On Ubuntu 15.04
# touch /etc/apache2/sites-available/chamilo.conf
# ln -s /etc/apache2/sites-available/chamilo.conf /etc/apache2/sites-enabled/chamilo.conf
# nano /etc/apache2/sites-available/chamilo.conf
Now, we'll gonna add the following lines of configuration into the opened file.
CustomLog /var/log/apache2/chamilo.linoxide.com-access_log common
After done, we'll gonna save the file and exit the text editor. Then, we'll need to make sure that mod is enabled. To enable it, we'll need to execute the following command.
# a2enmod rewrite
Then, we'll restart our apache web server.
# systemctl restart apache2
On CentOS 7
In our CentOS machine, we'll create a file named chamilo.conf under /etc/httpd/conf.d/ directory using a text editor.
# nano /etc/httpd/conf.d/chamilo.conf
Then, we'll gonna add the following lines of configuration into the file.
CustomLog /var/log/httpd/chamilo.linoxide.com-access_log common
Once done, we'll simply save the file and exit the editor. We'll now need to make sure that mod is enabled. To enable it, we'll need to execute the following command.
# a2enmod rewrite
And then, we'll gonna restart our apache web server.
# systemctl restart httpd
9. Fixing Ownership and Permission
We'll also need to set the ownership of the Chamilo installation path as the Apache process user so that apache web server will have full access over every directory and files of Chamilo. To do so, we'll need to run the following commands with respect to distribution of linux we are running, as there are different usernames used.
On Ubuntu 15.04
# chown -R www-data: /var/www/html/chamilo
On CentOS 7
# chown -R apache: /var/www/html/chamilo
Then, we'll need to set the permission of some directories as writable by executing the following command.
# cd /var/www/html/chamilo
# chown -R 755 main/lang main/inc/ main/default_course_document/images/
10. Configuring Firewall
Next, we'll gonna configure the firewall program to allow http or port 80 to expose out of the box. This will allow Chamilo to be accessible within the network connected. As both CentOS 7 and Ubuntu 15.04 are shipped with systemd as init system, firewalld are installed in most machines. To allow http (port 80) we'll need to run the following command.
# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload
11. Chamilo Web Installation
Finally, as we have setup and configured everything correctly in above steps, we'll now go for the web based installation of Chamilo LMS. To do so, we'll need to point our web browser to http://ip-address/chamilo or http://domain.com . Here, in this tutorial, we'll point our browser to http://126.96.36.199/chamilo . After done, we'll be welcomed by the Chamilo LMS Installation Page as shown below in which we'll click on "Install Chamilo" button in order to continue the installation process.
Then, we'll be navigated to our installation page in which we'll be required to select the installation language. Here, we'll select English and click on "Next" button to continue to the next page.
After done, we'll head forward towards the Requirements section in which we'll see if the required dependencies, ownerships and permissions are configured correctly or not. As we have already configured everything needed for running Chamilo smoothly, we'll see everything in green and blue color. If we see any red color, we'll know that the respective requirement is missing or misconfigured.
After verifying that everything is fine, we'll click on New Installation as we're going for a new installation of Chamilo. But if you are following this tutorial for Upgrading, then you can simply click on Upgrade button. Next, we'll be headed towards the License Agreement page in which we'll simply accept the license by ticking the box with I Accept text.
Now, here is the main part of the installation. Here, we'll need to enter the database configuration in order to connect Chamilo with the MariaDB database server so that it can store and retrieve its required data. Here, we'll need to enter the configuration according to the above step, database host as localhost, port as 3306 which is the default port of MariaDB whereas Database login, password and database name as chamilouser, Pa$$worD123 and chamilodb respectively.
After every configuration is done, Chamilo will gain access to the database and then will direct us to the overview page where we'll enter the information for our Chamilo application like Main Language, URL, Portal name, company's name, etc as shown below. After done, we'll go ahead towards the Install Page.
Here, we'll be shown all the settings and information set for the installation of Chamilo LMS. Now, in order to for the installation of it with those configurations, we'll need to click on Install Chamilo button.
After the installation process is completed, we'll be redirected to a post installation page where we'll be asked to make the entire app/config/ directory read-only and delete the main/install directory.
We'll now go for the security measures and do as said in the above page. To make the whole app/config/ directory read-only, we'll run the following command.
# chmod -R 0555 /var/www/html/chamilo/app/config/
Then, to remove the main/install/ directory, we'll execute as follows.
# rm -rf /var/www/html/chamilo/main/install/
After done, we'll click on Go to your newly created portal button then we'll enter the required login details that we had set above in order to login to the dashboard.
Once we have logged in, we'll finally be directed to the Control Panel of Chamilo LMS as shown below.
Finally, we've successfully configured and installed Chamilo LMS in our linux machine running Ubuntu 15.04 and CentOS 7. It is a beautiful web based learning management system (LMS) focusing on ease of use, re-usability, collaboration and sharing. It is full of different plugins which are essential for an e-learning system. The community of Chamilo is growing day by day as this project is highly stable and effective on managing all types of e-learning system. It consists of 27 gorgeous designs which one can use as base to design or customize according to one's requirement and desire. I wanna simply say that Chamilo is whole all-in-one Online Campus. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !