Based upon https://beeznest.com/blog/2015/01/02/chamilo-pi-installing-chamilo-lms-on-a-raspberry-pi-b/.
STEP 1- Install DietPi. I’ve modified dietpi.txt to have a static IP, and installed it from SSH.
STEP 2- Go to dietpi-software and install LEMP and, from Additional Software, Git.
STEP 3a-
sudo apt-get install php5-gd
sudo apt-get install php5-curl
cd /var/www/
git clone https://github.com/chamilo/chamilo-lms.git chamilo
STEP 4- While the command git clone is working you can optimize things. I open another SSH session and do all the “step 4”.
STEP 4a: Optimizing NGINX
cd /etc/nginx/sites-available/
cp default default.old
nano default
default file:
server {
listen 80;
# If you want to respond to any URL, don't define a server_name
# server_name my.chamilo19.net your.chamilo19.net;
access_log /var/log/nginx/chamilo-access.log;
error_log /var/log/nginx/chamilo-error.log notice;
root /var/www/chamilo;
index index.php;
location ~ \.php$ {
client_max_body_size 200m;
include /etc/nginx/fastcgi_params;
expires 5m;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/chamilo$fastcgi_script_name;
try_files $uri $uri/ @rewrite;
}
}
STEP 4b- Optimizing PHP-FPM
cd /etc/php5/fpm/pool.d/
cp www.conf www.conf.old
nano www.conf
The lines you have to modify:
pm.max_children = 32
pm.start_servers = 4
pm.min_spare_servers = 4
pm.max_spare_servers = 8
The lines you have to add:
php_admin_value[short_open_tag] = off php_admin_value[session.cookie_httponly] = on php_admin_value[upload_max_filesize] = 200M php_admin_value[post_max_size] = 200M
php_admin_value[allow_url_fopen] = on
; I’m supposing you are in Europe
php_admin_value[date.timezone] = Europe/Brussels
STEP 4c- Optimizing Zen Optimizer
cd /etc/php5/fpm/conf.d/
cp 05-opcache.ini 05-opcache.ini.old
nano 05-opcache.ini
The 05-opcahe.ini
opcache.enable=on
opcache.memory_consumption=24
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=3900
opcache.revalidate_freq=120
opcache.fast_shutdown=1
; Special optimization: do not used cwd to cache files as on this install there's only one php app
opcache.use_cwd=0
STEP 4d- Optimizing MySQL
cd /etc/mysql/
cp my.cnf my.cnf.old
nano my.cnf
The only lines you should modify:
max_connections = 40
query_cache_limit = 16M
And close this SSH session.
STEP 3b
When git clone has finished, we have to:
cd chamilo
git checkout 1.9.x
service mysql restart
service php5-fpm restart
service nginx restart
STEP 5
Let’s prepare the Chamilo folders.
sudo chown -R www-data:www-data /var/www
sudo chmod -R 755 /var/www/chamilo/main/inc/conf/
sudo chmod -R 755 /var/www/chamilo/main/upload/users/
sudo chmod -R 755 /var/www/chamilo/main/default_course_document/images/
sudo chmod -R 755 /var/www/chamilo/archive/
sudo chmod -R 755 /var/www/chamilo/courses/
sudo chmod -R 755 /var/www/chamilo/home/
sudo chmod -R 755 /var/www/chamilo/main/css/
sudo chmod -R 755 /var/www/chamilo/main/lang/
sudo chmod -R 755 /var/www/chamilo/searchdb/
STEP 6
Normal installation procedure.
Go to your DietPi system by webpage. I have i ton the static IP 192.168.1.13 so I go to http://192.168.1.13
Special details:
On step 4 of 6,
database user: root
database password: dietpi
Check the user can connect to the database and “Next”.
On step 5 of 6,
Chamilo URL, http://192.168.1.13
STEP 7
Security issues:
rm -r /var/www/chamilo/main/install
chmod 555 /var/www/chamilo/main/inc/conf
STEP 8
Now you have Chamilo LMS 1.9.10.2 installed.
You can check its speed:
apt-get install apache2-utils
ab -n 200 -c 10 http://192.168.1.13/
Inside of Chamilo, you can go to the administration panel and select “Platform settings”, to increase efficiency:
• disable the “hot courses” block
• disable the display of “online users” (for the three types)
• disable online chat
• disable all unnecessary languages
You can install HTTPS.
You can improve security (you can find a security guide on Chamilo webpage).
If you want to go into it from the Internet, you will need to open web server ports (80) from your router and install NoIP (NoIP can be installed using dietpi-software).
You will have to configure e-mail settings, if you want the platform being able to send e-mails (for example, the welcome message to a new user).
In my case, I’ve used Gmail Server with my Gmail account.
cd /var/www/chamilo/main/inc/conf
sudo nano mail.conf.php
The mail.conf.php file:
$platform_email['SMTP_FROM_EMAIL'] = (isset($administrator['email'])?$administrator['email']:'mygmailname@gmail.com');
$platform_email['SMTP_FROM_NAME'] = (isset($administrator['name'])?$administrator['name']:'Admin');
$platform_email['SMTP_HOST'] = 'ssl://smtp.gmail.com';
$platform_email['SMTP_PORT'] = 465;
$platform_email['SMTP_MAILER'] = 'smtp'; // mail, sendmail or smtp
$platform_email['SMTP_AUTH'] = 1;
$platform_email['SMTP_USER'] = 'mygmailname@gmail.com';
$platform_email['SMTP_PASS'] = 'mypassword';
$platform_email['SMTP_CHARSET'] = api_get_system_encoding();
NOTE: You will have to go to your google account and say you want to activate the access to the “less secure applications”.