Last Modified 2007-11-03 by Guest

Installing Horde Groupware Webmail Edition on CentOS 5


Horde Groupware Webmail Edition is a free, enterprise ready, browser based communication suite. Users can read, send and organize email messages and manage and share calendars, contacts, tasks and notes with the standards compliant components from the Horde Project. Horde Groupware Webmail Edition bundles the separately available applications IMP, Ingo, Kronolith, Turba, Nag and Mnemo.



  • CentOS 5.0 i386 (OS)
    • Horde Groupware Webmail Edition 1.0.3 (October 2 2007)
    • Apache (http server)
    • MySQL 5.0.22 (db server)
    • Postfix (mail server)
    • Dovecot (IMAP)

Installing prerequisites

yum install -y gettext httpd mysql mysql-server dovecot postfix system-switch-mail perl 

yum install -y php php-mysql php-xml php-imap php-mbstring php-mcrypt php-pecl-Fileinfo php-pecl-memcache php-pear-DB php-pear-File php-pear-Log php-pear-Mail-Mime php-pear-Auth-SASL php-pear-Date php-pear-HTTP-Request php-pear-Mail php-pear-Net-Sieve php-pear-Net-Socket php-pear-Net-SMTP

Set up your host name and address

  • Edit /etc/hosts to something like this, according to your system settings:

# Do not remove the following line, or various programs

# that require network functionality will fail.         localhost.localdomain        localhost     yourhostname.yourdomain.com  yourhostname

::1               localhost6.localdomain6      localhost6

Configuring Postfix and Dovecot

  • Turn off sendmail

service sendmail stop

chkconfig sendmail off


(select postfix)

  • Configure postfix and dovecot to allow the creation of mail subfolders

postconf -e 'home_mailbox = Maildir/'

  • Edit /etc/dovecot.conf and add the following to the end of the file:

mail_location = maildir:~/Maildir

namespace private {

separator = /

prefix = ""

inbox = yes


  • Add the following to /etc/dovecot.conf to enable the IMAP protocol:

protocols = imap

  • To configure the rest of postfix, take a look at this nice tutorial:

Start services:

service httpd start

chkconfig httpd on

service postfix start

chkconfig postfix on

service dovecot start

chkconfig dovecot on

service mysqld start

chkconfig mysqld on

  • Configure mysqld root password:

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h yourhostname.yordomain.com password 'new-password'

Download Horde G. W. Edition and extract

  • Get the latest stable version of Horde Groupware Webmail Edition:
  • Extract and rename files

tar zxf horde-webmail-1.0.3.tar.gz -C /var/www/html/

mv /var/www/html/horde-*/ /var/www/html/horde/

cd /var/www/html/horde/config

rm -rf hooks.php.dist

for d in *.dist; do d0=`basename $d .dist`; if [ ! -f "$d0" ]; then cp -p $d $d0; fi; done

Creating database

cd /var/www/html/horde/scripts/


Press 1; choose mysql; Persistent connection 0; Username horde; Choose a password for mysql user horde; Unix sockets; Locatio null; DB name horde;

Press 2; yes; root; root mysql password;

Press 3; specify an existing IMAP user to have horde administration permissions (i.e. your current linux user)

Add horde.conf to /

install -D -p -m 0644 %{name}.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf

<Directory %{_datadir}/%{name}>

# Comment out the following 3 lines to make Horde accessible from anywhere

Order Deny,Allow

Deny from all

Allow from

Options +FollowSymLinks

# horde.org's recommended PHP settings:

php_admin_flag safe_mode off

php_admin_flag magic_quotes_runtime off

php_flag session.use_trans_sid off

php_flag session.auto_start off

php_admin_flag file_uploads on

# Optional - required for weather block in Horde to function

#php_admin_flag allow_url_fopen on

# If horde dies while trying to handle large email file attachments,

# you are probably hitting PHP's memory limit. Raise that limit here,

# but use caution

# Set to your preference - memory_limit should be at least 32M

# and be greater than the value set for post_max_size

#php_value memory_limit 32M

#php_value post_max_size 20M

#php_value upload_max_filesize 10M

# /usr/share/pear is needed for PEAR. /var/www/html/horde is needed for Horde itself

# TODO: Set an appropriate include_path, too. Might even increase speed a bit.

php_admin_value open_basedir "%{_datadir}/%{name}:%{_sysconfdir}/%{name}:/usr/share/pear:/tmp"

php_admin_flag register_globals off


<Directory %{_sysconfdir}/%{name}>

Order Deny,Allow

Deny from all


  1. Deny access to files that are not served directly by the webserver

<DirectoryMatch "^%{_datadir}/%{name}/(.*/)?(config|lib|locale|po|scripts|templates)/(.*)?">

Order Deny,Allow

Deny from all


  1. Deny access to the test.php files except from localhost

<LocationMatch "^/horde/(.*/)?test.php">

Order Deny,Allow

Deny from all

Allow from


Security configuration

  • For horde framework

chown root:apache -Rv /var/www/html/horde/

chmod 0770 -Rv /var/www/html/horde

chmod 0640 -v /var/www/html/horde/config/*.dist

chmod 0640 -v /var/www/html/horde/config/.htaccess

chmod go-rwx /var/www/html/horde/test.php

chown -R root:apache /var/www/html/horde/config

chmod -R 750 /var/www/html/horde/config

chown -R root:apache /var/www/html/horde/config/.htaccess

chmod -R 640 /var/www/html/horde/config/.htaccess

chown -R root:apache /var/www/html/horde/config/*.dist

chmod -R 640 /var/www/html/horde/config/*.dist

  • For IMP


... (Later I'll continue this howto)