- Notifications
You must be signed in to change notification settings - Fork519
Chamilo is a learning management system focused on ease of use and accessibility
License
GPL-3.0, Unknown licenses found
Licenses found
chamilo/chamilo-lms
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Chamilo is an e-learning platform, also called "LMS", published under the GNU/GPLv3+ license. It has been used by more than 30M people worldwide since its inception in 2010. This is a development version. For the current stable branch, please select the 1.11.x branch in the Code tab.
Chamilo 2.0 is still in development. The installation procedure below is for reference only. For a stable Chamilo, please install Chamilo 1.11.x. See the 1.11.x branch's README.md for details.
You will need (short version):
- 2 vCPUs
- 4GB RAM
- 4GB free disk space
Chamilo 2.0 has been tested on a 2 vCPUs, 2GB RAM virtual machine under Ubuntu 24.04 and has been shown to work, but tobuild the development environment, you will need at least 4GB RAM.At this stage, we haven't made any load testing to evaluate the number of users that could use the system simultaneously.Remember this is an alpha version. As such, it will run in "dev" mode (see the.env
file), considerably more slowly the "prod" mode.
Any recent computer with a recent (no older than 5y) browser should do.
You should have:
- Some Linux distribution (tests on Windows server have been very limited, with mitigated success)
- Composer 2.x -https://getcomposer.org/download/
- Yarn 4.x+ -https://yarnpkg.com/getting-started/install
- NodeJS >= v18+ (lts) -https://github.com/nodesource/distributions/blob/master/README.md
- A web server with a virtualhost in a domain or subdomain (not in a sub folder inside a domain with another application).
- A working LAMP/WAMP server with PHP 8.2 or 8.3
- A Redis server (for storing PHP sessions)
These are local testing instructions for a fictitious domain name "my.chamilo.net" configured in your hosts file andpointing at a local machine's IP address. These instructions do NOT provide a secure environment.
Spawn an Ubuntu Server 24.04 LTS Virtual Machine. Login as root (orsudo -s
once connected) through SSH.Install the software stack and Chamilo using the commands below.
apt update && apt -y upgradeapt install -y apache2 libapache2-mod-php mariadb-client mariadb-server redis php-pear php-{apcu,bcmath,cli,curl,dev,gd,intl,ldap,mbstring,mysql,redis,soap,xml,zip} git unzip curl certbotmysql -e "GRANT ALL PRIVILEGES ON chamilo2.* TO chamilo2@localhost IDENTIFIED BY 'chamilo2';"cd /var/www && wget https://github.com/chamilo/chamilo-lms/releases/download/v2.0.0-alpha.2/chamilo-2.0.0-alpha.2.tar.gztar zxf chamilo-2.0.0-alpha.2.tar.gzmv chamilo-2.0.0-alpha.2 chamilocd chamilocp public/main/install/apache.dist.conf /etc/apache2/sites-available/my.chamilo.net.confa2ensite my.chamilo.neta2enmod rewrite ssl headers expiressystemctl restart apache2# Open http://my.chamilo.net in your browser to go through the installation wizard# Complete the installation information using DB credentials chamilo2/chamilo2/chamilo2 and the default host and port# Done
By default, it is installed in "dev" mode to have more debugging features at hand. If you want to change it to "prod"mode, you will have to install yarn (see below), runyarn encore prod
and modify the.env
file at the root ofyour chamilo folder to changeAPP_ENV
to'prod'
instead of the default'dev'
. See other installation methods below.
Note: PHP's LDAP extension is only required if you need to connect to LDAP or a compatible system, or if you want to install Chamilo from sources (see below).
You will need PHP8.2 or 8.3 and NodeJS v18+ to run Chamilo 2.
On Ubuntu 24.04+, the following should take care of all dependencies (certbot is optional).
Replace 'chamilo2' by the database name and user you want, and '{password}' by a more secure password.
sudo apt update && apt -y upgradesudo apt install apache2 libapache2-mod-php mariadb-client mariadb-server redis php-pear php-{apcu,bcmath,cli,curl,dev,gd,intl,ldap,mbstring,mysql,redis,soap,xml,zip} git unzip curl certbotsudo mysqlmysql> GRANT ALL PRIVILEGES ON chamilo2.* TO chamilo2@localhost IDENTIFIED BY '{password}';mysql> exitcd ~curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -sudo apt-get install -y nodejssudo corepack enablecd ~php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"php composer-setup.phpphp -r "unlink('composer-setup.php');"sudo mv composer.phar /usr/local/bin/composercd /var/wwwgit clone -b master --depth=1 https://github.com/chamilo/chamilo-lms.git chamilocd chamilocomposer installsudo a2enmod rewrite ssl headers expiressudo cp public/main/install/apache.dist.conf /etc/apache2/sites-available/my.chamilo.net.conf# edit if you want to change the local domain namesudo a2ensite my.chamilo.netsudo systemctl restart apache2yarn set version stableyarn up && yarn install && yarn devsudo touch .envsudo chown -R www-data: var/ .env config/# load http://my.chamilo.net in your browser and follow the installation wizardsudo chown -R root: .env config/
The following is the section above, but with more details and hedge cases.
sudo apt updatesudo apt -y upgradesudo apt install apache2 libapache2-mod-php mariadb-client mariadb-server redis php-pear php-{apcu,bcmath,cli,curl,dev,gd,intl,ldap,mbstring,mysql,redis,soap,xml,zip} git unzip curl certbotsudo mysqlmysql> GRANT ALL PRIVILEGES ON chamilo2.* TO chamilo2@localhost IDENTIFIED BY '{password}';mysql> exit
On older Ubuntu versions (like 22.04), you have to install PHP through third-party sources:
sudo apt updatesudo apt -y upgradesudo apt -y install ca-certificates curl gnupg software-properties-commonsudo add-apt-repository ppa:ondrej/phpsudo apt updatesudo apt install apache2 libapache2-mod-php8.3 mariadb-client mariadb-server redis php-pear php8.3-{apcu,bcmath,cli,curl,dev,gd,intl,ldap,mbstring,mysql,redis,soap,xml,zip} git unzip curlsudo mysqlmysql> GRANT ALL PRIVILEGES ON chamilo2.* TO chamilo2@localhost IDENTIFIED BY '{password}';mysql> exit
(replace 'chamilo2' by the database name and user you want, and '{password}' by a more secure password)
If you already have nodejs installed, check the version withnode -v
Otherwise, install Node.js 18 or above.
Use the following lines to get a static version of Node.js 20 fromhttps://deb.nodesource.com/ (recommended)
cd ~curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -sudo apt-get install -y nodejs
Alternative (not recommended): install Node.js by using NVM (Node Version Manager). You can install it following theinstructionshere.You can install the desired node version (preferably, the LTS version):
sudo nvm install --ltssudo nvm use --lts
Once NodeJS is installed, you must enablecorepack
and then continue with the requirements
sudo corepack enablecd ~
Follow the instructions athttps://getcomposer.org/download/ to get Composer, then add it to the local binariesfor easier use:
sudo mv composer.phar /usr/local/bin/composer
Apache's rewrite module is mandatory if you use Apache. The rest is optional and depends on your needs.
sudo apt install libapache2-mod-xsendfile #only for optimization if used in the vhost configsudo a2enmod rewrite ssl headers expiressudo systemctl restart apache2
When your system is all set, you can use the following:
cd /var/wwwgit clone -b master --depth=1 https://github.com/chamilo/chamilo-lms.git chamilocd chamilocomposer install
We do not recommend running composer as the root user!When asked whether you want to execute the recipes or install plugins for some of the components,you can safely type 'n' (for 'no').
yarn set version stable# delete yarn.lock if present, as it might contain restrictive packages from a different contextyarn up && yarn install && yarn dev# you can safely ignore any "warning" mentioned by yarn devsudo touch .envsudo chown -R www-data: var/ .env config/
In your web server configuration, ensure you allow for the interpretation of .htaccess (AllowOverride all
orRequire all granted
), and point theDocumentRoot
to thepublic/
subdirectory.Finally, make sure your PHP config points at Redis for sessions management.This should look similar to the short excerpt below (in your Apache vhost block) if you use SSL.If you do not use SSL, you can remove the first block and change*:443
by*:80
for the second block.
<VirtualHost *:80> ServerName my.chamilo.net RewriteEngine On RedirectMatch 302 (.*) https://my.chamilo.net$1</VirtualHost><VirtualHost *:443> DocumentRoot /var/www/chamilo/public/ ServerName my.chamilo.net # Error logging rules... # SSL rules... RewriteEngine On <Directory /var/www/chamilo/public> AllowOverride All Require all granted </Directory> <LocationMatch "/.git"> Require all denied </LocationMatch> php_value session.cookie_httponly 1 php_admin_value session.save_handler "redis" php_admin_value session.save_path "tcp://127.0.0.1:6379" php_admin_value upload_max_filesize 256M php_admin_value post_max_size 256M</VirtualHost>
Don't forget to reload your Apache configuration after each change:
sudo systemctl reload apache2
Once the above is ready, use your browser to load the URL you have defined for your host, e.g.https://my.chamilo.net(this should redirect you tomain/install/index.php
) and follow the UI instructions (database, admin user settings, etc).
After the web install process, change the permissions back to a reasonably safe state:
chown -R root: .env config/
If you have already installed it and just want to update it from Git, do:
git pull origin mastercomposer install# php bin/console doctrine:schema:update --force --complete (only recommended if you installed before beta 1)php bin/console cache:clearyarn install && yarn dev
The commands above will update the JS (yarn) in public/build/ and PHP (composer) dependencies in vendor/.
Note for developers in alpha stage: the doctrine command will try to updateyour database schema to the expected database schema in a fresh installation.
This is not always perfect, as Doctrine will take the fastest route to do this.
For example, if you have a migration to rename a table (which would apply justfine to a system in Chamilo 1 beingmigrated), Doctrine might consider thatthe destination table does not exist and the original (which should not bethere in a new installation) is still there, so it will just drop the oldtable and create a new one, losing all records in that table in the process.
To avoid this, prefer executing migrations with the following instead.
php bin/console doctrine:migrations:execute "Chamilo\CoreBundle\Migrations\Schema\V200\Version[date]"
This will respect the migration logic and do the required data processing.You can see the version numbers in the list of updated or created files when launchinggit pull
.
Som`e updates might (rarely) cause conflicts with existing files so, to avoid those, here are some hints :
- for composer errors, you can remove the vendor folder and composer.lock file, then launch
composer update
- for yarn errors, you can remove yarn.lock .yarn/cache/* node_modules/* and launch
yarn up
- when opening Chamilo, if the page does not load, then you might want to delete var/cache/* or launch
php bin/console cache:clear
from the root of Chamilo
In case you believe some settings in Chamilo might not have been processedcorrectly based on an incomplete migration or a migration that was addedafter you installed your development version of Chamilo, the/admin/settings_sync URL is built to try and fix that automatically by updatingPHP classes based on the database state. This issue rarely happens, though.
If you have it installed in a dev environment and feel like you should clean itup completely (might be necessary after changes to the database), you can do soby:
- Removing the
.env
file - Loading the {url}/main/install/index.php page again
The database should be automatically destroyed, table by table. In some extremecases (a previous version created a table that is not necessary anymore andcreates issues), you might want to clean it completely by just dropping thedatabase, but this shouldn't be necessary most of the time.
If, for some reason, you have issues with either composer or yarn, a good firststep is to delete completely thevendor/
folder (for composer) or thenode_modules/
folder (for yarn).
If you are a developer and want to contribute to Chamilo in the currentdevelopment branch (not stable yet), then please follow the instructions below.Please bear in mind that the development version is NOT STABLE at this time,and many features are just not working yet. This is because we are working onroot components that require massive changes to the structure of the code,files and database. As such, to get a working version, you might need tocompletely uninstall and re-install from time to time. You've been warned.
First, apply the procedure described here:Managing CSS and JavaScript in Chamilo (in particular,make sure you follow the given links to install all the necessary componentson your computer).
Then make sure your database supports large prefixes(seethis Stack Overflow threadif you use MySQL < 5.7 or MariaDB < 10.2.2).
Load the (your-domain)/main/install/index.php URL to start the installer (whichis very similar to the installer in previous versions).
If the installer is pure-HTML and doesn't appear with a clean layout, that'sprobably because you didn't follow these instructions carefully.Go back to the beginning of this section and try again.
If you want hot reloading for assets use the commandyarn run encore dev-server
.This will refresh automatically your assets when you modify them underassets/vue
. Access your chamilo instance as usual. In the background, thiswill serve assets from a custom server onhttp://localhost:8080. Do not accessthis url directly sinceEncoreis in charge of changing url assets as needed.
You might want to support PHP 8.3 (for Chamilo 2) and PHP 7.4 (for all otherthings) on the same server simultaneously. On Ubuntu, you could do it this way:
sudo add-apt-repository ppa:ondrej/phpsudo apt updatesudo apt install php8.3 libapache2-mod-php7.4 php8.3-{modules} php7.4-{modules}sudo apt remove libapache2-mod-php8.3 php7.4-fpmsudo a2enmod proxy_fcgisudo vim /etc/apache2/sites-available/[your-chamilo2-vhost].conf
In the vhost configuration, make sure you set PHP 8.3 FPM to answer this singlevhost by adding, somewhere between your<VirtualHost>
tags, the following:
<IfModule !mod_php8.c> <IfModule proxy_fcgi_module> <IfModule setenvif_module> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 </IfModule> <FilesMatch ".+\.ph(ar|p|tml)$"> SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://localhost" </FilesMatch> <FilesMatch ".+\.phps$"> Require all denied </FilesMatch> <FilesMatch "^\.ph(ar|p|ps|tml)$"> Require all denied </FilesMatch> </IfModule> </IfModule>
Then exit and restart Apache:
sudo systemctl restart apache2
Finally, remember that PHP settings will have to be changed in/etc/php/8.3/fpm/php.ini
and you will have to reloadphp8.3-fpm
to takethose config changes into account.
sudo systemctl reload php8.3-fpm
When using 2 versions, you will also have issues when callingcomposer update
, as this one needs to be called by the relevant PHP version.This can be done like so:
/usr/bin/php8.3 /usr/local/bin/composer updateor, for Chamilo 1.11/usr/bin/php7.4 /usr/local/bin/composer update
If your default php-cli uses PHP7.4 (seeln -s /etc/alternatives/php
),you might have issues running with a so-calledplatform_check.php
scriptwhen runningcomposer update
anyway. This is because this script doesn'tuser the proper launch context, and you might need to change your defaultsettings on Ubuntu (i.e. change the link /etc/alternatives/php to point tothe other php version) before launchingcomposer update
. You can alwaysrevert that operation later on if you need to go back to work on Chamilo 1.11and Composer complains again.
To use the git hook sample scripts undertests/scripts/git-hooks/
, thefollowing commands can be used.
git config core.hooksPath tests/scripts/git-hooks/
This is a list of structural changes to help developers/maintainers of Chamilo 1.11 find their way in Chamilo 2. It isnot a features list (refer topublic/documentation/changelog.html
for that).
- in general, the
main/
folder has been moved topublic/main/
- a big part of the frontend has been migrated to VueJS + Tailwind CSS (see
assets/vue/
) app/Resources/public/assets/
moved toassets/
main/inc/lib/javascript/
moved toassets/js/
main/img/
moved topublic/img/
main/template/default/
moved tosrc/CoreBundle/Resources/views/
src/Chamilo/XXXBundle/
moved tosrc/CoreBundle/
orsrc/CourseBundle/
bin/doctrine.php
removed, usebin/console doctrine:xyz
options- plugin images, CSS and JS libs are loaded inside the
public/plugin/
folder and the folder names have been renamed to CamelCase - plugins templates use the
asset()
function instead of using_p.web_plugin
main/inc/local.inc.php
has been removed andmain/inc/global.inc.php
greatly reduced- translations are managed through Gettext, from the
translations/
directory for PHP code and fromassets/locales/
for VueJS code - files in
app/config/
have been restructured (to.yaml
) and moved toconfig/
app/config/configuration.php
has essentially been emptied to thesettings
table (accessible via the admin page in Chamilo), while the critical settings (database access etc) have been transferred to.env
Libraries
- Integration with Symfony 6
- PHPMailer replaced with Symfony Mailer
- Bower replaced byyarn
This version of Chamilo allows you to use a JWT (token) to use the Chamilo APImore securely. In order to use it, you will have to generate a JWT token asfollows.
- Run
php bin/console lexik:jwt:generate-keypair
- In Apache setup Bearer with:
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
- Get the token:The response should return something like:
curl -k -X POST https://example.com/api/authentication_token \ -H"Content-Type: application/json" \ -d'{"username":"admin","password":"admin"}'
{"token":"MyTokenABC"}
- Go tohttps://example.com/api
- Click in "Authorize" button and write the value
Bearer MyTokenABC
Then you can make queries using the JWT token.
Seehttps://github.com/chamilo/chamilo-lms/projects/3
If you want to submit new features or patches to Chamilo 2, please follow theGithub contribution guidehttps://guides.github.com/activities/contributing-to-open-source/and ourCONTRIBUTING.md file.
In short, we ask you to send us Pull Requests based on a branch that you createwith this purpose into your own repository, forked from the original Chamilo repository (master
branch).
For more information on Chamilo 2, visithttps://2.chamilo.org/documentation/index.html
About
Chamilo is a learning management system focused on ease of use and accessibility
Topics
Resources
License
GPL-3.0, Unknown licenses found
Licenses found
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.