# Chamilo 1.8.7.1 : Installation Guide

Documentation > Installation Guide

Thank you for downloading Chamilo 1.8.7.1.

- Test Chamilo on Free Campus

This guide explains how to install Chamilo FREE. Please read this fully before proceeding with the installation.

## Contents

1. Pre-requisites
2. Installation of Chamilo LMS
3. Upgrade from a previous version of Chamilo/Dokeos
4. Troubleshooting
5. Administration section
6. LDAP
7. Mathematical formulas with LaTeX
8. Mathematical formulas with ASCIIMathML

## 1. Pre-requisites

Chamilo can be installed on Windows, Linux, Mac OS X and UNIX servers indifferently. However, we recommend the use of Linux server for optimal flexibility, remote control and scalability.
Chamilo is mainly a LMS running Apache 1.3, 2.0, MySQL 5.1 and PHP 5.2 (the so called AMP trilogy).
All these software are open source and freely available.
To run Chamilo LMS on your server, you need to install WAMP, LAMP or MAMP:

- To install WAMP (AMP on Windows), we recommend the XAMPP .exe installer
- To install LAMP (AMP on Linux), use the Package manager of your favourite distribution (Synaptic, RPMFinder etc.). For instance, on a Ubuntu server, use Shell or Synaptic following the Ubuntuguide on Apache and the following sections
- To install MAMP (AMP on Mac OS X), refer to the MAMP dedicated website

### MySQL database server

You will need a login and password allowing to administrate and create at least one database. By default, Chamilo will create a new database for each course created. It means your host should allow you to create and administrate several databases. You can also install Chamilo using only one database, in that case you have to select this option during the installation.

## 2. Installation of Chamilo LMS

- Download Chamilo LMS
- Unzip it
- Copy the Chamilo directory in your Apache web directory. This can be C:\xampp\htdocs\ on a Windows server or /var/www/html/ on a Linux server
- Open your web browser (Internet Explorer, Firefox...) and type http://localhost/chamilo/ if you install locally or http://www.domain.com/chamilo/ if you install remotely
- Follow the web installation process. You can accept all default values. Consider changing the admin password to remember it.

The following directories need to be readable, writeable and executable for everyone (replace [chamilo] with the directory where your Chamilo installation is located):

- [chamilo]/main/inc/conf/
- [chamilo]/main/upload/users/
- [chamilo]/main/default_course_document/images/
- [chamilo]/archive/
- [chamilo]/courses/
- [chamilo]/home/

Optionally, you can do the same to the following directories if you want to enable CSS styles package upload and sub-language definition:

- [chamilo]/main/css/
- [chamilo]/main/lang/

On Linux, Mac OS X and BSD operating systems you can use the CHMOD 0777 command for this (although we recommend you seek advice from an experienced system administrator to avoid security issues). On Windows, you may need to check the properties of the folders (by right-clicking on them).

2.5. The following files need to be readable and writeable for the web browser, only during the installation process:

- chamilo/main/inc/conf/configuration.php (if present)

On Linux, Mac OS X and BSD operating systems you can use the CHMOD 666 command for this (although we recommend you seek advice from an experienced system administrator). In Windows, you may need to check the properties of the files and folders (by right-clicking on them).

NOTES:
Do not modify the home_*.html files directly. Instead, choose "Configure the homepage" in the Chamilo administration section.

Windows : with combination packages like XAMPP, out of the box, login and password for MySQL should probably remain empty.

### Configuration and security after installation

- Protect your configuration file: make sure no one can overwrite it. You can find the config file in (chamilo folder)/main/inc/conf/configuration.php. Make it read-only (windows/xwindows: right-click the file to edit the properties. linux/bsd/macosx: use the chmod 444 command). The config file is created by Apache so you may need to be root user to change its permissions.
- Protect your installation folder: if the (chamilo folder)/main/install folder is still accessible, someone could install over your existing version (you could lose your data that way). Move the folder somewhere out of the web directories so it is not accessible, change its name, or edit its properties so no one can read or execute it.
- For better security: making the files world-writable will help you install, and solves many issues for people without much admin experience. However, it's better security to make the owner of the apache process (often called apache or www-data) also owner of all the chamilo files and folders. Ths way, these files need only be readable and writable by the Apache process owner, not by the entire world.
- Configure your Chamilo installation: in the administration section of Chamilo, you can use the Chamilo Config Settings to adjust the behavior of your installation.
- Configure Chamilo mail: most of Chamilo uses the mail settings from the php.ini file. However, the announcements tool uses phpMailer (another free software project) and the settings for this tool can be adjusted in (chamilo folder)/main/inc/conf/mail.conf.php.

### PHP configuration

To get the best of Chamilo, you need to finetune PHP settings. Consider :

- Editing php.ini file (on windows can be located at C:\xampp\php\php.ini, on Ubuntu Linux : /etc/php5/apache2/php.ini
- search the word "max" and increase values to optimise the server
- you may want to end up with the following values :

max_execution_time = 300 ; Maximum execution time of each script, in seconds
max_input_time = 600 ; Maximum amount of time each script may spend parsing request data
memory_limit = 256M ; Maximum amount of memory a script may consume (128MB)
post_max_size = 64M
upload_max_filesize = 100M

Some users could meet problems if their PHP settings don't fit these ones:

- short_open_tag = On
- safe_mode = Off
- magic_quotes_gpc = On
- magic_quotes_runtime = Off

Past Chamilo versions required register_globals to be set to On. This is no longer necessary, this can be set to Off and Chamilo will work fine.

Note: if you are using PHP 5.3 or higher, you need to set your date.timezone setting to whatever your server's timezone is. For example, if your server is in the 'America/New_York' timezone, set this in your php.ini:

date.timezone = 'America/New_York'

BSD users: these php libraries have to be included during php installation:

- php-mysql The mysql shared extension for php
- php-pcre The pcre shared extension for php
- php-session The session shared extension for php
- php-zlib The zlib shared extension for php
- (optional) php-ldap if you want to be able to use LDAP authentication

You might also add the following php modules and packages:

- php-ctype
- php-gd
- php-iconv
- php-json
- php-mbstring

## 3. Upgrade from a previous version of Chamilo/Dokeos

Before upgrading we heavily recommend you do a full backup of the previous Chamilo/Dokeos directories and databases. If you are unsure how to achieve this please ask your hosting provider for advice.

### 3.1 Upgrading from Chamilo 1.8.7

- check that you haven't left any customised stylesheet or image*
- download the Chamilo 1.8.7.1 Palmas install package from the Chamilo download page
- unzip the new files of Chamilo 1.8.7.1 over the files of the older version (or unzip the files in one folder and then copy the files from there to the older version's directory)
- update $_configuration['system_version'] to '1.8.7.1' in the main/inc/conf/configuration.php file
- that's it! You are now using Chamilo 1.8.7.1

### 3.2 Upgrading from Dokeos 1.8.x

If you upgrade from Dokeos 1.8.x :

- check that you haven't left any customised stylesheet or image*
- download the Chamilo 1.8.7.1 Palmas install package from the Chamilo download page
- unzip the new files of Chamilo 1.8.7.1 over the files of the older version (or unzip the files in one folder and then copy the files from there to the older version's directory)
- point your browser on your portal URL + main/install/
- choose your language and click Upgrade from 1.8.x

* Styles and images are located in the main/css or main/img directories. You can still recover them from your backup if you have made it. Any modified style or image that uses the default style/image name will be overwritten by the next step. To avoid loosing your customisations, always ensure you copy the styles/images under a new name and use and modify the copy, not the original. The original will always be overwritten by newer versions. In Dokeos 1.8.5, we have changed the name of several CSS themes. Backwards compatibility is ensured by the fact that an upgrade only adds the new themes, but you should try and use these new themes rather than sticking to the old ones which will be deprecated shortly (not maintained).

### 3.3 Upgrading from Dokeos 1.6.x

If you upgrade from a lower version of Dokeos (1.6.x), the first and most important thing to do is to *move* your current directory to another place.
An easy way to do that is to create a subdirectory called "old_version" in your current Chamilo/Dokeos directory and move everything in there using a simple "move" command (i.e. under Linux: mkdir old_version; mv * old_verion/), then make the old_version/ directory writeable by the web server so that courses/ and upload/ directories can be moved from the old to the new installation.
The complete process is as follow:

- move the current Dokeos directory contents to a subdirectory called old_version and make it writeable by the web server. This is important to allow the move of the courses/ and upload/ directories to the new install
- download the Chamilo 1.8.7.1 install package from the Chamilo download page
- unzip the new files of Chamilo 1.8.7.1 in the main Chamilo/Dokeos directory. The new directory main should be located directly inside your Chamilo/Dokeos root folder
- point your browser on your portal URL
- choose your language and click Upgrade from 1.6.x and confirm the current directory of the old version

NOTE: The upgrade from 1.6.x to 1.8.x implies a revision of the customised graphics and styles. The new version uses a complete new set of icons and styles, which means the ones from version 1.6 cannot be simply reused. The good news is the version 1.8.x allows you to create your own style in a separate css folder, that you can then reuse through all the 1.8.x versions

WARNING:
Do not delete the previous Chamilo/Dokeos installation directory before installing the new one. When the update is successfully finished, you can remove the old path.

NOTE:
Do not modify the home_*.html files directly. Instead, choose "Configure the homepage" in the Chamilo administration section.

### 3.4 In both last cases

The following directories need to be readable, writeable and executable for the web server:

- chamilo/main/inc/conf/
- chamilo/main/upload/users/
- chamilo/main/default_course_document/
- chamilo/archive/
- chamilo/courses/
- chamilo/home/

On Linux, Mac OS X and BSD operating systems you can quick-fix this using the CHMOD 777 command, but if you are unsure, we recommend you seek advice for your own OS on our forum. In Windows, you may need to check the properties of the folders.

### 3.5 Quick-upgrade from 1.6.x guide for Linux

The following quick-upgrade guide assumes that:

- the Chamilo database username (for MySQL) is "chamilo_db_user" and your login is "chamilo_user"
- the chamilo installation is currently in /var/www/chamilo/ and it has 777 permissions
- your portal's URL is http://www.portalurl.com/

On the command-line, type:

- cd /tmp
- mysqldump -u chamilo_db_user -p --all-databases --result-file=/home/chamilo_user/chamilo_old.sql
- cp -ra /var/www/chamilo /home/chamilo_user/backup_chamilo
- mkdir /var/www/chamilo/old_version
- mv /var/www/chamilo/* /var/www/chamilo/old_version/
- chmod -R 0777 /var/www/chamilo/old_version/
- wget http://www.chamilo.org/files/chamilo-1.8.7.1.tar.gz
- tar zxvf chamilo-1.8.7.1.tar.gz
- sudo cp -ra chamilo-1.8.7.1/* /var/www/chamilo/
- rm chamilo-1.8.7.1.tar.gz
- sudo rm -r chamilo-1.8.7.1/

Then (for cases other than from 1.8.7):

- Direct your browser to http://www.portalurl.com/main/install/
- Proceed with the installation
- Review the directories permissions

## 4. Troubleshooting

If you have problems, go to the Chamilo website and ask a question on the support forum. Please read the previous messages first to see if there is already an answer to your question. We also maintain a list of Frequently Asked Questions.

##

## 5. Administration section

To access the Chamilo administration section, open browser, go to your Chamilo adress and log in with the admin user. Then you will see a "Platform admin section" link in the header of the web page. There you can manage users, courses, sessions, portal look and feel, homepage content, course categories etc.

## 6. LDAP

This part is optional, only organisations with an LDAP server will need to read this.
An LDAP module is already provided in Chamilo, but it has to be configured to make it work.

### Compiling

Linux servers: It's possible that you have to recompile php with ldap support. Newer distributions also allow downloading rpms for additional packages.

### Activating LDAP in Chamilo

In (chamilo folder)/main/inc/conf/configuration.php, around line 90, you see
//for new login module
//uncomment these to activate ldap
//$extAuthSource['ldap']['login'] = "./main/auth/ldap/login.php";
//$extAuthSource['ldap']['newUser'] = "./main/auth/ldap/newUser.php";
remove the // from the last two lines to activate LDAP.

### Settings

Ask the LDAP server admin for the settings:

- ldap server name
- ldap server port (usually 389)
- ldap dc

Since 1.8.5, you have to change the LDAP settings inside the "Portal administration" panel, under "Chamilo configuration settings", section "LDAP".
As an example, you should find the following kind of values:
LDAP main server's address: "myldapserver.com"; // your ldap server
LDAP main server's port: 389; // your ldap server's port number
LDAP domain: "dc=xx, dc=yy, dc=zz"; //domain

### Teacher/student status

By default, Chamilo will check if the "employeenumber" field has a value. If it has, then Chamilo will consider this user as being a teacher.
If you want to change this behaviour, you can edit main/auth/ldap/authldap.php, function ldap_put_user_info_locally(), and change the if (empty($info_array[$tutor_field])) condition to whatever suits you.
You can also remove this check by removing the condition and leaving only the $status = STUDENT; line.

### Protected LDAP servers

Some LDAP servers do not support anonymous use of the directory services.
In this case, you should fill in the appropriate fields in the administration panel (e.g. "manager" and "mypassword") and Chamilo will try to authenticate using these, or fall back to anonymous mode before giving up.

### LDAP import into sessions

There is a new set of scripts now that allow you to insert users from LDAP directly into a Chamilo session. This, however, relies on a set of static choices in the LDAP contact attributes.
The fields used intensively by the Chamlio module are:

- uid, which is matched to the username in Chamilo
- userPassword, which is matched to the user password, although this part will only work for non-encrypted passwords for now, but it shouldn't be necessary if using the LDAP server as authentication
- ou should end with the year of the person registration or any criteria you will use to filter users, so that they can be retrieved on that criteria
- sn is used as the lastname field in Chamilo
- givenName is used as the firstname field in Chamilo
- mail is used as the email field in Chamilo

## 7. Mathematical formulas with LaTeX

This part is optional, only organisations planning to use mathematical formulas inside the online editor might want to read this.
You can enable mathematical equations writing inside the Chamilo online editor (FCKEditor) by applying the following steps:

- 1. Configure your Apache installation to add a cgi-bin directory that contains a symbolic link to the mimetex.cgi in chamilo/main/inc/lib/mimetex/ (*see below, step 4)
- 2. Reload your Apache configuration
- 3. Edit the online editor's configuration file chamilo/main/inc/lib/fckeditor/myconfig.php and
- 3.1. Enable the mimetex plugin, find the line //$config['LoadPlugin'][] = 'mimetex'; and modify it to be: $config['LoadPlugin'][] = 'mimetex'; (remove the double slash)
- 3.2. The additional settings $config['MimetexExecutableInstalled'] , $config['MimetexExecutableDetectionMethod'] and $config['MimetexExecutableDetectionTimeout'] are configured for best probability of automatic detection of the installed on the server file mimetex.cgi or mimetex.exe. In rare cases these options might need to be twicked, see the acccompanying comments about these options within the file myconfig.php
- 3.3. Once the plugin has been activated, almost in all toolbars the corresponding button appears. If you need to edit some toolbars, see the configuration files (php) within the directory chamilo/main/inc/lib/fckeditor/toolbars/ . Here is an example:
  $config['ToolbarSets']['Normal'] = array(
  array('FitWindow','Bold','Image','Link','PasteWord','MP3','mimetex','Table','Subscript','Superscript','ShowBlocks')
  );
  The item 'mimetex' represents the button, you may add it to or remove it from any toolbar.
- 4. To install mimetex executable file, make these changes:

Add the corresponding cgi-bin directory to your Apache configuration could be done, in Apache 2, like this:

ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

Adding a symbolic link can be done, under Windows, by creating a shortcut to the mimetex.exe file from the cgi-bin directory, or under Linux by issuing the following command:

ln -s /var/www/chamilo/main/inc/lib/mimetex/mimetex.cgi /var/www/cgi-bin/mimetex.cgi

If you are reluctant to modify your Apache configuration, alternately you may do at step 4 the following: copy mimetex.exe (for windows) or mimetex.cgi (for linux) from chamilo/main/inc/lib/mimetex/ directory to your cgi-bin/

- 5. Make sure that the file mimetex.cgi (or mimetex.exe) has right to be executed by the web-server process. For example, on a Ubuntu Linux system you may write a command like the following:
  sudo chmod a+x mimetex.cgi

As a result of this procedure, a new button becomes available in your Chamilo online editor, that gives you possibility to insert mathematical formulas into your documents.

## 8. Mathematical formulas with ASCIIMathML

Mathematical formulas may be rendered on web-pages using the script ASCIIMathML.js (a customized version for Chamilo). For more information about this script and about the ASCIIMath formula syntax see http://www1.chapman.edu/~jipsen/mathml/asciimath.html and http://dlippman.imathas.com/asciimathtex/AMT.html.

For writing ASCIIMath formulas in documents, a correspondent plugin for the online editor should be activated. For doing this, see the platform administration section and open the page "Administration > Configuration settings > WYSIWYG Editor". Enable the setting "ASCIIMathML mathematical editor".

Inside documents, the script ASCIIMathML.js renders mathematical formulas in two altrnative ways:

- By translation ASCIIMath formula notation into MathML code. MathML standard currently is supported by the following browsers:
  - Mozilla Firefox, you may consider installing STIX fonts (http://www.stixfonts.org) on your client machines for nice looking formulas
  - Internet Explorer 6 or higher with the add-on MathPlayer 2.0 or higher (http://www.dessci.com/en/products/mathplayer)
  - Opera 9.5 or higher
- For browser that do not support MathML - by translation ASCIIMath formula notation into TeX notation and passing it to an external service. The external service produces and returns an image that contains the formula. This way is so called "image-based fallback".

For providing image-based fallback in a production system, you should pick up and install on your server software for TeX rendering, such as:

- mimeTeX - http://www.forkosh.dreamhost.com/source_mimetex.html. See "7. Mathematical formulas with LaTeX" on how to install the mimetex executable file on your server
- mathTeX - http://www.forkosh.com/mathtex.html. Browse the site for installation instructions

As an alternative, you may try to use some public services for TeX rendering, such as:

- MathTran - http://www.mathtran.org
- Google Chart Tools - http://code.google.com/apis/charttools

Open with a text editor the file .../chamilo/main/inc/lib/asciimath/ASCIIMathML.js. Find somewhere at the beginning the line that initializes the variable AMTcgiloc. You may need to alter the setting to be for example:

- var AMTcgiloc = "http://mychamiloserver.org/cgi-bin/mimetex.cgi";
- var AMTcgiloc = "http://mychamiloserver.org/cgi-bin/mathtex.cgi";
- var AMTcgiloc = "http://www.mathtran.org/cgi-bin/mathtran?tex=";
- var AMTcgiloc = "http://chart.apis.google.com/chart?cht=tx&chs=1x0&chl=";
- ... or something else

For testing how the variable AMTcgiloc may be set, there are some examples (as comments) inside the script.

Contact address
Mail: info@chamilo.org