Intern:IT:HowTo:Horde
Inhaltsverzeichnis |
Info
Im Zusammenhang mit dem Squab-Projekt wird die Groupware "Horde" eingesetzt.
Auf dieser Seite werden verschieden technische Details dazu beschreiben: </br>
Horde-Installation
Orientierung bietet: http://www.horde.org/apps/groupware/docs/INSTALL
/tmp muss ausreichend Platz haben, vserver-squeeze.txt macht grundlegende Dinge, wie z.B. meine Lieblings sources.list, less, sudo,
vim u.ae. installieren, locales setzen. Erhaeltlich unter http://lihas.de/install/vserver-squeeze.txt, fuer die Installation hat
das aber keine echten Auswirkungen.
bash ./vserver-squeeze.txt aptitude install php-pear pear channel-discover pear.horde.org pear install horde/horde_role pear run-scripts horde/Horde_Role Filesystem location for the base Horde application : /var/lib/horde pear install -a -B horde/groupware
aptitude install php5-gd php5-geoip php5-idn php5-imagick php5-ldap php5-tidy aptitude install php-http-webdav-server php-xml-serializer
aptitude install mysql-server php5-mysql pear install pear/MDB2#mysqli /etc/init.d/apache2 restart
mysql -p create user 'horde'@'localhost' identified by '12341234'; create database horde grant all on horde.* to 'horde'@'localhost';
groupware-install Type your choice []: mysqli Username to connect to the database as* [] horde Password to connect with Type your choice [unix]: Location of UNIX socket [] /var/run/mysqld/mysqld.sock Database name to use* [] horde Internally used charset* [utf-8] Type your choice [0]: Certification Authority to use for SSL connections [] Type your choice [false]: Specify a user name for the administrator account: hordeadmin Specify a password for the adminstrator account: 12341234
ln -s /var/lib/horde /var/www/ chown www-data /var/lib/horde/lib/../static
######################################################## diff -u -r1.1 /etc/php5/apache2/php.ini --- /etc/php5/apache2/php.ini 2011/11/07 11:41:13 1.1 +++ /etc/php5/apache2/php.ini 2011/11/07 11:42:30 @@ -1481,7 +1481,7 @@ ; Development Value: 1 ; Production Value: 1 ; http://php.net/session.gc-probability -session.gc_probability = 0 +session.gc_probability = 1 ; Defines the probability that the 'garbage collection' process is started on every ; session initialization. The probability is calculated by using the following equation: @@ -1495,7 +1495,7 @@ ; Development Value: 1000 ; Production Value: 1000 ; http://php.net/session.gc-divisor -session.gc_divisor = 1000 +session.gc_divisor = 10000
; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. #########################################################
Horde darf Konfig aendern:
chown -R www-data /var/lib/horde/config chmod +w /var/lib/horde/config/conf.php
Und noch mehr Horde:
pear install horde/webmail horde/whups horde/wicked horde/passwd horde/ingo horde/imp horde/gollem horde/ansel find /var/lib/horde -name config | while read a; do chown -R www-data $a; done
(Danke an _are_ )
Horde Update/Upgrade
pear upgrade -a -B -c horde
Dabei werden keine Betas berücksichtigt. http://www.horde.org/apps/horde/docs/UPGRADING
Konfiguration
horde/config/conf.php
Horde-LDAP und -AUTH Konfiguration
...
$conf['ldap']['hostspec'] = 'ldaps://LDAP-SERVER ldaps://LDAP-BACKUP-SERVER';
$conf['ldap']['port'] = 636;
$conf['ldap']['tls'] = false;
$conf['ldap']['version'] = 3;
$conf['ldap']['binddn'] = 'uid=horde,ou=services,dc=pilarkto,dc=org';
$conf['ldap']['bindpw'] = 'BIND-PW';
$conf['ldap']['bindas'] = 'admin';
$conf['ldap']['useldap'] = true;
$conf['auth']['admins'] = array('ADMIN');
$conf['auth']['checkip'] = true;
$conf['auth']['checkbrowser'] = true;
$conf['auth']['resetpassword'] = true;
$conf['auth']['alternate_login'] = false;
$conf['auth']['redirect_on_logout'] = false;
$conf['auth']['list_users'] = 'list';
$conf['auth']['params']['basedn'] = 'ou=users,dc=pilarkto,dc=org';
$conf['auth']['params']['scope'] = 'sub';
$conf['auth']['params']['ad'] = false;
$conf['auth']['params']['uid'] = 'uid';
$conf['auth']['params']['encryption'] = 'ssha';
$conf['auth']['params']['newuser_objectclass'] = array('posixAccount', 'inetOrgPerson');
$conf['auth']['params']['filter'] = '(objectclass=posixAccount)';
$conf['auth']['params']['password_expiration'] = 'no';
$conf['auth']['params']['driverconfig'] = 'horde';
$conf['auth']['driver'] = 'ldap';
$conf['auth']['params']['count_bad_logins'] = false;
$conf['auth']['params']['login_block'] = false;
$conf['auth']['params']['login_block_count'] = 5;
$conf['auth']['params']['login_block_time'] = 5;
...
LDAP-Gruppen
...
$conf['group']['params']['basedn'] = 'ou=groups,dc=pilarkto,dc=org';
$conf['group']['params']['scope'] = 'sub';
$conf['group']['params']['gid'] = 'cn';
$conf['group']['params']['memberuid'] = 'member';
$conf['group']['params']['attrisdn'] = false;
$conf['group']['params']['newgroup_objectclass'] = array('posixGroup', 'hordeGroup');
$conf['group']['params']['writedn'] = 'uid=horde,ou=services,dc=pilarkto,dc=org';
$conf['group']['params']['writepw'] = 'BIND-PW';
$conf['group']['params']['search']['objectclass'] = array('groupOfNames');
$conf['group']['params']['search']['filter_type'] = 'objectclass';
$conf['group']['params']['driverconfig'] = 'horde';
$conf['group']['driver'] = 'Ldap';
...
MAILER
... $conf['mailer']['params']['host'] = 'SMTP-SERVER'; $conf['mailer']['params']['localhost'] = 'pilarkto.org'; $conf['mailer']['params']['auth'] = 'LOGIN'; $conf['mailer']['type'] = 'smtp'; ...
MAILSTORAGE
... $conf['imap']['server'] = 'IMAP-SERVER'; $conf['imap']['port'] = 993; $conf['imap']['secure'] = 'ssl'; $conf['imap']['maildomain'] = 'pilarkto.org'; $conf['imap']['cache_folders'] = false; $conf['imap']['enabled'] = true; ...
Customizing
Um Änderungen auch über Updates und Upgrades hinaus zu behalten, müssen von bestimmten config-Dateien ".local"-Versionen erstellt werden.
Horde (Basis)
Ordner ...horde/config/
prefs.local.php
Aktivierung der Hooks für Anpassungen
<?php
// user preferred email address for From: line
// If you lock this preference, you must specify a value or a hook for it in
// horde/config/hooks.php.
$_prefs['from_addr'] = array(
'value' => ,
'locked' => false,
'hook' => 'true',
'type' => 'text',
'desc' => _("The default e-mail address to use with this identity:"),
);
// user full name for From: line
// If you lock this preference, you must specify a value or a hook for it in
// horde/config/hooks.php.
$_prefs['fullname'] = array(
'locked' => false,
'value' => ,
'hook' => 'true',
'type' => 'text',
'desc' => _("Your full name:"),
);
hooks.local.php
Achtung. Da sowohl in der hooks.php als auch in der hpooks.local.php-Kopie eine Klasse laden muss, was aber nicht zweimal geht (in der aktuellen PHP Version), muss die hooks.php nach hooks.local.php verschoben und entsprechend angepasst werden.
class Horde_Hooks
{
public function prefs_init($pref, $value, $username, $scope_ob)
{
switch ($pref) {
// Hole Absender-Mailadresse aus dem LDAP
case 'from_addr':
if (is_null($username)) {
return $value;
}
$ldapServer = 'ldaps://LDAP-SERVER';
$searchBase = 'uid=' . $username . ',ou=users,dc=pilarkto,dc=org';
$binddn = 'uid=horde,ou=services,dc=pilarkto,dc=org';
$bindpw = 'BIND-PW';
$ret = false;
$ds = @ldap_connect($ldapServer, $ldapPort);
if (@ldap_bind($ds, $binddn, $bindpw)) {
$searchResult = @ldap_search($ds, $searchBase, 'uid=' . $username);
$information = @ldap_get_entries($ds, $searchResult);
if (($information === false) || ($information['count'] == 0)) {
$user = '';
$user = $username . '@pilarkto.org';
} else {
$user = ($information[0]['mail'][0] != '')
? $information[0]['mail'][0]
: $information[0]['maildrop'][0];
}
}
ldap_close($ds);
return empty($user)
? $username
: $user;
// Hole den Display-Name aus dem LDAP
case 'fullname':
if (is_null($username)) {
return $value;
}
$ldapServer = 'ldaps://LDAP-SERVER';
$searchBase = 'uid=' . $username . ',ou=Users,dc=pilarkto,dc=org';
$binddn = 'uid=horde,ou=services,dc=pilarkto,dc=org';
$bindpw = 'BIND-PW';
$ret = false;
$ds = @ldap_connect($ldapServer, $ldapPort);
if (@ldap_bind($ds, $binddn, $bindpw)) {
$searchResult = @ldap_search($ds, $searchBase, 'uid=' . $username);
$information = @ldap_get_entries($ds, $searchResult);
if (($information === false) || ($information['count'] == 0)) {
$name = '';
} else {
$name = ($information[0]['cn'][0] != '')
? $information[0]['cn'][0]
: $information[0]['uid'][0];
}
}
ldap_close($ds);
return empty($name)
? $username
: $name;
}
}
IMP (Webmail)
Ordner ...horde/imp/config/
backends.local.php
IMAP und SMTP-Server Konfiguration für IMP.
<?php $servers['imap'] = array( // ENABLED by default 'disabled' => false, 'name' => 'IMAP Server', 'hostspec' => 'IMAP-SERVER', 'hordeauth' => true, 'protocol' => 'imap', 'port' => 993, 'secure' => 'ssl', 'maildomain' => , 'smtp' => array( ), 'cache' => false, );
prefs.local.php
Standard-Einstellungen für IMP
<?php
// Wo beginnt das Listing des Posteingang
$_prefs['mailbox_start'] = array(
'value' => IMP::MAILBOX_START_LASTPAGE,
'type' => 'enum',
'enum' => array(
IMP::MAILBOX_START_FIRSTUNSEEN => _("First (oldest) Unseen Message"),
IMP::MAILBOX_START_LASTUNSEEN => _("Last (newest) Unseen Message"),
IMP::MAILBOX_START_FIRSTPAGE => _("First Page"),
IMP::MAILBOX_START_LASTPAGE => _("Last Page")
),
'desc' => _("When opening a mailbox for the first time, where do you want to start?"),
'help' => 'prefs-mailbox_start'
);
// Mailbox Sortierung Kriterium
$_prefs['sortby'] = array(
// Sort by sequence by default. It is the fastest sort as it is the only
// sort that can be done without parsing message headers. It sorts
// messages by the order they were initially processed by the mail server.
'value' => IMP::IMAP_SORT_DATE,
'type' => 'enum',
'enum' => array(
Horde_Imap_Client::SORT_SEQUENCE => _("NONE"),
IMP::IMAP_SORT_DATE => _("Date"),
Horde_Imap_Client::SORT_FROM => _("From Address"),
Horde_Imap_Client::SORT_TO => _("To Address"),
Horde_Imap_Client::SORT_SUBJECT => _("Subject"),
Horde_Imap_Client::SORT_SIZE => _("Message Size"),
Horde_Imap_Client::SORT_THREAD => _("Thread")
),
'desc' => _("Default sorting criteria:")
);
// Sortierrichtung
$_prefs['sortdir'] = array(
'value' => 0,
'type' => 'enum',
'enum' => array(
0 => _("Ascending"),
1 => _("Descending")
),
'desc' => _("Default sorting direction:")
);
// Sortierung nach Eintrefen oder Datum
$_prefs['sortdate'] = array(
// Use internal IMAP date by default - this is generally the date that a
// message was first received on the IMAP server and is maintained even
// if the message moves between mailboxes.
'value' => Horde_Imap_Client::SORT_DATE,
'advanced' => true,
'type' => 'enum',
'enum' => array(
Horde_Imap_Client::SORT_ARRIVAL => _("Arrival time on server"),
Horde_Imap_Client::SORT_DATE => _("Date in message headers")
),
'desc' => _("Criteria to use when sorting by date:")
);
// Standard-Signatur
$_prefs['signature'] = array(
'value' => "PILARKTO.ORG - Open Laboratory e.V.\nKriegsbergstrasse 30, 70174 Stutgart\nhttp://www.open-laboratory.de/",
'hook' => false,
'type' => 'textarea',
'desc' => _("Your signature:")
);