Main Menu

Powered by TEITOK
© Maarten Janssen, 2014-

TEITOK Help Pages

Server Wide Settings

The base design of TEITOK is that a corpus is fully enclosed in a folder: all definitions are either in the project folder, or in the TEITOK sytem folder itself. The advantage of that is that it is very easy to move a corpus from one server to another. But it does mean that by default, there is no shared infrastructure in TEITOK - no common login, no server-wide settings. For universities with various TEITOK projects on a single server, this can be undesirable, which is why more recent versions of TEITOK contain the option to have system-wide settings.

System-wide settings are set-up by creating a folder containing the shared data, and pointing each project to that folder. This can either be done in the settings of the individual project, or by setting an environment variable TT_SHARED. When a shared folder is indicated, everything that is not defined specifically for the project will be inherited from the shared folder. This in in principle relates to everything: local modules, settings, HTML pages, users, etc. Within the general set-up of TEITOK, that means that if we attempt to open a page mymodule, it will first look for a page with that name in the current project, then for a module in the current project, then for a page or a module in the shared folder, and finally for a page or a module in the core TEITOK system.

Since local files overrule files in the shared folder, in order to set-up a generic template used in all the projects on a server, it is not only necessary to provide a template folder with a main.tpl template inside the shared folder, but also to remove the templates folder from the project folder, since otherwise TEITOK will still use the local template instead of the shared template. A shared template has the advantage that if there are changes to say the logo of the university, that change needs to be made only once.

The most easy way to define the shared folder is to set the environment folder in the .htaccess file in the root of the TEITOK projects, typically /var/www/html/teitok, by adding the following line : SetEnv TT_SHARED /var/www/html/teitok/shared. This will make every project placed in that folder use /var/www/html/teitok/shared for the shared settings and resources. The shared folder should ideally be as empty as possible, containing only those definitions and resources that should apply to all projects; one of the setings that should ideally be defined server-wide is the local URL for that Javascript files, typically /teitok/Scripts. With the shared folder settings, the typical .htaccess file for TEITOK (in /var/www/html/teitok/.htaccess) looks as follows:

DirectoryIndex index.php
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*?)/(.*)$ $1/index.php/$2

SetEnv SMARTY_DIR /home/git/smarty/libs
SetEnv TT_SHARED /var/www/html/teitok/shared
SetEnv TT_ROOT /home/git/TEITOK

For users that are defined in the shared folder, it is necessary to define which project(s) the user has access to, and what his permissios are in each project; or it is possible to define projects="all" to allow the user the same access to all projects on the server.

Back to index