Chamilo 1.11 - Installation Guide

Thank you for downloading Chamilo

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

Spanish: También puede leer esta guía de instalación en español.

French: Vous pouvez aussi lire ce guide d'installation en français.

Italiano: puoi leggere questa guida anche in italiano.

Contents

  1. Pre-requisites
  2. Installation of Chamilo LMS
  3. Upgrade
  4. Troubleshooting
  5. Administration section
  6. LDAP 
  7. Mathematical formulas with WIRIS MathType
  8. Full-text indexation with Xapian
  9. Chamilo Rapid - PPT conversion system
  10. Setting chronological tasks
  11. Changing the language's firstname/lastname order
  12. Improving files download time
  13. Videoconference
  14. Rewrite configurations
  15. Upgrading from Git


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 (the so called AMP trilogy):
All these pieces of software are free software and freely available.

To run Chamilo LMS on your server, you need to install WAMP, LAMP or MAMP:

MySQL or MariaDB database server

You will need a login and password allowing you to manage and drop+create a database. Usually, the default configuration on local computers is to allow you to connect as root with an empty password. It is HIGHLY RECOMMENDED to change the password and define a user with access to only a specific database. Please refer to the MySQL or MariaDB documentation in order to do this.

Chamilo versions prior to 1.9.0 required to choose between multiple databases and a deprecated single-database mode. This has been cleaned up and simplified to one single database.
If you don't have create permissions for your database user, Chamilo will fail during installation because, to maintain the database clear of any remains of other systems, it will try to drop it before creating it again. This is explained in some detail in this issue report

Apache's redirects

Since version 1.10, Chamilo requires the web server to be able to deal with redirects. This is now very common within web platforms (be them CMS, LMS, ERP, etc) and allows them, between other things, to use URLs in an efficient and user-friendly manner.
If you don't use Apache as a web server, go to section "Rewrite configurations" at the end of this document.
If you do use Apache, configuring redirects is done in two small steps: For Apache <=2.2 (where /var/www/chamilo should be replaced by the path to your Chamilo install):
    <Directory />
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    <Directory /var/www/chamilo/>
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    
and for Apache >=2.4:
    <Directory />
        AllowOverride All
        Require all granted
    </Directory>
    <Directory /var/www/chamilo/>
        AllowOverride All
        Require all granted
    </Directory>
    

Once configured (and maybe this has already been done by your hosting provider), you can simply restart the web server to enable the change.

2. Installation of Chamilo LMS

Before you start installing Chamilo LMS, you must understand that, because we provide Chamilo as free software, many services providers have been able to develop extensions of Chamilo, which have made it possible to install Chamilo in many ways:

This guide only covers these 2 last methods. For other methods, you can always ask more information from the provider you will choose.

To install, follow these 6 simple steps:
  1. Download Chamilo LMS
  2. Unzip it
  3. Copy the Chamilo directory in your web server's root directory. This can be C:\xampp\htdocs\ on a Windows server or /var/www/html/chamilo (or /var/www/chamilo/) on a Linux server (You need to create the folder "chamilo")
  4. Verify your web server supports .htaccess files (see Rewrite section below)
  5. Open your web browser and type http://localhost/chamilo/ if you install locally for test purposes or http://www.your-chamilo-domain.com if you install remotely*
  6. Follow the web installation process. You can accept all default values. Consider changing the admin password to remember it. 

Recommendations


Note: if installing Chamilo locally using localhost or the IP address of your computer during the installation, you might get issues while accessing from another computer. To avoid this, you can apply a little change to your configuration file.

Permissions

The following directories need to be readable, writeable and executable by your web server. This usually requires no specific action on Windows servers, but will require a "chmod" under Linux and Mac. See instructions below.

Replace [chamilo] with the directory where your Chamilo installation is located): Optionally, you can do the same to the following directory if you want to enable sub-languages definition:

If you find a tests/ directory at the root of your package, please delete it. This is a development directory that has not been checked for security issues, an it should *never* be accessible to final users on a production server.

On Linux, Mac OS X and BSD operating systems you can use the chmod 0775 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).

Post-installation security checklist


PHP configuration

To get the best out of Chamilo, you need to finetune your PHP settings. Consider :
    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 = 100M
    upload_max_filesize = 100M
    short_open_tag       = 0
    safe_mode            = 0
    magic_quotes_gpc     = 0
    magic_quotes_runtime = 0

Important: 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 the date.timezone parameter to this value in your php.ini:

date.timezone = 'America/New_York';

Note: PHP 5.3.9 introduced the "max_input_vars" setting, which limits the number of elements you can send in one single form. If you are dealing with numerous users or very long learning paths (many items), make sure you set this setting higher than its default value of 1000.

BSD and CentOS users: these php libraries have to be included during the PHP installation (php might have to be replaced by php{version} in some instances):

You might also add the following php modules and packages:


3. Upgrade

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

NOTE: For very heavy Chamilo databases, some of our official providers have developed improved migration procedures that use more memory but process the upgrades much faster. If this is the kind of thing you need, we highly recommend you contact them (see reference below).

NOTE: This version of Chamilo can only be used to upgrade from earlier versions of Chamilo 1.9.*. You cannot use the normal upgrade scripts from Chamilo 1.11 to upgrade from Chamilo 1.8.* or even Dok€os 2.0 (which was born after the split with Chamilo). If you need this, please contact one of the Chamilo Association's official providers)

3.1 Upgrading from Chamilo 1.11.x (Minor version)

As this is only a minor version change from previous 1.11.* versions of Chamilo, the only thing you need to do is:
Important: If you are updating to 1.11.16 on a system that was initially installed before 2016 (before version 1.11.0), you will need to download this file, drop it in your main/inc/ directory, edit it, remove the
exit;
on line 15, then load it in your browser as https://yoursite.com/main/inc/fix_quiz_id_to_iid.php. This will fix an issue with inconsistent quiz, quiz questions and answers internal numbering that existed prior to year 2016 (version 1.11.0). If your system was initially installed with version 1.11.0 or superior, you don't need to do anything.

3.2 Upgrading from Chamilo 1.10.x

Please note that if you (unluckily) upgraded from any of the 1.9 versions to 1.10.0 against our recommendations, we provide a patch script that should get most of it in order. The script is available here:
https://raw.githubusercontent.com/chamilo/chamilo-lms/1.10.x/tests/scripts/fix_migrations_1.9.x_1.10.0.php or, if you are using a development version of Chamilo, directly into you tests/scripts/ folder. You should place the file in the /tests/scripts/ folder, then edit it to remove the "die();" line, then launch it from your browser (after connecting to your Chamilo site as admin). You should also remove the scripts afterwards.
This script is provided without warranty. Please *always* take a backup before you use it.

3.3 Upgrading from Chamilo 1.9.x

Chamilo LMS 1.11.x comes with a new database structure in comparison to 1.9, as was the case between 1.9 and 1.8. Although the upgrade script takes the migration in charge, it might be generating a very heavy load on your server during the upgrade, and will change your database considerably, preserving the data as well as possible (we have tested the procedure many times, but remember this is GNU/GPLv3 and we cannot be held responsible for what would happen to your data without professional supervision). This is why we *really* recommend you take a full backup of your system before you upgrade.

Also note that Chamilo LMS 1.10 unites all language files from the main/lang/ directory into one single file by language. If you have changed language files directly (instead of using the recommended way: sub-languages), you should take a backup copy of these changed translations before you upgrade. Sublanguages might also require some manual work, but the upgrade procedure will not touch sublanguages directly.


* 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 Dok€os 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).

WARNING:
Do not delete the previous Chamilo installation directory before installing the new one. The upgrade process should take care of all unrequired folders.

3.4 Upgrading from Chamilo 1.8.x

To upgrade from version of Chamilo prior to 1.9.0, you will need to first upgrade them to 1.9.10.x, then upgrade again (separately) to 1.11.x. You can find the 1.9.10.x packages here: https://github.com/chamilo/chamilo-lms/releases

3.5 Directories permissions when upgrading from 1.9.x

The following directories need to be readable, writeable and executable for the web server: On Linux, Mac OS X and BSD operating systems you can quick-fix this using the chmod 0777 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.


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.


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 "Administration" tab in the webpage header. You can manage users, courses, sessions, portal look and feel, homepage content, course categories etc. there 


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

Note: Please check the LDAP configuration settings inside Chamilo to learn the details.

In [Chamilo folder]/app/config/configuration.php, around line 93, you'll find settings like the following:
// -> Uncomment the two lines below to activate LDAP AND edit main/inc/conf/auth.conf.php for configuration
// $extAuthSource["extldap"]["login"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/login.ldap.php";
// $extAuthSource["extldap"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/newUser.ldap.php";
remove the // from the last two lines to activate LDAP.

Settings

Ask the LDAP server admin for the settings:

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:


7. Mathematical formulas with WIRIS MathType

Installing this plugin you get WIRIS MathType.
This activation will not be completed unless you have previously downloaded the PHP plugin for CKeditor WIRIS and unzipped its contents into the main/inc/lib/ckeditor/editor/plugins/ckeditor_wiris/ directory.

This is necessary because Wiris is proprietary software and its services are commercial. To make adjustments to the plugin, edit configuration.ini file or replace his content by configuration.ini.default Chamilo file.


8. Full-text indexation with Xapian

Note: This step will require a dedicated server or a virtual dedicated server as the packages involved are not available on most shared hosting solutions.
On Debian or Ubuntu 10.04 and superior, you will simply need to install the php5-xapian package and restart your web server:

sudo apt-get install php5-xapian
sudo /etc/init.d/apache2 restart

Then go to your administration page -> Configuration settings -> Search and enable the search tool. Follow the recommendations on the page to get the complete indexing suite installed. Once you're done, all documents you import into your Chamilo portal in a recognized format will be indexed and searchable. Chamilo intermediate Administrators training (which you can ask any Chamilo's Official Provider for) include a full review of the full-text search feature.

Note: Xapian's licensing for the PHP extension is a bit different than what is necessary to enter the Debian repositories, so it has been excluded. You can, however, generate your own package by following the packaging instructions on Xapian's wiki.


9. Chamilo Rapid - PPT conversion system

Note: This step will require a dedicated server or a virtual dedicated server as the packages involved are not available on most shared hosting solutions.
On Debian or Ubuntu 22.04 and superior, install LibreOffice v7 (or superior) and start it as a headless server:

sudo apt-get install libreoffice screen
sudo adduser rapid
sudo adduser rapid www-data
screen
sudo -s
su - rapid
/usr/bin/libreoffice --headless --accept="socket,host=127.0.0.1,port=2002;urp;"
CTRL+a, CTRL+d
In previous versions of LibreOffice, the command above was more complex. If you still need it, please check previous versions of this installation guide. Please note that this will effectively launch LibreOffice in a "headless" mode (thanks to the --headless option), in a "headless" terminal (thanks to screen). You can later get back into your "headless" terminal by launching:
sudo screen -r
You can then go to your administration page -> Chamilo Rapid and set the host to "localhost" and the port to "2002". Save. Go to your course, learning path tool and see the new icon appeared. Import your PPT. This should work. Note: Sometimes, this doesn't work out so easily. You can probably ask for the assistance of any system administrator around with a bit of Java and PHP experience, or you can always ask one of the Chamilo's Official Providers for assistance (ask for a guaranteed commercial contract). The above is *not* meant for production servers with a high load. You should get a real system administrator to look at it and develop init scripts, in a way that makes monitoring and relaunching feasable. If any sysadmin wants to contribute this, feel free to contribute it to Chamilo: send us an e-mail at info@chamilo.org. Note: If you use LibreOffice 4, please note that version 4.2 (available in Ubuntu 14.04) has demonstrated to be more successfull at converting documents than version 4.1, which tended to crash when sending a document for conversion.

10. Setting chronological tasks

Since Chamilo 1.8.8, a few tasks need to be executed regularly in order to get the best out of your server resources. One of such tasks (and the only one around at the time of Chamilo 1.8.8) is the sending of internal messaging notifications by e-mail, i.e. when you receive an e-mail from another person or from a group inside the internal messaging system of Chamilo, if all e-mails are sent immediately, then you might not have the chance to receive them at your pace, once a day or even once a week. For cases like this you, as a Chamilo administrator, should setup a cron process on the server to check the queue of e-mails and send is timely.

Setting up a cron task is easy and there are several ways to do it. We recommend you have a look at the Drupal documentation for setting up cron and define your own cron process as:
35 * * * * wget -O - -q -t 1 http://campus.example.com/main/cron/run.php
Make sure you have a look into run.php as maybe you want to change a few settings there.

11. Changing the language's firstname/lastname order

As Chamilo becomes more popular and crosses many borders now, it frequently happens that administrators want to re-order the firstname and lastname fields in tables, and also on which field it is sorted first.

This can easily be modified by editing the app/config/configuration.php file, finding the following section, uncommenting the PHP lines and adapting it to your language:
// Custom name_order_conventions
//$_configuration['name_order_conventions'] = array(
// 'french' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name')
//);

Feel free to change this to
// Custom name_order_conventions
$_configuration['name_order_conventions'] = array(
  'french' => array('format' => 'first_name last_name', 'sort_by' => 'last_name')
);

for example. The effect should be immediate.
Please note that, although Chamilo allows you to define its position, the "title" field does not exist at this time, so no need to worry about it.

12. Improving files download efficiency

File download can be very slow when passing through a PHP script to control permissions. One solution to this is to use the X-Sendfile header, which depends on a module on the webserver. Check http://stackoverflow.com/a/3731639/1406662 for more details on implementing Sendfile. Chamilo LMS 1.9.8 (and following versions) supports the X-Sendfile headers, but requires a specific line of configuration to be added to configuration.php:
$_configuration['enable_x_sendfile_headers'] = true;
If you have issues with files taking a long time to download, make sure you reconfigure your webserver and add this line. You should see an notable difference in download time.

13. Videoconference

Chamilo supports the connection to two different videoconference servers: BigBlueButton (versions 0.81, 0.9 and 1.0) and OpenMeetings.
While BigBlueButton seem easier to install, more clearly documented and more esthetically finished, some users have manifested that OpenMeetings consumes less bandwidth, is less restrictive in terms of running environments and offers more tools and connectors.
The decision is up to you, but in any case you will have to install a videoconference server separately from the normal Chamilo LMS installation process.
You will find the installation guide for BigBlueButton here. Once installed, issue a "bbb-conf --secret" on the command line to get the parameters to indicate in the "Videoconference" plugin in Chamilo (platform settings page).
This should make an additional "Videoconference" tool icon appear in every course.


14. Rewrite

Chamilo LMS 1.10 is the first version to require the web server to allow redirections of requests (and so 1.11 does as well).
For Apache, this is done through enabling the Rewrite module and either allowing overrides (through .htaccess) or adding a specific configuration section to the VirtualHost defined for Apache.
For Nginx, this is done through specific redirection rules in the corresponding virtual host (server clause).

To make sure this isn't too complex for anyone, we recommend a configuration below to help you out in both cases. Please note that using .htaccess is the easiest way but might affect your server load considerably, given .htaccess files are interpreted on *every* request, while a configuration block in your VirtualHost section is compiled at configuration reload time.

Apache + .htaccess

To enable .htaccess on Apache, you just need to check 1 thing: In a <Directory> block of the root folder of Chamilo, ensure the following lines are present:
    <Directory />
        AllowOverride All
		Order allow,deny
		allow from all
    </Directory>
    
or, if you are working with Apache 2.4, that syntax changed a little and looks more like this:
    <Directory />
        AllowOverride All
        Require all granted
    </Directory>
    

Apache RewriteRules

  <LocationMatch "/.git*">
	order deny,allow
	deny from all
  </LocationMatch>

  <Directory ~/.>
    AllowOverride None
	Options -Indexes
  </Directory>

  <Directory "/var/www/chamilo">
	RewriteEngine On
	RewriteCond %{QUERY_STRING} ^id=(.*)$
    RewriteRule ^certificates/$ certificates/index.php?id=%1 [L]
    RewriteRule ^courses/([^/]+)/?$ main/course_home/course_home.php?cDir=$1 [QSA,L]
    RewriteRule ^courses/([^/]+)/index.php$ main/course_home/course_home.php?cDir=$1 [QSA,L]
    RewriteRule ^courses/([^/]+)/scorm/(.*([\.js|\.css|\.png|\.jpg|\.jpeg|\.gif]))$ app/courses/$1/scorm/$2 [QSA,L]
    RewriteRule ^courses/([^/]+)/scorm/(.*)$ main/document/download_scorm.php?doc_url=/$2&cDir=$1 [QSA,L]
    RewriteRule ^courses/([^/]+)/document/certificates/(.*)$ app/courses/$1/document/certificates/$2 [QSA,L]
    RewriteRule ^courses/([^/]+)/document/(.*)$ main/document/download.php?doc_url=/$2&cDir=$1 [QSA,L]
    RewriteRule ^courses/([^/]+)/upload/course_home_icons/(.*([\.js|\.css|\.png|\.jpg|\.jpeg|\.gif]))$ app/courses/$1/upload/course_home_icons/$2 [QSA,L]
    RewriteRule ^courses/([^/]+)/upload/([^/]+)/(.*)$ main/document/download_uploaded_files.php?code=$1&type=$2&file=$3 [QSA,L]
    RewriteRule ^courses/([^/]+)/work/(.*)$ main/work/download.php?file=work/$2&cDir=$1 [QSA,L]
    RewriteRule ^courses/([^/]+)/course-pic85x85.png$ main/inc/ajax/course.ajax.php?a=get_course_image&code=$1&image=course_image_source [QSA,L]
    RewriteRule ^courses/([^/]+)/course-pic.png$ main/inc/ajax/course.ajax.php?a=get_course_image&code=$1&image=course_image_large_source [QSA,L]
    RewriteRule ^courses/([^/]+)/(.*)$ app/courses/$1/$2 [QSA,L]
    RewriteRule ^session/(\d{1,})/about/?$ main/session/about.php?session_id=$1 [L]
    RewriteRule ^course/(\d{1,})/about/?$ main/course_info/about.php?course_id=$1 [L]
    RewriteRule ^badge/(\d{1,}) main/badge/issued.php?issue=$1 [L]
    RewriteRule ^skill/(\d{1,})/user/(\d{1,}) main/badge/issued_all.php?skill=$1&user=$2 [L]
    RewriteRule ^badge/(\d{1,})/user/(\d{1,}) main/badge/issued_all.php?skill=$1&user=$2 [L]
    RewriteRule ^main/exercice/(.*)$ main/exercise/$1 [QSA,L]
    RewriteRule ^main/newscorm/(.*)$ main/lp/$1 [QSA,L]
    RewriteRule ^service/(\d{1,})$ plugin/buycourses/src/service_information.php?service_id=$1 [L]
    RewriteRule ^lti/os$ plugin/ims_lti/outcome_service.php [L]
    RewriteRule ^(tests|.git) - [F,L,NC]
  </Directory>

    AddType application/font-woff .woff .woff2
    <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresByType application/font-woff "access plus 1 month"
    </IfModule>
    

Special note on sharing questions between courses

In Chamilo 1.11.16, we added the possibility (see configuration.php) to share questions between several courses. This feature, although working great for pure-text questions, does however generate an issue when sharing media files between courses, as one media file in one course will not be visible by a user that sees the question in another course and doesn't have access to the question's original course.
To avoid this issue, you can adapt your .htaccess (or the VirtualHost in case you put it there) to allow for media files to be accessed directly (without logging in to the portal). This will also speed up loading these media files, but it introduces a reduction in the level of security, as those specific media files are accessible by anyone having access to the portal itself and knowing the path of the files.

To apply the patch, locate this line in your .htaccess:

    RewriteRule ^courses/([^/]+)/document/(.*)$ main/document/download.php?doc_url=/$2&cDir=$1 [QSA,L]
and remove it or comment it out, then put those two lines instead:

    RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|webp|ico|icon|swf|avi|mp3|ogg|wav|ttf|otf|eot|woff|webm|mp4)
    RewriteRule ^courses/([^/]+)/document/(.*)$ main/document/download.php?doc_url=/$2&cDir=$1 [QSA|L]

Nginx

Nginx doesn't support .htaccess rules, so you have no other option than to apply the following rules (note that your PHP backend configuration may vary). These are only the redirection rules to be placed inside a server{} block, as other settings might differ from one installation to another.
  # Add your own "server {" header here with listen, server_name, access_log, error_log, index, root and error_page params

  charset utf-8;

  location @rewrite{
    rewrite ^certificates/$ certificates/index.php last;
    rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/scorm/(.*([\.js|\.css|\.png|\.jpg|\.jpeg|\.gif]))$ app/courses/$1/scorm/$2 last;
    rewrite ^/courses/([^/]+)/scorm/(.*)$ /main/document/download_scorm.php?doc_url=/$2&cDir=$1 last;
    # Alternatively, you can choose to give direct access to all SCORM files, which is much faster but less secure
    # rewrite "^/courses/([^/]+)/scorm/(.*)$" /app/courses/$1/scorm/$2 break;

    rewrite "^/courses/([^/]+)/document/certificates/(.*)$" /app/courses/$1/document/certificates/$2 last;
    rewrite ^/courses/([^/]+)/document/(.*)$ /main/document/download.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/upload/([^/]+)/(.*)$ /main/document/download_uploaded_files.php?code=$1&type=$2&file=$3 last;
    rewrite ^/courses/([^/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/upload/course_home_icons/(.*([\.png|\.jpg|\.jpeg|\.gif]))$ app/courses/$1/upload/course_home_icons/$2 last;
    rewrite ^/courses/([^/]+)/(.*)$ /app/courses/$1/$2 last;
    rewrite ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last;
    rewrite ^/course/([^/]+)/about/?$ /main/course_info/about.php?course_id=$1 last;
    rewrite ^/badge/(\d+) /main/badge/issued.php?issue=$1 last;
    rewrite ^/skill/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    rewrite ^/badge/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    rewrite ^/main/exercice/(.*)$ /main/exercise/$1 last;
    rewrite ^/main/newscorm/(.*)$ /main/lp/$1 last;
    rewrite ^/service/(\d+)$ /plugin/buycourses/src/service_information.php?service_id=$1 last;
    rewrite "^/main/upload/users/(.*)/(.*)/my_files/(.*)$" /app/upload/users/$1/$2/my_files/$3 last;

    try_files $uri /index.php$is_args$args;
    break;
  }

  location / {
    try_files $uri @rewrite;
  }

  location /main {
    rewrite ^/main/([^/]+)/?$ /main/$1/index.php last;
  }

  location ~ \.php$ {
    client_max_body_size 20M;
    try_files $uri @rewrite;

    fastcgi_pass unix:/var/run/php7.4-fpm.sock;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTPS off;
  }

  # Serve static files directly
  location ~* \.(png|jpe?g|gif|ico|js|css|mp3|swf|flv|mp4|ogg|woff|woff2)$ {
    rewrite ^/courses/([^/]+)/course-pic85x85.png$ /app/courses/$1/course-pic85x85.png last;
    rewrite ^/courses/([^/]+)/course-pic.png$ /app/courses/$1/course-pic.png last;
    rewrite ^/courses/([^/]+)/scorm/(.*)$ /main/document/download_scorm.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/document/(.*)$ /main/document/download.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/upload/(.*)$ /app/courses/$1/upload/$2 last;
    # For all these media resources not treated by previous rewrites, give direct access (no permission check)
    rewrite ^/courses/(.*)$ /app/courses/$1 break;
    expires 30d;
    access_log off;
    try_files $uri @rewrite;
  }

  location ~ ~\.(ht|git){
    deny all;
  }
  location ^~ /tests/ {
    deny all;
  }
    

Apple on OS X servers

Scott Steven reports that Apache on OS X requires specific actions
Alternatively, you can find the settings file for your domain in Apple's settings folder under /Library/Server/Web/Settings to update it manually.
You cannot, however, only allow .htaccess files in the main httpd.conf file, as OS X will override it with the domain-specific configuration file.

IIS

Users @ullfindsmit and @rozepeda on Github were kind enough to contribute to this IIS configuration after testing it based on our configurations above. This has not been tested by the Chamilo team, but the rules look legit:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpRedirect enabled="false" destination="" httpResponseStatus="Permanent" />
        <rewrite>
            <rules>
                <rule name="rule 1v" stopProcessing="true">
                    <match url="^certificates/$" />
                    <action type="Rewrite" url="certificates/index.php?id=%1" appendQueryString="false" />
                </rule>
                <rule name="rule 2v" enabled="true" stopProcessing="true">
                    <match url="^courses/([^/]+)/?$" />
                    <action type="Rewrite" url="main/course_home/course_home.php?cDir={R:1}" appendQueryString="true" />
                </rule>
                <rule name="rule 3v" enabled="true" stopProcessing="true">
                    <match url="^courses/([^/]+)/index.php$" />
                    <action type="Rewrite" url="main/course_home/course_home.php?cDir={R:1}" />
                </rule>
                <rule name="rule 4v" stopProcessing="true">
                    <match url="^courses/([^/]+)/scorm/(.*([\.js|\.css|\.png|\.jpg|\.jpeg|\.gif]))$" />
                    <action type="Rewrite" url="app/courses/{R:1}/scorm/{R:2}" />
                </rule>
                <rule name="rule 5v" stopProcessing="true">
                    <match url="^courses/([^/]+)/scorm/(.*)$" />
                    <action type="Rewrite" url="main/document/download_scorm.php?doc_url=/{R:2}&cDir={R:1}" />
                </rule>
                <rule name="rule v6" stopProcessing="true">
                    <match url="^courses/([^/]+)/document/certificates/(.*)$" />
                    <action type="Rewrite" url="app/courses/{R:1}/document/certificates/{R:2}" />
                </rule>
                <rule name="rule v7" stopProcessing="true">
                    <match url="^courses/([^/]+)/document/(.*)$" />
                    <action type="Rewrite" url="main/document/download.php?doc_url=/{R:2}&cDir={R:1}" />
                </rule>
                <rule name="rule v8" stopProcessing="true">
                    <match url="^courses/([^/]+)/upload/course_home_icons/(.*([\.js|\.css|\.png|\.jpg|\.jpeg|\.gif]))$" />
                    <action type="Rewrite" url="app/courses/{R:1}/upload/course_home_icons/{R:2}" />
                </rule>
                <rule name="rule v9" stopProcessing="true">
                    <match url="^courses/([^/]+)/upload/([^/]+)/(.*)$" />
                    <action type="Rewrite" url="main/document/download_uploaded_files.php?code={R:1}&type={R:2}&file={R:3}" />
                </rule>
                <rule name="rule v10" stopProcessing="true">
                    <match url="^courses/([^/]+)/work/(.*)$" />
                    <action type="Rewrite" url="main/work/download.php?file=work/{R:2}&cDir={R:1}" />
                </rule>
                <rule name="rule v11" stopProcessing="true">
                    <match url="^courses/([^/]+)/course-pic85x85.png$" />
                    <action type="Rewrite" url="main/inc/ajax/course.ajax.php?a=get_course_image&code={R:1}&image=course_image_source" appendQueryString="true" />
                </rule>
                <rule name="rule v12" stopProcessing="true">
                    <match url="^courses/([^/]+)/course-pic.png$" />
                    <action type="Rewrite" url="main/inc/ajax/course.ajax.php?a=get_course_image&code={R:1}&image=course_image_large_source" appendQueryString="true" />
                </rule>
                <rule name="rule v13" stopProcessing="true">
                    <match url="^courses/([^/]+)/(.*)$" />
                    <action type="Rewrite" url="app/courses/{R:1}/{R:2}" appendQueryString="false" />
                </rule>
                <rule name="rule v14" stopProcessing="true">
                    <match url="^session/(\d{1,})/about/?$" />
                    <action type="Rewrite" url="main/session/about.php?session_id={R:1}" appendQueryString="false" />
                </rule>
                <rule name="rule v15" stopProcessing="true">
                    <match url="^course/(\d{1,})/about/?$" />
                    <action type="Rewrite" url="main/course_info/about.php?course_id={R:1}" appendQueryString="false" />
                </rule>
                <rule name="rule v16" stopProcessing="true">
                    <match url="^badge/(\d{1,})" />
                    <action type="Rewrite" url="main/badge/issued.php?issue={R:1}" appendQueryString="false" />
                </rule>
                <rule name="rule v17" stopProcessing="true">
                    <match url="^skill/(\d{1,})/user/(\d{1,})" />
                    <action type="Rewrite" url="main/badge/issued_all.php?skill={R:1}&user={R:2}" appendQueryString="false" />
                </rule>
                <rule name="rule v18" stopProcessing="true">
                    <match url="^badge/(\d{1,})/user/(\d{1,})" />
                    <action type="Rewrite" url="main/badge/issued_all.php?skill={R:1}&user={R:2}" appendQueryString="false" />
                </rule>
                <rule name="rule v19" stopProcessing="true">
                    <match url="^main/exercice/(.*)$" />
                    <action type="Rewrite" url="main/exercise/{R:1}" appendQueryString="true" />
                </rule>
                <rule name="rule v20" stopProcessing="true">
                    <match url="^main/newscorm/(.*)$" />
                    <action type="Rewrite" url="main/lp/{R:1}" appendQueryString="true" />
                </rule>
                <rule name="rule v21" stopProcessing="true">
                    <match url="^service/(\d{1,})$" />
                    <action type="Rewrite" url="plugin/buycourses/src/service_information.php?service_id={R:1}" appendQueryString="false" />
                </rule>
                <rule name="rule v22" stopProcessing="true">
                    <match url="^lti/os$" />
                    <action type="Rewrite" url="plugin/ims_lti/outcome_service.php" appendQueryString="false" />
                </rule>
                <rule name="rule v23" stopProcessing="true">
                    <match url="^(tests|.git)" ignoreCase="false" />
                    <action type="Rewrite" url="/-" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
        

15. Upgrading from Git

If you have sufficient experience with Git and have installed your initial Chamilo portal from the Git version, you might want to upgrade from 1.9.x to 1.11.x using Git directly.
Here are a few tips that might help you:



Contact address
Mail: info@chamilo.org



Valid XHTML 1.0 Transitional Valid CSS