How to Install Chamilo on Debian 9

Chamilo is a free e-learning and collaboration software which aims to improve the access to education on a global level. In this tutorial, we will show you how to install Chamilo on a Linux VPS running Debian 9 as an operating system.

Prerequisites

Before you start with the installation steps make sure your server meets the Chamilo requirements. Here is the list of Chamilo requirements:

  • Apache 2.2+
  • MySQL 5.6+ or MariaDB 5+
  • PHP 5.5+

Also, you need to have the following PHP modules installed and enabled:

  • php-intl
  • php-gd
  • php-mbstring
  • php-imagick
  • php-curl
  • php-mcrypt
  • php-xml
  • php-zip

If some of the software required for Chamilo to work is not installed or enabled on the server you can follow the steps below to install it.

Install Apache, MySQL and PHP on a Debian 9 VPS

Our Debian 9 VPS hosting comes with Apache, MySQL and PHP pre-installed. To install all the software including the dependencies on your server, first you need to connect to your Linux VPS via SSH and then you can run the commands below:

apt-get update
apt-get install apache2 mysql-server php php-mysql php-intl php-gd php-mbstring php-imagick php-curl php-mcrypt php-opcache php-xml php-zip

To verify the installation is completed run the following commands:

apache2 -v
# Server version: Apache/2.4.25 (Debian)
# Server built:   2018-06-02T08:01:13
mysql -V
# mysql  Ver 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
php -v
# PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
# Copyright (c) 1997-2017 The PHP Group
# Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
#    with Zend OPcache v7.0.30-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies

Configure Apache for Chamilo on Debian 9

First of all, create an Apache virtual host for your new Chamilo website:

nano /etc/apache2/sites-available/yourdomain.com.conf

Add the following content:

<VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot /var/www/chamilo
 ServerName yourdomain.com
 ServerAlias www.yourdomain.com
 <Directory /var/www/chamilo/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
 </Directory>
 ErrorLog /var/log/apache2/yourdomain.com-error_log
 CustomLog /var/log/apache2/yourdomain.com-access_log common
</VirtualHost>

Replace yourdomain.com with your actual domain name. Save and close the file. Then, enable the configuration and restart the Apache web server:

a2ensite yourdomain.com
systemctl restart apache2.service

Create MySQL database for Chamilo on Debian 9

Next, create a MySQL database for Chamilo. Log into your MySQL database server as root:

mysql -u root -p

Then, create a new database, a database user and set up a password using the commands below:

mysql> CREATE DATABASE chamilo;
mysql> GRANT ALL PRIVILEGES ON chamilo.* TO 'chamilo'@'localhost' IDENTIFIED BY 'YoUrPaSsWoRd';
mysql> FLUSH PRIVILEGES;
mysql> \q

Of course, you need to replace YoUrPaSsWoRd with a strong password of your choice.

Configure PHP for Chamilo on Debian 9

In order for Chamilo to work properly,  you need to adjust some PHP settings. First, find the location of the php.ini file which is currently in use. Run the following command in your terminal:

php --ini | grep "Loaded Configuration File"

Then, edit the following settings as follows:

max_execution_time = 300
max_input_time = 300
memory_limit = 128M
post_max_size = 64M
upload_max_filesize = 128M
max_file_uploads = 20

magic_quotes_gpc = Off
short_open_tag = Off
display_errors = Off

Save the changes you have made in the php.ini and restart Apache again.

systemctl restart apache2.service

Download and Install Chamilo on Debian 9

The next step is to download and install Chamilo on your Debian VPS. Download the latest version of Chamilo from the official Chamilo download page. At the moment of writing, the latest version is 1.11.8 which works well with PHP 7.0.x or later.

cd /var/www
wget https://github.com/chamilo/chamilo-lms/releases/download/v1.11.8/chamilo-1.11.8-php7.zip

Extract the zip archive you have just downloaded:

unzip chamilo-1.11.8-php7.zip

While you are in /var/www, rename the Chamilo directory, change the ownership of the files and remove the zip archive:

mv chamilo-1.11.8-php7 chamilo
chown -R www-data: chamilo/
rm -f chamilo-1.11.8-php7.zip

Now, open your favorite web browser and enter your domain in the search bar. You should see the Chamilo installation wizard which looks like the one on the image below:

installing chamilo on debian 9

 

Follow the installation process to complete the setup. It is OK to accept all default values. You should also consider changing the admin password so you can easily remember it. Once you are done with the installation of Chamilo on your server, you can refer to the official Chamilo documentation for more instructions on how to use and customize the software.


install chamilo on debian 9

Of course, you don’t have to install Chamilo on Debian 9, if you use one of our Debian Cloud VPS Hosting services, in which case you can simply ask our expert Linux admins to install Chamilo on Debian 9 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install Chamilo on Debian 9, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment