How to Install and configure Horde Webmail Client?

DeeKay August 29, 2011 at 7:05 pm · Linux

Below steps shows how to install and configure Horde Webmail Client-

<br />
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.<br />
STEP 1: Use system-config-network-tui to set up IP, Net mask and Gateway:</p>
<p># system-config-network-tui</p>
<p>STEP 2: Edit /etc/sysconfig/network and set your hostname:</p>
<p><br />
Save and exit file. Now, run # hostname</p>
<p>STEP 3: Edit /etc/resolv.conf and add your DNS servers:</p>
<p>STEP 4: Edit /etc/hosts to something like this, according to your system settings:</p>
<p># vim /etc/hosts</p>
<p># Do not remove the following line, or various programs that require network functionality will fail.</p>
<p><br />
localhost.localdomain<br />
localhost<br /><br /><br />
<p>::1<br />
localhost6.localdomain6<br />
localhost6<br />
Save and exit file.</p>
<p>STEP 5: Restart network: ( Also you need to restart your system )</p>
<p># service network restart</p>
<p>STEP 6: Prerequisites for Installation,</p>
<p>You need to enable EPEL, rpmforge repository to install required software.</p>
<p># yum install -y gettext httpd mysql mysql-server dovecot sendmail* perl</p>
<p># 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  php-pear-MDB2-Driver-mysql php-gd php-xmlrpc php-soap php-pecl-json php-pear-Date-Holidays php-devel gcc<br />
# yum install -y openssl mod_ssl crypto-utils perl-Net-SSLeay</p>
<p>STEP 7: Configuring Sendmail as a MTA and Dovecot as a POP3/IMAP server,</p>
<p>Sendmail Configuration</p>
<p># vim /etc/mail/</p>
<p>Add / Enable / comment out below lines,</p>
<p>define(`confSMTP_LOGIN_MSG’, `$j Sendmail; $b’)dnl</p>
<p>dnl # DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA’)dnl</p>
<p>Save and exit file.<br />
# vim /etc/mail/access and enter your system IP to relay mails like,</p>
<p><br />
RELAY<br />
# vim /etc/mail/local-host-names</p>
<p>save and exit all files and run</p>
<p># m4 /etc/mail/ > /etc/mail/</p>
<p># service sendmail restart</p>
<p>Now your SMTP server is running, you can send emails to out side domains if port 25 is unblocked from your ISP.</p>
<p>STEP 8: Dovecot configuration, enable below lines to /etc/dovecot.conf.</p>
<p>protocols = imap pop3</p>
<p>login_dir = /var/run/dovecot/login</p>
<p>login_chroot = yes</p>
<p>login_user = dovecot</p>
<p>login_greeting = Dovecot ready.</p>
<p>protocol imap {</p>
<p>login_executable = /usr/libexec/dovecot/imap-login</p>
<p>mail_executable = /usr/libexec/dovecot/imap</p>
<p>protocol pop3 {</p>
<p>login_executable = /usr/libexec/dovecot/pop3-login<br />
mail_executable = /usr/libexec/dovecot/pop3</p>
<p>pop3_enable_last = no</p>
<p>pop3_uidl_format = %08Xu%08Xv</p>
<p>auth_executable = /usr/libexec/dovecot/dovecot-auth</p>
<p>auth_process_size = 256</p>
<p>auth_cache_negative_ttl = 3600</p>
<p>Save and exit dovecot configuration file.</p>
<p># service dovecot restart; chkconfig dovecot on</p>
<p>Note: If using CentOS x86_64 temporary fix for this bug by editing /etc/dovecot.conf,</p>
<p>login_process_size = 64</p>
<p>Restart Apache Server, MySQL Database server</p>
<p># service httpd restart; chkconfig httpd on</p>
<p># service mysqld restart; chkconfig mysqld on</p>
<p>STEP 9: Configure mysqld root password:</p>
<p># /usr/bin/mysqladmin -u root password ‘your-password’</p>
<p># /usr/bin/mysqladmin -u root -h password ‘your-password’</p>
<p>Now we have everything ready for Horde Installation.</p>
<p>STEP 10: Download Horde Groupware Webmail Edition and extract it. Get the latest stable version of Horde Groupware Webmail Edition from</p>
<p>Extract files and rename folder:</p>
<p>#tar zxf horde-webmail-*.tar.gz -C /var/www/html/</p>
<p>#mv /var/www/html/horde-*/ /var/www/html/horde/</p>
<p># cd /var/www/html/horde/scripts/</p>
<p>Follow mentioned steps to successfully install horde. Now, create user horde in MySQL and grant horde DB the proper permissions,<br />
STEP 11: Edit a text file and change the password for the same as in Step 1 above:</p>
<p># mysql</p>
<p>mysql > REPLACE INTO user (host, user, password)</p>
<p>->VALUES (‘localhost’, ‘horde’, PASSWORD(‘password_for_horde_user’)</p>
<p>mysql >REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv, delete_priv, create_priv, drop_priv, index_priv)  VALUES ( ‘localhost’, ‘horde’, ‘horde’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’);</p>
<p>mysql > FLUSH PRIVILEGES;</p>
<p>Save the file as hordeuser.mysql (or something else) and load it as mysql stdin:</p>
<p># mysql –user=root –password=mysqlrootpassword < createuser.mysql

STEP 12: Edit PHP configuration as below:

# vim /etc/php.ini

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

php_admin_flag allow_url_fopen on

php_admin_value open_basedir   “/var/www/html/horde:/var/www/html/horde/config:/usr/share/pear:/tmp”

php_admin_flag register_globals off

# 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

STEP 13: Finally, Configure Apache and PHP, add a “horde.conf” file to /etc/httpd/conf.d:


# Horde


Alias /horde /var/www/html/horde

<Directory /var/www/html/horde></p>
<p># Uncomment the following 3 lines to make Horde locally accessible only</p>
<p>#Order Deny,Allow</p>
<p>#Deny from all</p>
<p>#Allow from</p>
<p>Options +FollowSymLinks</p>
<p><Directory /var/www/html/horde/config></p>
<p>Order Deny,Allow</p>
<p>Deny from all</p>
<p># Deny access to files that are not served directly by the web server</p>
<p><DirectoryMatch “^/var/www/html/horde/(.*/)?(config|lib|locale|po|scripts|templates)/(.*)?”></p>
<p>Order Deny,Allow</p>
<p>Deny from all</p>
<p># Deny access to the test.php files except from localhost</p>
<p><LocationMatch “^/horde/(.*/)?test.php”></p>
<p>Order Deny,Allow</p>
<p>Deny from all</p>
<p>Allow from</p>
<p>Change horde.conf permission:</p>
<p># chmod 0644 -v /etc/httpd/conf.d/horde.conf</p>
<p>Increase memory_limit option in /etc/php.ini to 64MB or higher (128MB is recommended):</p>
<p>memory_limit = 64M</p>
<p>Restart httpd:</p>
<p># service httpd restart</p>
<p>Now, Open the following address in your browser:</p>
<p>Security configuration</p>
<p>Secure config files:</p>
<p>chown apache:root -R /var/www/html/horde/config</p>
<p>chown apache:root -R /var/www/html/horde/*/config</p>
<p>chmod -R go-rwx /var/www/html/horde/config</p>
<p>chmod -R go-rwx /var/www/html/horde/*/config<br />
Secure scripts:</p>
<p>chown -R root:root /var/www/html/horde/scripts</p>
<p>chown -R root:root /var/www/html/horde/*/scripts</p>
<p>chmod -R go-rwx /var/www/html/horde/scripts</p>
<p>chmod -R go-rwx /var/www/html/horde/*/scripts</p>
<p>Secure test.php:</p>
<p>chmod a-rwx /var/www/html/horde/test.php</p>
<p>chmod a-rwx /var/www/html/horde/*/test.php</p>
<p>Finishing configuration</p>
<p>Open in your browser and log into horde with the administrator horde user,<br />