From a7151c620b363f30bcf4e6965440daa902f222a0 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 9 Dec 2016 17:51:45 -0500 Subject: [PATCH] Installation guide update after many issues with users not being able to enter their courses because .htaccess is not interpreted. --- documentation/installation_guide.html | 52 +++++++++++++++++--- documentation/installation_guide_es_ES.html | 54 +++++++++++++++++---- documentation/installation_guide_fr_FR.html | 45 +++++++++++++++-- 3 files changed, 130 insertions(+), 21 deletions(-) diff --git a/documentation/installation_guide.html b/documentation/installation_guide.html index d2f49a8a3b..12f1190ae1 100755 --- a/documentation/installation_guide.html +++ b/documentation/installation_guide.html @@ -102,6 +102,35 @@ only a specific database. Please refer to the MySQL or MariaDB documentation in
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.
+ +

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: +
+    <Directory />
+        AllowOverride All
+        Order allow,deny
+        allow from all
+    </Directory>
+    
+ and for Apache >=2.4: +
+    <Directory />
+        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

@@ -605,8 +634,10 @@ This can easily be modified by editing the app/config/configuration.php file, fi 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')
-);

+ '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. @@ -653,19 +684,23 @@ If you have issues with files taking a long time to download, make sure you reco

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*">
+  <LocationMatch "/.git*">
 	order deny,allow
 	deny from all
   </LocationMatch>
@@ -682,15 +717,20 @@ If you have issues with files taking a long time to download, make sure you reco
 	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/([^/]+)/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/([^/]+)/scorm/(.*)$ main/document/download_scorm.php?doc_url=/$2&cDir=$1 [QSA,L]
 	RewriteRule ^courses/([^/]+)/work/(.*)$ main/work/download.php?file=work/$2&cDir=$1 [QSA,L]
-	RewriteRule ^courses/([^/]+)/upload/(.*)$ main/courses/$1/upload/$2 [QSA,L]
-	RewriteRule ^courses/([^/]+)/course-pic85x85.png$ main/courses/$1/course-pic85x85.png [QSA,L]
+	RewriteRule ^courses/([^/]+)/upload/(.*)$ app/courses/$1/upload/$2 [QSA,L]
+	RewriteRule ^courses/([^/]+)/course-pic85x85.png$ app/courses/$1/course-pic85x85.png [QSA,L]
 	RewriteRule ^courses/([^/]+)/course-pic.png$ app/courses/$1/course-pic.png [QSA,L]
+	RewriteRule ^main/upload/users/(.*)/(.*)/my_files/(.*)$ app/upload/users/$1/$2/my_files/$3 [QSA,L]
 	RewriteRule ^session/(\d{1,})/about/?$ main/session/about.php?session_id=$1 [L]
     RewriteRule ^badge/(\d{1,})/user/(\d{1,}) main/badge/issued.php?skill=$1&user=$2 [L]
+	RewriteRule ^main/admin/$ main/admin/index.php [QSA,L]
     RewriteRule ^main/exercice/(.+)$ main/exercise/$1 [QSA,L]
     RewriteRule ^main/newscorm/(.*)$ main/lp/$1 [QSA,L]
+	RewriteRule ^courses/(.*)$ app/courses/$1 [QSA,L]
   </Directory>
     

Nginx

diff --git a/documentation/installation_guide_es_ES.html b/documentation/installation_guide_es_ES.html index e86482aea8..39cc87fcd7 100755 --- a/documentation/installation_guide_es_ES.html +++ b/documentation/installation_guide_es_ES.html @@ -112,6 +112,33 @@ Nota:Esto se ha simplificado en gran medida desde la versión 1.9, ya que antes múltiples bases de datos y un modo obsoleto de una sola base de datos.

+

Redirecciones de Apache

+

+ Desde su versión 1.10, Chamilo requiere del servidor web que pueda gestionar redirecciones. Es algo muy comunes entre todos los sistemas web (ya sean CMS, LMS, ERP, etc) que permite, entre otras cosas, el uso inteligente y amigable de las URLs.
+ Si no usa Apache, debería consultar la sección "Configuraciones opcionales para Apache y Nginx" al fin de este documento.
+ Si usa Apache, configurar las redirecciones consta de dos pasos: +

+ Para Apache <=2.2: +
+    <Directory />
+        AllowOverride All
+        Order allow,deny
+        allow from all
+    </Directory>
+    
+ y para Apache >=2.4: +
+    <Directory />
+        AllowOverride All
+        Require all granted
+    </Directory>
+    
+
+ Una vez configurada esta parte (que quizás ya esté configurada por su proveedor), basta con reiniciar el servidor web para activar el cambio. +


2. Instalación de Chamilo LMS

@@ -700,7 +727,8 @@ por ejemplo. El efecto debería ser inmediato. location / { 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 ^/badge/(\d+)/user/(\d+)$ /main/badge/issued.php?skill=$1&user=$2 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; try_files $uri @rewrite; } @@ -716,6 +744,7 @@ por ejemplo. El efecto debería ser inmediato. 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 ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last; + rewrite ^/badge/([^/]+) /main/badge/issued.php?issue=$1 last; rewrite ^/main/exercice/(.+)$ /main/exercise/$1 last; rewrite ^/main/newscorm/(.+)$ /main/lp/$1 last; @@ -748,15 +777,15 @@ por ejemplo. El efecto debería ser inmediato. } -Apache2: La configuración para nuestro sitio de ejemplo my.chamilo10.net sería la siguiente: +Apache2: La configuración para nuestro sitio de ejemplo my.chamilo.net sería la siguiente:
 <VirtualHost *:80>
   ServerAdmin root@localhost
-  DocumentRoot /var/www/my.chamilo10.net/www
-  ServerName my.chamilo10.net
-  ErrorLog  /var/log/apache2/my.chamilo10.net-error.log
-  CustomLog /var/log/apache2/my.chamilo10.net-access.log combined
+  DocumentRoot /var/www/my.chamilo.net/www
+  ServerName my.chamilo.net
+  ErrorLog  /var/log/apache2/my.chamilo.net-error.log
+  CustomLog /var/log/apache2/my.chamilo.net-access.log combined
 
   ErrorDocument 401 /public/error-401.html
   DirectoryIndex index.php index.html
@@ -772,22 +801,27 @@ Apache2: La configuración para nuestro sitio de ejemplo my.chamilo10.net sería
 	Options -Indexes
   </Directory>
 
-  <Directory "/var/www/my.chamilo10.net/www">
+  <Directory "/var/www/chamilo">
 	RewriteEngine On
 	RewriteCond %{QUERY_STRING} ^id=(.*)$
 	RewriteRule ^([^/.]+)/?$ user.php?$1 [L]
 	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/([^/]+)/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/([^/]+)/scorm/(.*)$ main/document/download_scorm.php?doc_url=/$2&cDir=$1 [QSA,L]
 	RewriteRule ^courses/([^/]+)/work/(.*)$ main/work/download.php?file=work/$2&cDir=$1 [QSA,L]
-	RewriteRule ^courses/([^/]+)/upload/(.*)$ main/courses/$1/upload/$2 [QSA,L]
-	RewriteRule ^courses/([^/]+)/course-pic85x85.png$ main/courses/$1/course-pic85x85.png [QSA,L]
+	RewriteRule ^courses/([^/]+)/upload/(.*)$ app/courses/$1/upload/$2 [QSA,L]
+	RewriteRule ^courses/([^/]+)/course-pic85x85.png$ app/courses/$1/course-pic85x85.png [QSA,L]
 	RewriteRule ^courses/([^/]+)/course-pic.png$ app/courses/$1/course-pic.png [QSA,L]
+	RewriteRule ^main/upload/users/(.*)/(.*)/my_files/(.*)$ app/upload/users/$1/$2/my_files/$3 [QSA,L]
 	RewriteRule ^session/(\d{1,})/about/?$ main/session/about.php?session_id=$1 [L]
     RewriteRule ^badge/(\d{1,})/user/(\d{1,}) main/badge/issued.php?skill=$1&user=$2 [L]
+	RewriteRule ^main/admin/$ main/admin/index.php [QSA,L]
     RewriteRule ^main/exercice/(.+)$ main/exercise/$1 [QSA,L]
     RewriteRule ^main/newscorm/(.*)$ main/lp/$1 [QSA,L]
+	RewriteRule ^courses/(.*)$ app/courses/$1 [QSA,L]
   </Directory>
 
   php_value display_errors Off
@@ -798,7 +832,7 @@ Apache2: La configuración para nuestro sitio de ejemplo my.chamilo10.net sería
   # E_ALL:  php_admin_value error_reporting 6143
   # E_ALL & ^E_NOTICE:
   php_admin_value error_reporting 6135
-  #php_admin_value session.save_path /var/www/my.chamilo10.net/sessions/
+  #php_admin_value session.save_path /var/www/my.chamilo.net/sessions/
   php_admin_value short_open_tag Off
   php_value session.cookie_httponly 1
 
diff --git a/documentation/installation_guide_fr_FR.html b/documentation/installation_guide_fr_FR.html
index 0addf7e83a..2ae81a5edd 100644
--- a/documentation/installation_guide_fr_FR.html
+++ b/documentation/installation_guide_fr_FR.html
@@ -136,6 +136,34 @@
                 et une installation obsolète sur une seule base. Ca a été clarifié et simplifié par l'usage d'une seule base de données.
             
+

Redirections d'Apache

+

+ Depuis sa version 1.10, Chamilo exige que le serveur web puisse gérer les redirections. Il s'agit d'un pré-requis très commun de nos jours pour les applications web (autant CMS que LMS, ERP, etc) qui permet, entre autres, l'utilisation intelligente et user-friendly des URLs.
+ Si vous utilisez un autre serveur web qu'Apache, dirigez-vous à la section "Configuration de la réécriture" en fin de ce document.
+ Si vous utilisez Apache, la configuration des redirections se fait en deux étapes simples: +

+ Pour Apache <=2.2: +
+    <Directory />
+        AllowOverride All
+        Order allow,deny
+        allow from all
+    </Directory>
+    
+ et pour Apache >=2.4: +
+    <Directory />
+        AllowOverride All
+        Require all granted
+    </Directory>
+    
+
+ Une fois configurée cette partie (qui est peut-être déjà mise en place par votre fournisseur d'hébergement), il suffit de redémarrer le serveur web pour activer la modification. +

+

2. Installation de Chamilo LMS

@@ -715,7 +743,7 @@ ou, si vous travaillez avec Apache 2.4, la syntaxe est légèrement différente

Apache RewriteRules

-          <LocationMatch "/.git*">
+  <LocationMatch "/.git*">
 	order deny,allow
 	deny from all
   </LocationMatch>
@@ -732,15 +760,20 @@ ou, si vous travaillez avec Apache 2.4, la syntaxe est légèrement différente
 	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/([^/]+)/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/([^/]+)/scorm/(.*)$ main/document/download_scorm.php?doc_url=/$2&cDir=$1 [QSA,L]
 	RewriteRule ^courses/([^/]+)/work/(.*)$ main/work/download.php?file=work/$2&cDir=$1 [QSA,L]
-	RewriteRule ^courses/([^/]+)/upload/(.*)$ main/courses/$1/upload/$2 [QSA,L]
-	RewriteRule ^courses/([^/]+)/course-pic85x85.png$ main/courses/$1/course-pic85x85.png [QSA,L]
+	RewriteRule ^courses/([^/]+)/upload/(.*)$ app/courses/$1/upload/$2 [QSA,L]
+	RewriteRule ^courses/([^/]+)/course-pic85x85.png$ app/courses/$1/course-pic85x85.png [QSA,L]
 	RewriteRule ^courses/([^/]+)/course-pic.png$ app/courses/$1/course-pic.png [QSA,L]
+	RewriteRule ^main/upload/users/(.*)/(.*)/my_files/(.*)$ app/upload/users/$1/$2/my_files/$3 [QSA,L]
 	RewriteRule ^session/(\d{1,})/about/?$ main/session/about.php?session_id=$1 [L]
-    RewriteRule "^badge/(\d{1,})/user/(\d{1,})$" main/badge/issued.php?skill=$1&user=$2 [L]
+    RewriteRule ^badge/(\d{1,})/user/(\d{1,}) main/badge/issued.php?skill=$1&user=$2 [L]
+	RewriteRule ^main/admin/$ main/admin/index.php [QSA,L]
     RewriteRule ^main/exercice/(.+)$ main/exercise/$1 [QSA,L]
     RewriteRule ^main/newscorm/(.*)$ main/lp/$1 [QSA,L]
+	RewriteRule ^courses/(.*)$ app/courses/$1 [QSA,L]
   </Directory>
 

Nginx

@@ -767,7 +800,8 @@ Ce sont uniquement les redirections à placer dans un bloc server{}, comme les a location / { 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 ^/badge/(\d+)/user/(\d+)$ /main/badge/issued.php?skill=$1&user=$2 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; try_files $uri @rewrite; } @@ -783,6 +817,7 @@ Ce sont uniquement les redirections à placer dans un bloc server{}, comme les a 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 ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last; + rewrite ^/badge/([^/]+) /main/badge/issued.php?issue=$1 last; rewrite ^/main/exercice/(.+)$ /main/exercise/$1 last; rewrite ^/main/newscorm/(.+)$ /main/lp/$1 last;