Skip to content

Commit dbc94d9

Browse files
committed
Documentation: Update README and add example Apache vhost config file to speed up installation process
1 parent 3f6d29d commit dbc94d9

File tree

2 files changed

+143
-56
lines changed

2 files changed

+143
-56
lines changed

README.md

Lines changed: 123 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,41 @@ Chamilo is an e-learning platform, also called "LMS", published under the GNU/GP
1515

1616
## Quick install
1717

18-
**Chamilo 2.0 is still in development. This 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.**
18+
**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.**
1919

20-
### Minimum server hardware requirements
20+
### Minimum hardware requirements
2121

22-
Chamilo 2.0 has been tested on a 2 vCPUs, 2GB RAM virtual machine under Ubuntu 24.04 and has been shown to work.
22+
#### Server
23+
24+
You will need (short version):
25+
- 2 vCPUs
26+
- 4GB RAM
27+
- 4GB free disk space
28+
29+
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 to
30+
build the development environment, you will need at least 4GB RAM.
2331
At this stage, we haven't made any load testing to evaluate the number of users that could use the system simultaneously.
2432
Remember this is an alpha version. As such, it will run in "dev" mode (see the `.env` file), considerably more slowly the "prod" mode.
2533

34+
#### Client
35+
36+
Any recent computer with a recent (no older than 5y) browser should do.
37+
2638
### Software stack requirements
2739

28-
We assume you already have:
40+
You should have:
2941

30-
- composer 2.x - https://getcomposer.org/download/
31-
- yarn 4.x+ - https://yarnpkg.com/getting-started/install
32-
- Node >= v18+ (lts) - https://github.com/nodesource/distributions/blob/master/README.md
33-
- Configuring a virtualhost in a domain, not in a sub folder inside a domain.
34-
- A working LAMP/WAMP server with PHP 8.3+
42+
- Some Linux distribution (tests on Windows server have been very limited, with mitigated success)
43+
- Composer 2.x - https://getcomposer.org/download/
44+
- Yarn 4.x+ - https://yarnpkg.com/getting-started/install
45+
- NodeJS >= v18+ (lts) - https://github.com/nodesource/distributions/blob/master/README.md
46+
- A web server with a virtualhost in a domain or subdomain (not in a sub folder inside a domain with another application).
47+
- A working LAMP/WAMP server with PHP 8.2 or 8.3
48+
- A Redis server (for storing PHP sessions)
3549

3650
### Software stack install (Ubuntu)
3751

38-
#### The easy way
52+
#### Installing from a packaged version
3953

4054
These are local testing instructions for a fictitious domain name "my.chamilo.net" configured in your hosts file and
4155
pointing at a local machine's IP address. These instructions do NOT provide a secure environment.
@@ -70,30 +84,67 @@ vim /etc/apache2/sites-available/my.chamilo.net.conf
7084
a2ensite my.chamilo.net
7185
a2enmod rewrite ssl headers expires
7286
systemctl restart apache2
73-
# Open http://my.chamilo.net in your browser
87+
# Open http://my.chamilo.net in your browser to go through the installation wizard
7488
# Complete the installation information using DB credentials chamilo2/chamilo2/chamilo2 and the default host and port
7589
# Done
7690
~~~~
7791

7892
By default, it is installed in "dev" mode to have more debugging features at hand. If you want to change it to "prod"
79-
mode, you will have to install yarn, run `yarn encore prod` and modify `/.env` to change `APP_ENV` to `'prod'`. See
80-
other installation methods below.
93+
mode, you will have to install yarn (see below), run `yarn encore prod` and modify the `.env` file at the root of
94+
your chamilo folder to change `APP_ENV` to `'prod'` instead of the default `'dev'`. See other installation methods below.
95+
96+
#### Installing from sources
8197

82-
#### The more detailed way
98+
##### Quick step-by-step
8399

84-
You will need PHP8.3+ and NodeJS v18+ to run Chamilo 2.
100+
You will need PHP8.2 or 8.3 and NodeJS v18+ to run Chamilo 2.
85101

86102
On Ubuntu 24.04+, the following should take care of all dependencies (certbot is optional).
87103

104+
Replace 'chamilo2' by the database name and user you want, and '{password}' by a more secure password.
105+
~~~~
106+
sudo apt update && apt -y upgrade
107+
sudo apt install apache2 libapache2-mod-php mariadb-client mariadb-server redis php-pear php-{apcu,bcmath,cli,curl,dev,gd,intl,mbstring,mysql,redis,soap,xml,zip} git unzip curl certbot
108+
sudo mysql
109+
mysql> GRANT ALL PRIVILEGES ON chamilo2.* TO chamilo2@localhost IDENTIFIED BY '{password}';
110+
mysql> exit
111+
cd ~
112+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
113+
sudo apt-get install -y nodejs
114+
sudo corepack enable
115+
cd ~
116+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
117+
php composer-setup.php
118+
php -r "unlink('composer-setup.php');"
119+
sudo mv composer.phar /usr/local/bin/composer
120+
cd /var/www
121+
git clone -b master --depth=1 https://github.com/chamilo/chamilo-lms.git chamilo
122+
cd chamilo
123+
composer install
124+
sudo a2enmod rewrite ssl headers expires
125+
sudo cp public/main/install/apache.dist.conf /etc/apache2/sites-available/my.chamilo.net.conf
126+
# edit if you want to change the local domain name
127+
sudo a2ensite my.chamilo.net
128+
sudo systemctl restart apache2
129+
yarn set version stable
130+
yarn up && yarn install && yarn dev
131+
sudo touch .env
132+
sudo chown -R www-data: var/ .env config/
133+
# load http://my.chamilo.net in your browser and follow the installation wizard
134+
sudo chown -R root: .env config/
135+
~~~~
136+
137+
##### Detailed procedure
138+
139+
The following is the section above, but with more details and hedge cases.
88140
~~~~
89141
sudo apt update
90142
sudo apt -y upgrade
91143
sudo apt install apache2 libapache2-mod-php mariadb-client mariadb-server redis php-pear php-{apcu,bcmath,cli,curl,dev,gd,intl,mbstring,mysql,redis,soap,xml,zip} git unzip curl certbot
92144
sudo mysql
93-
mysql> GRANT ALL PRIVILEGES ON chamilo.* TO chamilo@localhost IDENTIFIED BY '{password}';
145+
mysql> GRANT ALL PRIVILEGES ON chamilo2.* TO chamilo2@localhost IDENTIFIED BY '{password}';
94146
mysql> exit
95147
~~~~
96-
(replace 'chamilo' by the database name and user you want, and '{password}' by a more secure password)
97148

98149
On older Ubuntu versions (like 22.04), you have to install PHP through third-party sources:
99150

@@ -104,42 +155,47 @@ sudo apt -y install ca-certificates curl gnupg software-properties-common
104155
sudo add-apt-repository ppa:ondrej/php
105156
sudo apt update
106157
sudo apt install apache2 libapache2-mod-php8.3 mariadb-client mariadb-server redis php-pear php8.3-{apcu,bcmath,cli,curl,dev,gd,intl,mbstring,mysql,redis,soap,xml,zip} git unzip curl
158+
sudo mysql
159+
mysql> GRANT ALL PRIVILEGES ON chamilo2.* TO chamilo2@localhost IDENTIFIED BY '{password}';
160+
mysql> exit
107161
~~~~
108-
(replace 'chamilo' by the database name and user you want, and '{password}' by a more secure password)
162+
(replace 'chamilo2' by the database name and user you want, and '{password}' by a more secure password)
109163

110164
#### NodeJS, Yarn, Composer
111165

112166
If you already have nodejs installed, check the version with `node -v`
113167
Otherwise, install Node.js 18 or above.
114168

115-
The following lines use a static version of Node.js 20 from https://deb.nodesource.com/
169+
Use the following lines to get a static version of Node.js 20 from https://deb.nodesource.com/ (recommended)
116170
~~~~
117171
cd ~
118172
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
119173
sudo apt-get install -y nodejs
120174
~~~~
121175

122-
Another option to install Node.js is by using NVM (Node Version Manager). You can install it following the instructions [here](https://github.com/nvm-sh/nvm#installing-and-updating).
176+
Alternative (not recommended): install Node.js by using NVM (Node Version Manager). You can install it following the
177+
instructions [here](https://github.com/nvm-sh/nvm#installing-and-updating).
123178
You can install the desired node version (preferably, the LTS version):
124179
~~~~
125180
sudo nvm install --lts
126181
sudo nvm use --lts
127182
~~~~
128183

129-
With NodeJS installed, you must enable corepack and then continue with the requirements
184+
Once NodeJS is installed, you must enable `corepack` and then continue with the requirements
130185
~~~~
131186
sudo corepack enable
132187
cd ~
133188
~~~~
134189

135-
Follow the instructions at https://getcomposer.org/download/ to get Composer, then add to the local binaries for easier use:
190+
Follow the instructions at https://getcomposer.org/download/ to get Composer, then add it to the local binaries
191+
for easier use:
136192
~~~~
137193
sudo mv composer.phar /usr/local/bin/composer
138194
~~~~
139195

140196
#### Apache tweaks
141197

142-
Apache's rewrite module is mandatory. The rest is optional and depends on your needs.
198+
Apache's rewrite module is mandatory if you use Apache. The rest is optional and depends on your needs.
143199
~~~~
144200
sudo apt install libapache2-mod-xsendfile #only for optimization if used in the vhost config
145201
sudo a2enmod rewrite ssl headers expires
@@ -149,13 +205,14 @@ sudo systemctl restart apache2
149205
When your system is all set, you can use the following:
150206
~~~~
151207
cd /var/www
152-
git clone https://github.com/chamilo/chamilo-lms.git chamilo
208+
git clone -b master --depth=1 https://github.com/chamilo/chamilo-lms.git chamilo
153209
cd chamilo
154210
composer install
155211
~~~~
156212

157213
We do not recommend running composer as the root user!
158-
When asked whether you want to execute the recipes or install plugins for some of the components, you can safely type 'n' (for 'no').
214+
When asked whether you want to execute the recipes or install plugins for some of the components,
215+
you can safely type 'n' (for 'no').
159216

160217
~~~~
161218
yarn set version stable
@@ -166,9 +223,11 @@ sudo touch .env
166223
sudo chown -R www-data: var/ .env config/
167224
~~~~
168225

169-
In your web server configuration, ensure you allow for the interpretation of .htaccess (`AllowOverride all` and `Require all granted`), and point the `DocumentRoot` to the `public/` subdirectory.
226+
In your web server configuration, ensure you allow for the interpretation of .htaccess (`AllowOverride all` or
227+
`Require all granted`), and point the `DocumentRoot` to the `public/` subdirectory.
170228
Finally, make sure your PHP config points at Redis for sessions management.
171-
This should look similar to this very short excerpt (in your Apache vhost block):
229+
This should look similar to the short excerpt below (in your Apache vhost block) if you use SSL.
230+
If you do not use SSL, you can remove the first block and change `*:443` by `*:80` for the second block.
172231
~~~~
173232
<VirtualHost *:80>
174233
ServerName my.chamilo.net
@@ -202,45 +261,49 @@ sudo systemctl reload apache2
202261

203262
### Web installer
204263

205-
Once the above is ready, use your browser to lo
206-
ad the URL you have defined for your host, e.g. https://my.chamilo.net (this should redirect you to `main/install/index.php`) and follow the UI instructions (database, admin user settings, etc).
264+
Once the above is ready, use your browser to load the URL you have defined for your host, e.g. https://my.chamilo.net
265+
(this should redirect you to `main/install/index.php`) and follow the UI instructions (database, admin user settings, etc).
207266

208267
After the web install process, change the permissions back to a reasonably safe state:
209268
~~~~
210-
chown -R root .env config/
269+
chown -R root: .env config/
211270
~~~~
212271

213-
## Quick update for development/testing purposes
272+
## Quick updates for development/testing purposes
214273

215274
If you have already installed it and just want to update it from Git, do:
216275
~~~~
217-
git pull
276+
git pull origin master
218277
composer install
219-
php bin/console doctrine:schema:update --force --complete
278+
# php bin/console doctrine:schema:update --force --complete (only recommended if you installed before beta 1)
220279
php bin/console cache:clear
221280
yarn install && yarn dev
222281
~~~~
223282

283+
The commands above will update the JS (yarn) in public/build/ and PHP (composer) dependencies in vendor/.
284+
224285
Note for developers in alpha stage: the doctrine command will try to update
225286
your database schema to the expected database schema in a fresh installation.
287+
226288
This is not always perfect, as Doctrine will take the fastest route to do this.
289+
227290
For example, if you have a migration to rename a table (which would apply just
228291
fine to a system in Chamilo 1 being *migrated*), Doctrine might consider that
229292
the destination table does not exist and the original (which should not be
230293
there in a new installation) is still there, so it will just drop the old
231294
table and create a new one, losing all records in that table in the process.
295+
232296
To avoid this, prefer executing migrations with the following instead.
233297
```
234298
php bin/console doctrine:migrations:execute "Chamilo\CoreBundle\Migrations\Schema\V200\Version[date]"
235299
```
236300
This will respect the migration logic and do the required data processing.
301+
You can see the version numbers in the list of updated or created files when launching `git pull`.
237302

238-
The commands above will update the JS (yarn) in public/build/ and PHP (composer) dependencies in vendor/.
239-
240-
Sometimes there are conflicts with existing files so, to avoid those, here are some hints :
241-
- for composer errors, you can remove the vendor folder and composer.lock file
242-
- for yarn errors, you can remove yarn.lock .yarn/cache/* node_modules/*
243-
- when opening Chamilo, if the page does not load, then you might want to delete var/cache/*
303+
Som`e updates might (rarely) cause conflicts with existing files so, to avoid those, here are some hints :
304+
- for composer errors, you can remove the vendor folder and composer.lock file, then launch `composer update`
305+
- for yarn errors, you can remove yarn.lock .yarn/cache/* node_modules/* and launch `yarn up`
306+
- 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
244307

245308
### Refresh configuration settings
246309

@@ -371,21 +434,24 @@ following commands can be used.
371434

372435
git config core.hooksPath tests/scripts/git-hooks/
373436

374-
## Changes from 1.x
375-
376-
* in general, the main/ folder has been moved to public/main/
377-
* a big part of the frontend has been migrated to VueJS + Tailwind CSS
378-
* app/Resources/public/assets moved to public/assets
379-
* main/inc/lib/javascript moved to public/js
380-
* main/img/ moved to public/img
381-
* main/template/default moved to src/CoreBundle/Resources/views
382-
* src/Chamilo/XXXBundle moved to src/CoreBundle or src/CourseBundle
383-
* bin/doctrine.php removed use bin/console doctrine:xyz options
384-
* Plugin images, CSS and JS libs are loaded inside the public/plugins folder
385-
(composer update copies the content inside plugin_name/public inside web/plugins/plugin_name
386-
* Plugins templates use the ``asset()` function instead of using "_p.web_plugin"
387-
* `main/inc/local.inc.php` has been removed
388-
* Translations are managed through Gettext
437+
## Big changes from 1.x (for developers)
438+
439+
This is a list of structural changes to help developers/maintainers of Chamilo 1.11 find their way in Chamilo 2. It is *not* a features list (refer to `public/documentation/changelog.html` for that).
440+
441+
* in general, the `main/` folder has been moved to `public/main/`
442+
* a big part of the frontend has been migrated to VueJS + Tailwind CSS (see `assets/vue/`)
443+
* `app/Resources/public/assets/` moved to `assets/`
444+
* `main/inc/lib/javascript/` moved to `assets/js/`
445+
* `main/img/` moved to `public/img/`
446+
* `main/template/default/` moved to `src/CoreBundle/Resources/views/`
447+
* `src/Chamilo/XXXBundle/` moved to `src/CoreBundle/` or `src/CourseBundle/`
448+
* `bin/doctrine.php` removed, use `bin/console doctrine:xyz` options
449+
* plugin images, CSS and JS libs are loaded inside the `public/plugin/` folder and the folder names have been renamed to CamelCase
450+
* plugins templates use the `asset()` function instead of using `_p.web_plugin`
451+
* `main/inc/local.inc.php` has been removed and `main/inc/global.inc.php` greatly reduced
452+
* translations are managed through Gettext, from the `translations/` directory for PHP code and from `assets/locales/` for VueJS code
453+
* files in `app/config/` have been restructured (to `.yaml`) and moved to `config/`
454+
* `app/config/configuration.php` has essentially been emptied to the `settings` table (accessible via the admin page in Chamilo), while the critical settings (database access etc) have been transferred to `.env`
389455

390456
Libraries
391457

@@ -432,9 +498,10 @@ See https://github.com/chamilo/chamilo-lms/projects/3
432498
If you want to submit new features or patches to Chamilo 2, please follow the
433499
Github contribution guide https://guides.github.com/activities/contributing-to-open-source/
434500
and our [CONTRIBUTING.md](CONTRIBUTING.md) file.
501+
435502
In short, we ask you to send us Pull Requests based on a branch that you create
436-
with this purpose into your repository, forked from the original Chamilo repository (`master` branch).
503+
with this purpose into your own repository, forked from the original Chamilo repository (`master` branch).
437504

438505
## Documentation
439506

440-
For more information on Chamilo, visit https://2.chamilo.org/documentation/index.html
507+
For more information on Chamilo 2, visit https://2.chamilo.org/documentation/index.html
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<VirtualHost *:80>
2+
ServerName my.chamilo.net
3+
DocumentRoot /var/www/chamilo/public/
4+
RewriteEngine On
5+
<Directory /var/www/chamilo/public>
6+
AllowOverride All
7+
Require all granted
8+
</Directory>
9+
php_value session.cookie_httponly 1
10+
php_admin_value session.save_handler "redis"
11+
php_admin_value session.save_path "tcp://127.0.0.1:6379"
12+
php_admin_value upload_max_filesize 256M`
13+
php_admin_value post_max_size 256M
14+
<LocationMatch "/.git">
15+
Require all denied
16+
</LocationMatch>
17+
<LocationMatch "/documentation">
18+
Require all denied
19+
</LocationMatch>
20+
</VirtualHost>

0 commit comments

Comments
 (0)