Dokeos on non-dedicated servers
From Dokeos
When using Dokeos on non-dedicated server, you might run into problems where we haven't thought about every case and failed to provide you with a completely worryless intallation. On this page, you will find a series of fortunate solutions that will hopefully get you sorted.
Mono-database mode and many courses problem
The mono-database mode was specifically made for free hosting, so that you could install Dokeos on a hosting service that only gives you one database per user. However, considering the bad initial structure of the Dokeos database (tables or databases repeated for each course), you will run into problems about 50 times faster than someone using multiple-databases. This is because file systems (even on big hosting servers) have problems managing a lot of files in the same directory, and because creating 20 courses in a mono-database install will create about 3000 files in one directory alone.
As for now, there is no *good* solution for this. We recommend you switch to a paying server if you start running into slowliness problems because you have many courses on your system. During the move to a paying service, you should switch to a multi-database mode. This can be done following the instructions in this guide by Michel: Databasemigration_from_singledb_to_multidb
Group has write permissions on index.php problem
When you use a system managed by DataPanel (or dpanel), you might realise that after creating a course, you cannot access it. The error shown says:
/home/userxyz/public_html/courses/your_course_code/index.php is writeable by group
If you modify the file permissions (which you cannot do recursively from dpanel) and remove the write permission for the group and others, you will realize you then have another error:
/home/userxyz/public_html/courses/your_course_code/ is writeable by group
which is basically the same but for the directory. If you change the permissions the same way for this directory (not recursive), you will find that this problem is solved and that you can access the course.
Now the remaining problem is that when you create a new course, you have to do that again. This, of course, is not an affordable solution if you are not the only one creating courses on your campus.
The problem lies in the fact that the Apache configuration says that the page should not be displayed if it is writeable by the group. However, the Apache settings cannot be modified from the dpanel. This leaves you only one solution: ensure the file *and* the directory are not writeable by the group when creating them. To do this, you have to go in your dokeos directory and update the following file
/main/inc/lib/add_course.lib.inc.php
In the function prepare_course_repository(), modify the following lines
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository, 0777); (...about 30 code lines here...) $fd = fopen(api_get_path(SYS_COURSE_PATH).$courseRepository . "/index.php", "w");
into these lines
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository, 0755); (...about 30 code lines here...) $fd = fopen(api_get_path(SYS_COURSE_PATH).$courseRepository . "/index.php", "w"); chmod(api_get_path(SYS_COURSE_PATH).$courseRepository . "/index.php",0755);
By setting the file and directory's permissions upon creation, you will ensure your new course directory can be opened and solve the problem at least until the next upgrade. This, however, will not fix your existing courses, for which you will have to do the change through the dpanel interface.

