Installing Horde 4 WebMail in Linux

Recently I upgraded the BsnTech Networks webmail system from Horde 3 to Horde 4.  Horde has changed the install strategy from downloading the individual files to a Pear-based installation technique.

It took me a few tries to get everything fully running and up, but it is now working very well.  The install process will even upgrade your Horde 3 database to the Horde 4 requirements as well.

So, if you are looking to install the new Horde 4 Webmail system, look no further than this tutorial.

First of all, ensure you do a full backup of your current Horde database!

This tutorial also recommends that you install Pear as a separate instance – specifically just for running Horde – so you are not using the system-wide Pear installation.

Note that below, where you see <PATH>, you need to substitute in the path where you will be installing horde.

#1 – you need to create the directory for where you want to install Horde.

mkdir <PATH>

So if you want Horde to be installed in /var/www/webmail, this will be the command:

mkdir /var/www/webmail

#2 – You now need to create a pear.conf file that contains the configuration data for the standalone Pear install:

pear config-create <PATH> <PATH>/pear.conf

#3 – Now it is time to install Pear into this directory:

pear -c <PATH>/pear.conf install pear

#4 – OK so a standalone Pear is now installed.  Now you need to discover the horde Pear install location:

<PATH>/pear/pear -c <PATH>/pear.conf channel-discover pear.horde.org

#5 – Next, install the horde_role package:

<PATH>/pear/pear -c <PATH>/pear.conf install horde/horde_role

#6 – Now you need to run the package to set the install location for the webmail system:

<PATH>/pear/pear -c <PATH>/pear.conf run-scripts horde/horde_role

When you run the horde_role package, it will ask you where the install location will be for the webmail system.  You will put in the <PATH> that you have specified.  So again, if your <PATH> is /var/www/webmail – you will put that in when asked

#7 – Next, go ahead and set the “preferred state” for package downloads to be “alpha” using the command below.  This will prevent you from getting any errors or other issues during the install:

<PATH>/pear/pear -c <PATH>/pear.conf config-set preferred_state alpha

#8 – It is now time to download all of the needed components for Horde Webmail:

<PATH>/pear/pear -c <PATH>/pear.conf install -a -B horde/webmail

#9 – I would also recommend that you install the Password module for Horde as well – if you want to be able to allow your users to change their passwords within the Horde 4 Webmail:

<PATH>/pear/pear -c <PATH>/pear.conf install -a -B horde/passwd

#10 – Now, because you chose to install Horde using a separate, standalone version of Pear, you need to go to the <PATH> and open the .htaccess file.  These lines need to be added to the file (again, ensure you substitue <PATH> with the install location:

php_value include_path <PATH>/pear/php
SetEnv PHP_PEAR_SYSCONF_DIR <PATH>

#11 – OK – getting close now.  Next step is to run the webmail-install script that will ask you a few questions about getting Horde installed and configured – and update or install your Horde database:

PHP_PEAR_SYSCONF_DIR=<PATH> php -d include_path=<PATH>/pear/php <PATH>/pear/webmail-install

#12 – Alright – the next step is to set the permissions so you’ll be able to login to the system in a web browser and configure the Horde settings.  For easy purposes right now, do the following to set all of the files to be writable by all (we’ll change this back later):

sudo chmod -R 777 <PATH>

#13 – So you should now have Horde all installed and configured.  You should now be able to open your browser and login (hopefully you configured an account as an administrator in the webmail-install process).  The first then you need to do – is to go through and configure each of the components – under the Administration menu and then Setup.  Click on each of the modules (calendar, tasks, notes, mail, horde, passwd, etc) and configure them how you wish – and then generate the configuration.

#14 – Lastly, you now need to change the permissions on the files back to only being writable by the user that installed Horde on the server.  This will prevent you – or others online – from making changes to the configuration files.  In the event you want to change the configuration in the future, ensure you follow step #12 above to allow the files to be writable by all – then change the files to be writable only by the owner.  So, now that you have got the configuration done, make the files writable only by the owner:

sudo chmod -R 755 <PATH>

Setting Up Alarms

One part of the Kronolith (calendar) system – is that you can set alarms to remind you of upcoming events.  In order to ensure this is done effectively, you need to create a cron job that will call a script to check for events in all calendars.  Therefore, the below lines will create that job to check for appointments:

# Horde Alarms
*/5 * * * * root PHP_PEAR_SYSCONF_DIR=<PATH> php -d include_path=<PATH>/pear/php <PATH>/pear/horde-alarms > /dev/null 2>&1

Updating Horde

In the event that there are changes to Horde and it’s appropriate modules, upgrading to the newer installs are easy.  This is the command that will upgrade all modules that are installed with your Pear installation:

<PATH>/pear/pear -c <PATH>/pear.conf upgrade-all

In essence, this one command will upgrade all modules and installs for that specific Pear install – including any dependencies and any updates to Horde or it’s appropriate modules.

7 thoughts on “Installing Horde 4 WebMail in Linux

  1. i dont understand this command

    PHP_PEAR_SYSCONF_DIR= php -d include_path=/pear/php /pear/webmail-install

    i type webmail-install and webmail-install: command not found appear

  2. That is correct. You need to replace the where it appears in that command with the path you are installing Horde in.

    So, if you are installing it in /var/www – this would be the command:

    PHP_PEAR_SYSCONF_DIR=/var/www php -d include_path=/var/www/pear/php /var/www/pear/webmail-install

  3. hi brian thanks for the reply. now i can run webmail-install but when i point to http://mail.server/webmail.test.php i `ve got this error
    [quote]Could not find Horde’s framework libraries in the following path(s): /var/www/webmail/lib:.:/usr/share/pear:/usr/share/php. Please read horde/docs/INSTALL for information on how to install these libraries[/quote]

    my .htacces is
    [quote]php_value include_path /var/www/pear/php SetEnv PHP_PEAR_SYSCONF_DIR /var/www[/quote]

  4. Your htaccess file is not correct – ensure it is setup like this (two separate lines):

    php_value include_path /var/www/webmail/pear/php
    SetEnv PHP_PEAR_SYSCONF_DIR /var/www/webmail

    …As long as the you installed in is /var/www/webmail. You left out the “webmail” part of the path – and I am assuming that is needed based on the error you received where Horde is looking in the /var/www/webmail/lib directory.

  5. THANK YOU THANK YOU THANKS YOU

    Took me ages to figure the new horde out…. I really appreciate all your effort to compile this walkthrough!!!

  6. I’m already up and running. My error were teh php modules basically I was missing a bunch. I think this lead to all the other issues. Your tutorial was great I did a hybrid of this and the horde website tut and it works! :lol:. I just have one question is I install webmail there is no need for the frame work the framework comes with the webmail correct? Thanks just need to know. I want everything to work how its supposed to.

  7. Hi there –

    Yes, if you installed the horde webmail package, you should have everything needed for a webmail system.

    Of course, this is only for webmail. You still need to actually have a mail service – such as Exim to do the sending/receiving of e-mail. You’ll then need a service that allows for POP3/IMAP connections to let people check their mail – such as Dovecot. I use Dovecot and have Horde configured to use IMAP.

Leave a Comment

*