Configuration

From DAViCal Wiki

Jump to: navigation, search

Contents

This page, and sub-pages, give details of the configuration of DAViCal itself. If you haven't yet got Apache, PHP and PostgreSQL working correctly to get DAViCal operating in a basic manner then you need to sort those issues out first. Take a look at the Apache Config, PHP Config and PostgreSQL Config pages.

The Configuration File

The configuration file for DAViCal is looked for in two places. First, a config/config.php file is looked for, relative to the DAViCal root directory (the directory above the htdocs directory). If that is not present then it will look for a file in /etc/davical which is named domain.com-conf.php. This file is a PHP file and is included very early in the processing of each page.

In general you will use DAViCal only from remote locations but if you access it as 'localhost' then a /etc/davical/localhost-conf.php is also necessary - make this a symbolic link to your normal /etc/davical/domain.com-conf.php.

Example Configurations

Some commented example configurations are available in the source code. Unfortunately these did not ship in the past but they should be included in future versions in /usr/share/doc/davical/examples.

You can, however, download these example configurations from the source code, here:

There is also an start on a wikified version of the main example above, at Configuration settings.

General Configuration Settings

PostgreSQL Database Connection

You need to add a connect string to the configuration object:

 $c->pg_connect[] = 'dbname=davical port=5432 host=dbhost user=general password=fred';

Or, for a local DB on the default port with trust authentication:

 $c->pg_connect[] = 'dbname=davical user=general';

Unfortunately if a password is required for the database it will need to be in a file readable by the webserver, so there isn't a lot of security to be gained by requiring one.

For performance reasons you may want to use persistent connections. AWL versions from 0.24 support persistent connections by setting:

$c->use_persistent = true;

Default Relationships

It is possible to configure DAViCal so that each new user created will automatically be added to some relationships. This is particularly useful if your users are created elsewhere and the authentication is done through LDAP or such.

See Configuration/Default Relationships for the full details.

Authentication Configuration

For the default, using the tables in the DAViCal database, no extra configuration should be needed over and above the database connection which is required for anything at all to operate.

Using LDAP

See Configuration/LDAP for some detailed examples of configuring DAViCal to use an LDAP server for an authentication source. Here is a brief example, however:

$c->authenticate_hook['call'] = 'LDAP_check';
$c->authenticate_hook['config'] = array(
    'host' => 'www.tennaxia.net',
    'port' => '389',
    'bindDN'=> 'cn=manager,cn=internal,dc=tennaxia,dc=net',
    'passDN'=> 'xxxxxxxx',
    'baseDNUsers'=> 'dc=tennaxia,dc=net', //where to look at valid user
    'filterUsers' => 'objectClass=kolabInetOrgPerson', //filter that must validate an valid user
    'baseDNGroups' => 'ou=divisions,dc=tennaxia,dc=net', //not used ATM
    'filterGroups' => 'objectClass=groupOfUniqueNames', //not used ATM
    'mapping_field' => array("username" => "uid",
                             "updated" => "modifyTimestamp",
                             "fullname" => "cn" ,
                             "email" =>"mail",
                             "active" => ), //used to create the user based on his ldap properties
    'default_value' => array("date_format_type" => "E","locale" => "fr_FR"),
    'format_updated'=> array('Y' => array(0,4),'m' => array(4,2),'d'=> array(6,2),
                             'H' => array(8,2),'M'=>array(10,2),'S' => array(12,2))

    );
 include_once('drivers_ldap.php');

Explanation of parameters:

host The hostname of the LDAP server
port The port to connect to the LDAP server on
bindDN The DN to bind to
passDN The password for the bind
baseDNUsers The base DN to look in for valid users
filterUsers A filter which must pass for this to be a valid user
baseDNGroups Not used at present
filterGroups Not used at present
mapping_field An array of DAViCal field names vs. their LDAP mappings
default_value An array of DAViCal field names vs. fixed default values
format_updated An array, keyed on Y, m, d, H, M and S with the values being arrays of (start,length) for substring operations on the DAViCal 'updated' field sourced from LDAP.

NB: it's important to remember to install the LDAP modules for PHP (the php5-ldap package under debian/ubuntu).

Using a different 'AWL' database

The "AWL" library contains the basic database structure for user data which is used by DAViCal, and it is possible to use this data from a different database. This plugin is written more-or-less as an example of how to write an authentication plugin, but may be useful.

See Also

Personal tools