Install Horde 4 Webmail For ISPConfig On Debian Squeeze Through PEAR

Want to support HowtoForge? Become a subscriber!
 
Submitted by sjau (Contact Author) (Forums) on Mon, 2012-04-02 17:30. :: Debian | ISPConfig | Control Panels | Email

Install Horde 4 Webmail For ISPConfig On Debian Squeeze Through PEAR

Author: Stephan Jau
Revision: v1.0
Last Change: April 01, 2012

Introduction

Horde is a groupware suite that offers email, calendar, task, contact management and more things. It also offers SyncML and ActiveSync to synchronize with your cell phones or other software. You can find out more about Horde on their webpage: http://www.horde.org/

This Howto assumes that you followed the ISPConfig 3 installation for Debian Squeeze and all the packages there.

 

1. Install necessary packages

apt-get install php5-sasl php5-intl libssh2-php php5-curl php-http php5-xmlrpc php5-geoip php5-ldap php5-memcache php5-memcached php5-tidy

 

2. Register the Horde Pear channel

pear channel-discover pear.horde.org

 

3. Set the Horde installation directory

pear install horde/horde_role
pear run-scripts horde/horde_role

You'll be asked the following question:

Filesystem installation for base Horde application: /var/www/horde

You can also chose another folder for the web-accessible horde files. However you'll need to adjust the path in the following steps then.

 

4. Install Horde Groupware Webmail Edition

pear install -a -B horde/webmail

There will be some errors regarding missing pear packages. Those will be fullfilled later.

 

5. Create MySQL Database

The Horde installation script will not create a MySQL database on its own. So we have to create it first and also the according user.

Enter the MySQL shell as

mysql -u root -p

Once entered, create database and the user 'horde' with passwod 'PASSWORD'. If you want to alter the database name, username, change according information. Set your own password of course.

CREATE DATABASE horde;
GRANT ALL ON horde.* TO horde@localhost IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;

Exit the MySQL Shell again

exit;

 

6. Run installation script

webmail-install

You'll be asked the following questions:

What database backend should we use? mysql

Request persistent connections? 0

Username to connect to the database as: The username you set in the previous step

Password to connect with: The password you set in the previous step

How should we connect to the database? unix

Location of UNIX socket: Just press [enter]

Database name to use: The database name you set in the previous step

Internally used charset: utf-8

Use SSL to connect to the server: 0 *

Certification Authority to use for SSL connection: Just press [enter]

Split reads to a different server? false

Filesystem installation for base Horde application: /var/www/horde

Specify an existing mail user who you want to give administrator permissions (optional): user@domaincom **

* Only set SSL to 1 if you can provide for each domain a SSL cert.

** Select an existing email user. That user then has configuration rights from within Horde itself. This is needed to create initial configuration files.

 

7. Create custom phptmp folder and chown horde folder to Apache user

mkdir /var/www/horde/phptmp/
chown -R www-data:www-data /var/www/horde

 

8. Add additional PEAR components

pear install channel://pear.php.net/SOAP-0.13.0
pear install pear/MDB2#mysql
pear install channel://pear.php.net/HTTP_WebDAV_Server-1.0.0RC7
pear install channel://pear.php.net/XML_Serializer-0.20.2
pear install channel://pear.php.net/Date_Holidays-0.21.6
pear install Net_LDAP
pear install channel://pear.php.net/Text_CAPTCHA-0.4.3
pear install pear/HTTP_Request2
pear install channel://pear.php.net/Console_Color2-0.1.1

 

9.Add local PEAR holiday calendars (optional)

There are several holiday calendars already in PEAR available. By default they are not installed. Select one or more of the following calendars if you want to install them. This enables in Horde Kronolith (=calendar) to show holidays for that country. Of course you could also add your own custom calendar to the PEAR installation.

pear install channel://pear.php.net/Date_Holidays_Austria-0.1.4
pear install channel://pear.php.net/Date_Holidays_Brazil-0.1.2
pear install channel://pear.php.net/Date_Holidays_Denmark-0.1.3
pear install channel://pear.php.net/Date_Holidays_Discordian-0.1.1
pear install channel://pear.php.net/Date_Holidays_EnglandWales-0.1.4
pear install channel://pear.php.net/Date_Holidays_Germany-0.1.2
pear install channel://pear.php.net/Date_Holidays_Iceland-0.1.2
pear install channel://pear.php.net/Date_Holidays_Ireland-0.1.3
pear install channel://pear.php.net/Date_Holidays_Italy-0.1.1
pear install channel://pear.php.net/Date_Holidays_Japan-0.1.2
pear install channel://pear.php.net/Date_Holidays_Netherlands-0.1.2
pear install channel://pear.php.net/Date_Holidays_Norway-0.1.2
pear install channel://pear.php.net/Date_Holidays_PHPdotNet-0.1.2
pear install channel://pear.php.net/Date_Holidays_Romania-0.1.2
pear install channel://pear.php.net/Date_Holidays_Slovenia-0.1.2
pear install channel://pear.php.net/Date_Holidays_Sweden-0.1.3
pear install channel://pear.php.net/Date_Holidays_Ukraine-0.1.2
pear install channel://pear.php.net/Date_Holidays_UNO-0.1.3
pear install channel://pear.php.net/Date_Holidays_USA-0.1.1

 

10. Create /etc/apache2/conf.d/horde.conf with the following content

Alias /Microsoft-Server-ActiveSync /var/www/horde/rpc.php
Alias /horde /var/www/horde
<Directory /var/www/horde>
           Options +FollowSymLinks
           AllowOverride None
           order allow,deny
           allow from all
           AddType application/x-httpd-php .php
           php_value include_path ".:/usr/share/php"
           php_value open_basedir "none"
           php_value upload_tmp_dir "/var/www/horde/phptmp/"
</Directory>

 

11. Restart apache

/etc/init.d/apache2 restart

 

12. Edit /var/www/horde/config/conf.php and set

$conf['testdisable'] = false; 

 

13. Open the horde test page on any domain

http://www.domain.com/horde/test.php

Most of the settings should be ok now. However you might want to alter some of the default php garbage collection stuff.

Re-edit the /var/www/horde/conf/conf.php and disable the test page

$conf['testdisable'] = true;

 

14. Allowing users to change their password from Horde (optional)

Horde can enable to let people change their ISPConig password from within Horde. For this, Horde provides a Passwd addon that


           order allow,deny needs to be configured to work with ISPConfig

Install the addon and chown it to Apache user:

pear install -a -B horde/passwd
chown -R www-data:www-data /var/www/horde/passwd

Horde also provides a simple way to alter configuration files with local values. This is done by copying an existing config file (e.g. conf.php) to conf.local.php. This can be usefull if you want to alter the default preference settings of some Horde applications e.g. use by default a 24h clock. So you can provide a homogenous starting configuration for new users. The same also goes for the Passwd addon. By using a local config file we make sure, a future update of horde won't override our settings.

cp -a /var/www/horde/passwd/config/backends.php /var/www/horde/passwd/config/backends.local.php

The above command is one line.

Now edit the /var/www/horde/passwd/config/backends.local.php file and search for

$backends['hordesql'] = array (
'disabled' => false,

Alter that to

$backends['hordesql'] = array (
'disabled' => true,

Then find the block that starts with

$backends['sql'] = array (
  'disabled' => false,
  'name' => 'SQL Server',
  [...]
    // 'query_lookup' => 'SELECT user_pass FROM horde_users WHERE user_uid = %u',
    // 'query_modify' => 'UPDATE horde_users SET user_pass = %e WHERE user_uid = %u',
  ),
);

and replace the whole block with this

$backends['sql'] = array (
  'disabled' => false,
  'name' => 'SQL Server',
  'preferred' => '',
  'policy' => array(
    'minLength' => 7,
    'maxLength' => 64,
    'maxSpace' => 0,
    'minNumeric' => 1,
  ),
  'driver' => 'Sql',
  'params' => array(
    'phptype' => 'mysql',
    'hostspec' => 'localhost',
    'username' => 'root',
    'password' => '***',
    'encryption' => 'crypt-md5',
    'database' => 'ISPCONFIG_DATABASE',
    'table' => 'mail_user',
    'user_col' => 'email',
    'pass_col' => 'password',
    'show_encryption' => false
    // The following two settings allow you to specify custom queries for
    // lookup and modify functions if special functions need to be
    // performed. In places where a username or a password needs to be
    // used, refer to this placeholder reference:
    // %d -> gets substituted with the domain
    // %u -> gets substituted with the user
    // %U -> gets substituted with the user without a domain part
    // %p -> gets substituted with the plaintext password
    // %e -> gets substituted with the encrypted password
    //
    // 'query_lookup' => 'SELECT user_pass FROM horde_users WHERE user_uid = %u',
   // 'query_modify' => 'UPDATE horde_users SET user_pass = %e WHERE user_uid = %u',
  ),
);

Of course replace the password with the root mysql password and change the database name to your ISPConfig database name. Once this is changed, you can use the Passwd tool to change the password from within Horde.

The policy section lets you set various options for what the password must look like. In this setup it has to be at least 7 characters and it must contain at least 1 number and no white spaces. Check the beginning of this file to find out what other options there are.

 

15. Finals things

Once you have made all the changes, login with the administrative user for horde. The email user you set during the webmail-install script setup. Once logged in, go into the adminsitration section and then horde configuration and create all the necessary configs. To start with, you can use the button that just creates them all or you can chose to review the configuration for each horde application yourself and apply changes that you want.

Horde also offers further applications. Visit http://www.horde.org/apps to see what's there.

Horde also offers a RSS feed so that you'll be notified on newer versions and for updating see here: http://www.horde.org/apps/webmail/docs/UPGRADING


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by felan (registered user) on Wed, 2014-07-23 23:29.
Thanks for the howto, but I do have a problem. I have two servers, both debian 6 and fully updated, one is our main server with a lot of content on it, the other is a newly installed test server, where I wanted to try out horde on, but I keep getting this message:

root@testserver:/etc/pear# pear channel-discover pear.horde.org

Discovering channel pear.horde.org over http:// failed with message: channel-add: Cannot open "http://pear.horde.org/channel.xml" (Connection to `pear.horde.org:80' failed: Connection timed outTrying to discover channel pear.horde.org over https:// instead

Discovery of channel "pear.horde.org" failed (channel-add: Cannot open "https://pear.horde.org/channel.xml" (Connection to `pear.horde.org:443' failed: Connection timed out))

I used "The Perfect Server" guide for Debian 6 with Apache and Dovecot (ISPConfig 3.0.5.4p1)

Submitted by Anonymous (not registered) on Thu, 2013-12-12 02:13.
Thank you for this guide. It was usefull for our Horde installation. Congratulations!
Submitted by rickbyronit (registered user) on Sun, 2013-06-16 08:11.

I have spent many hours prior to this trying to get a groupware package to work.

Thank you, thank you, thank you.

I will only add that I did add --alldeps to the pear install lines...

 

Kind regards

Rick

Submitted by GEMCC (not registered) on Mon, 2013-06-03 05:54.
Hello,

When I try to run this command, I get the follow errors:

Failed to download horde/horde within preferred state "stable", latest release is version 5.1.0RC1, stability "beta", use "channel://pear.horde.org/horde-5.1.0RC1" to install

Failed to download horde/Horde_Core within preferred state "stable", latest release is version 2.5.0RC1, stability "beta", use "channel://pear.horde.org/Horde_Core-2.5.0RC1" to install

horde/passwd requires package "horde/horde" (version >= 4.0.0, version <= 5.0.0, excluded versions: 5.0.0), installed version is 5.0.5

horde/passwd requires package "horde/Horde_Auth" (version >= 1.4.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.0.4

horde/passwd requires package "horde/Horde_Core" (version >= 1.3.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.4.3

horde/passwd requires package "horde/Horde_Exception" (version >= 1.0.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.0.3

horde/passwd requires package "horde/Horde_Injector" (version >= 1.0.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.0.1

horde/passwd requires package "horde/Horde_Util" (version >= 1.0.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.2.2

horde/passwd requires package "horde/Horde_View" (version >= 1.0.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.0.2

horde/passwd requires package "horde/Horde_Db" (version >= 1.0.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.0.3

horde/passwd requires package "horde/Horde_Ldap" (version >= 1.0.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.0.2

horde/passwd requires package "horde/Horde_Vfs" (version >= 1.0.0, version <= 2.0.0, excluded versions: 2.0.0), installed version is 2.1.0

horde/passwd can optionally use PHP extension "com"

No valid packages found

install failed

Please advise .

 Thank you for your time.

Submitted by Hylke Bron (not registered) on Thu, 2013-01-31 23:03.

Thanks for this tutorial, i got this stuff working in one evening. Unfortunately i had a few errors i needed fixing :(

First it gave some access denied error: Access denied for user 'horde@localhost'@'localhost' (using password: YES)

Turns out, that the privileges i set, werent set right, so how did i fix this? With this line of sql:

grant all privileges on horde.* to 'horde@localhost' identified by 'password';

instead of:

GRANT ALL ON horde.* TO horde@localhost IDENTIFIED BY 'PASSWORD';

note that the capital letters werent the problem, but either the word privileges or the single quotes around the horde@localhost did the trick.

 

And a note to those who get other errors, make sure that you wait while it executes a command, if you dont know for sure if its done, its probably doing stuff and you shouldnt interupt it, as i did once on the command:

webmail-install

I was too quick with quitting that screen somehow, and therefore it didnt create all the database tables resulting in a malfunction webmail, so i did webmail-install again and i did wait for it to finish completely and after that, all worked for me (or at least the email does, which is enough for me now).

I hope someone finds this usefull,

Yours sincerely,

Hylke

Submitted by Giuseppe (not registered) on Sun, 2012-11-11 22:07.

During the installation, this step "Filesystem installation for base Horde application: /var/www/horde" is not present. I have followed entire procedure, but it doesn't work within this step. How to resolve???

Submitted by Evadido (not registered) on Mon, 2013-09-02 19:39.

After several hours, I found the bug:

Just modify the file /etc/apache2/conf.d/horde.conf (created at step 10)

Substitute-> php_value open_basedir "none"

By -> php_admin_value open_basedir none

 Restart apache et voilá

 

Submitted by Anonymous (not registered) on Fri, 2012-09-07 02:27.

Hi, will it work for the Ubuntu 12.04 perfect server setup?

Thanks!

Submitted by mzerbe (registered user) on Sun, 2012-08-26 14:02.

I was using Horde 3 (1.2.x) before, which turned unusable with the server update to squeeze  and php 5.3. To solve this with an upgrade from Horde 3 to Horde 4 made everything worst, since the upgrade failed. A new installation of Horde 4 was not possible too. Horde told me that 4.0.8 is already installed. (even test.php showed Horde3)

If somebody comes into a similar situation, there is a easy way to remove a old horde installation described here:

http://wiki.horde.org/UninstallPEAR

After removal, you can start over using the tutorial above.

And everything will be fine. 

Submitted by Anonymous (not registered) on Sun, 2012-07-15 04:20.

Hi

Thanks for the nice tutorial

I have followed step by step the tutorial and i am getting a blank screen when i am trying to open the page.

Any ideas?

What should i look for 

 

Thanks

Submitted by LordPato (not registered) on Mon, 2012-04-23 15:53.

I have the following error in horde :

 Filesystem notification initialization error -- contact your mail administrator (check for configuration errors with the FAM/Gamin library)

Any ideas?

Submitted by CoffeeJunk (not registered) on Sat, 2012-04-07 14:29.

Stephan,

I had to add php5-mysql to the list as well, otherwise  'pear install pear/MDB2#mysql' will not install at all.

Greetz, CoffeeJunk

Submitted by sjau (registered user) on Thu, 2012-04-12 16:20.
Actually.... that package should already be installed when having followed the ISPConfig Squeeze / Dovecot / Bind / Apache howto.
Submitted by sjau (registered user) on Thu, 2012-04-12 16:18.
right... somehow that got lost in the list :) thx for reminding me.