Howto: Install Horde 3.0.4/IMP on FreeBSD

Wouter

Verified User
Joined
Jun 15, 2005
Messages
132
Location
The Netherlands
Howto: Install Horde and IMP on FreeBSD

With this howto you can completely install and integrate Horde and IMP in DirectAdmin on a FreeBSD server. I have tested this succesfully on several FreeBSD 5 and FreeBSD 6 boxes with DirectAdmin 1.25.4 and above.

This howto is based on http://www.directadmin.com/forum/showthread.php?s=&threadid=4219,. I have rewrite this because I had many problems with Horde 3 (the other howto is for Horde 2.2.5) and on FreeBSD servers.

Okay, let’s begin:

# fetch ftp://ftp.cac.washington.edu/imap/c-client.tar.Z
# tar -zxvf c-client.tar.Z
# cd imap-2007e
# make bsf
# mkdir -p /usr/local/imap-2007e/include /usr/local/imap-2007e/lib
# cd c-client
# cp *.h /usr/local/imap-2007e/include/
# cp *.c /usr/local/imap-2007e/lib/
# cp c-client.a /usr/local/imap-2007e/lib/libc-client.a
# cd ../..
# rm -rf imap-2007e/ c-client.tar.Z
# cd /usr/ports/textproc/libxml2/
# make install clean
# cd /usr/ports/net/openldap24-server/
# make install clean
# cd /usr/ports/misc/libmcal/
# make install clean
# mkdir /var/calendar
# chmod 1777 /var/calendar
# cd /usr/local/directadmin/customapache
# ./build clean
# ./build update
# ee configure.php

Add the following lines:

--with-iconv \
--with-ldap \
--with-mcal \
--with-dom \
--with-mime-magic \
--enable-mime-magic \
--with-imap=/usr/local/imap-2007e

Note: at the end of each line, except the last line, shoud be an \.

# ./build php y
# ./build clean
# /usr/local/etc/rc.d/httpd restart
# pear upgrade-all
# pear install Log Mail_Mime Mail DB Net_Socket Date Auth_SASL Net_URL HTTP_Request File Net_SMTP Services_Weather Cache XML_Util XML_Parser
# pear config-set preferred_state beta
# pear install XML_Serializer SOAP
# pear config-set preferred_state stable
# cd /var/www/html
# fetch http://ftp.horde.org/pub/horde/horde-latest.tar.gz
# tar xzpf horde-latest.tar.gz
# rm -f horde-latest.tar.gz
# mv horde-3.1.3 horde
# cd /var/www/html/horde/config/
# mv conf.php.dist conf.php
# cp conf.php conf.php.bak
# cp conf.php conf.php.orig
# mv hooks.php.dist hooks.php
# mv mime_drivers.php.dist mime_drivers.php
# mv motd.php.dist motd.php
# mv nls.php.dist nls.php
# mv prefs.php.dist prefs.php
# mv registry.php.dist registry.php
# ee /etc/httpd/conf/httpd.conf

Search for “#Start DirectAdmin Settings” and add the following line:

Alias /horde /var/www/html/horde/

After that you can save that file.

# cd /var/www/html/horde/scripts/sql/
# ee create.mysql.sql

Search for:

REPLACE INTO user (host, user, password)
VALUES (
'localhost',
'horde',
-- IMPORTANT: Change this password!
PASSWORD('horde ')
);

And change the standard password (horde).

# cat /usr/local/directadmin/scripts/setup.txt

Search for “adminpass” and keep it in mind :D.

# mysql -u da_admin -padminpass < create.mysql.sql

Note: Replace “adminpass” with the adminpass in /usr/local/directadmin/scripts/setup.txt.

# /usr/local/etc/rc.d/httpd restart

Then open your browser, and go to http://0.0.0.0/horde/test.php
(Where 0.0.0.0 is you should set your server IP!)

On that page everything (except PostgreSQL and MIME Magic Support (fileinfo)) should be on green (YES/SUPPORTED).
You may get an warning that your memory_limit is not disabled, I suggest you set this to 64MB in your php.ini.
If not all is green, then make sure it will be before you go to the next steps.

# cd /var/www/html/horde/
# fetch http://ftp.horde.org/pub/imp/imp-latest.tar.gz
# tar xzpf imp-latest.tar.gz
# rm -f imp-latest.tar.gz
# mv imp-h3-4.0.4 imp
# cd /var/www/html/horde/imp/config/
# mv filter.txt.dist filter.txt
# mv header.txt.dist header.txt
# mv menu.php.dist menu.php
# mv mime_drivers.php.dist mime_drivers.php
# mv motd.php.dist motd.php
# mv prefs.php.dist prefs.php
# mv servers.php.dist servers.php
# mv trailer.txt.dist trailer.txt
# cp conf.xml conf.php
# cp conf.php conf.php.bak
# cp conf.php conf.php.orig
# chown apache:apache conf.php conf.php.bak
# cd ../../config/
# chown apache:apache conf.php conf.php.bak
# ee /var/www/html/horde/imp/config/servers.php

Search for:

$servers['imap'] = array(
'name' => 'IMAP Server',
'server' => 'imap.example.com',
'hordeauth' => false,
'protocol' => 'imap/notls',
'port' => 143,
'folders' => 'mail/',
'namespace' => '',
'maildomain' => 'example.com',
'smtphost' => 'smtp.example.com',
'smtpport' => 25,
'realm' => '',
'preferred' => '',
'dotfiles' => false,
'hierarchies' => array()
);

And replace with:

$servers['imap'] = array(
'name' => 'IMAP Server',
'server' => 'localhost',
'hordeauth' => 'full',
'protocol' => 'imap',
'port' => 143,
'folders' => '',
'namespace' => '',
'maildomain' => '',
'smtphost' => '',
'smtpport' => 25,
'realm' => '',
'preferred' => '',
'dotfiles' => false,
'hierarchies' => array()
);

Then visit http://0.0.0.0/horde, choose “Management” and after that choose for “Settings”, then choose “E-mail (imp)” and choose “Generate e-mail configuration”. Then choose “Settings” again and select “Horde (horde)”. Then go to “Database” and make sure it will be the same as the following:

Database: MySQL (Do NOT select MySQL 4.1, even if you use this on your server!)

Database server: localhost

Username: horde

Password: The password you set in /var/www/html/horde/scripts/sql/create.mysql.sql.

Connect to database: UNIX Sockets

Location of UNIX socket: /tmp/mysql.sock (most of the time this is okay, if it’s not: check your server where mysql.sock is located.

Database name: horde


charset: iso-8859-1

Then click on “Generate Horde configuration” at the bottem of the page.

Then go to “Preference System” and at “What preferences driver should we use?” select “SQL Database”.

Name of the preference table: horde_prefs

Then click on “Generate Horde configuration” at the bottem of the page.

Go to “Mailer” and set:

What method should we use for sending mail?: Use SMTP server

The server to connect to [localhost]: localhost

The port to connect to [25]: 25

The local hostname / domain [localhost]: localhost

SMTP authentication: No authentication

You can leave "The username to use for SMTP auth" and "The password to use for SMTP auth" empty!

Then click on “Generate Horde configuration” at the bottem of the page.

Then go to “Problem Reporting” and change the e-mailadresse ([email protected]?).

Then click on “Generate Horde configuration” at the bottem of the page.
Then go to “Authentication” and make sure it’s the same as following:

Which users should be treated as administrators (root, super-user) by Horde?: admin

Should we always store and validate the IP address of the client (as seen by the web server) in the session? Doing so will help increase security by ensuring that an attacker from another host can not try to hijack the session: YES (selected)

What backend should we use for authenticating users to Horde?: Let a Horde application handle authentication.

The application which is providing authentication: imp

Then click on “Generate Horde configuration” at the bottem of the page.

Go back to your SSH session and type:

# cd /var/www/html/horde
# chown root:apache config/*
# chmod 0440 config/*
# cd ../imp/
# chown root:apache config/*
# chmod 0440 config/*
# chmod 000 /var/www/html/horde/scripts/sql/create.mysql.sql

That’s all!

Horde is now succesfully installed on your DirectAdmin server, if you wish you can download modified skins (default, enhanced and power_user). After installing the modified skins Horde will be completly integrated with DirectAdmin.

If anything is not completely clear: please let me know.
Any suggestions and/or comments are welcome also :).

Modified skins download link: <deleted>
 
Last edited:
Wow! All Praise Wouter! I've been wanting this for a long long time. Do you have any idea if there would be a problem installing this on FreeBSD 4.10?

I can't wait to try this. But I will await the advice about 4.10. I know the some things were changes in 5.3 but they were'nt mail related... were they??:D

cheers and thanks!
 
motobrandt said:
Wow! All Praise Wouter! I've been wanting this for a long long time. Do you have any idea if there would be a problem installing this on FreeBSD 4.10?

I can't wait to try this. But I will await the advice about 4.10. I know the some things were changes in 5.3 but they were'nt mail related... were they??:D

cheers and thanks!

Hello motobrandt, I don't expect any problems on FreeBSD 4.x, but I can't guarantee you this, because I didn't test it (all our 4.x boxes are on cPanel :(). If it's not working it won't let your mailserver crash or anything. All services should just work like before :).

Let me know if u have any problems or comments, and also if it's succesfully on FreeBSD 4.x :). Thanks!

--------------------------------------------------
Updated the howto on 1 july with some shorter commands :).

I also found a "bug" in the modified "enhanced" skin, the link at the top of the page to Webmail/Horde is on some pages linking to /squirrelmail. I will fix this in the coming days and post an update.

UPDATE: Fixed :)
 
Last edited:
Hi,

I did not have any major problems with installation on freebsd 4.11.

- Kamil
 
kamsel said:
Hi,

I did not have any major problems with installation on freebsd 4.11.

- Kamil
Did you have any minor problems that you'd like to elaborate on?:D
 
Motobrandt,

The best way is to read error messages - they are quite useful :D

I only recall having problems with ports, but command 'make reinstall' will do all.

- Kamil


p.s
Wouter, thank you for this great howto!
 
Error

I hade this problem at step 4.. lol

#make bsf

(truncated output)
echo -DMD5ENABLE=\"/etc/cram-md5.pwd\" >> OSCFLAGS
ln -s os_bsf.h osdep.h
ln -s os_bsf.c osdepbas.c
ln -s log_std.c osdeplog.c
ln -s sig_psx.c siglocal.c
ln -s crx_nfs.c crexcl.c
ln -s ip4_unix.c ip_unix.c
ln: ip_unix.c: File exists
*** Error code 1

Stop in /usr/local/imap-2004e/c-client.
*** Error code 1

Stop in /usr/local/imap-2004e/c-client.
*** Error code 1

Stop in /usr/local/imap-2004e.
*** Error code 1

Stop in /usr/local/imap-2004e.


Any Ideas?
 
Hmm, maybe you have to use make bsi on FreeBSD 4.x, but i'm not sure. Maybe kamsel can tell what he used (make bsf or make bsi)?
 
I skimmed over the guide and noticed this.


Search for:

extension_dir = "./"

And replace with:

extension_dir = "/usr/local/lib/php/20020429/"


would this break current php extensions?
 
Wouter said:
Hmm, maybe you have to use make bsi on FreeBSD 4.x, but i'm not sure. Maybe kamsel can tell what he used (make bsf or make bsi)?

make bsf worked for me
 
Chrysalis said:
I skimmed over the guide and noticed this.


Search for:

extension_dir = "./"

And replace with:

extension_dir = "/usr/local/lib/php/20020429/"


would this break current php extensions?

Not at my installation. All current extensions are still working after I changed that.

kamsel said:
make bsf worked for me

Okay, than I don't know what's your problem motobrandt.
Maybe you can try to restart at the beginning of the howto (maybe you forgot some steps?)...

@ALL:

I have updated the modified skins. The webmail link at the top of the enhanced skin is now always going to /horde. In the old version on some pages it was going to /horde and on some to /squirrelmail.
 
Last edited:
Congratulations for the Howto!
A couple of thoughts:

The c-client is in ports, so why not use that one? No need to explicitely add the path to the php configuration, it should be able to find it.

You should use either mime-magic or fileinfo, not both.

I'd suggest that you change:
'hordeauth' => false,
to this
'hordeauth' => full,
in order to avoid problems with conflicting settings.

Chrysalis,
The change of the extension path is required for php to find fileinfo (I've tried many different paths and all failed except that one), it usually doesn't break anything.

Also, mcal is not really necessary, you can use mysql as a backend for Calendar events. It's easier to backup/restore.
 
Oliver,

I'll try ports for c-client.

could you softlink fileinfo from the current path so you wouldn't have to change the path, risking breaking something that already works?

*crosses fingers*
 
soflinking should work, but the funny thing is that extensions like eaccelerator go into that folder, so it must be the right one for every extension.
 
interfasys said:
Congratulations for the Howto!
A couple of thoughts:

First of all: Thanks for you comment. :)

interfasys said:
The c-client is in ports, so why not use that one? No need to explicitely add the path to the php configuration, it should be able to find it.

I didn't test c-client from the ports, if it works you can use that also. Maybe someone that tested this from ports can let us know if it's working?

interfasys said:
You should use either mime-magic or fileinfo, not both.

Is it a problem if both are installed? I know for future now that I only need one, but do you think it is a problem if I let both on the systems I already installed?

interfasys said:
I'd suggest that you change:
'hordeauth' => false,
to this
'hordeauth' => full,
in order to avoid problems with conflicting settings.

Hmmm, why should it conflict you think?
 
From the doc:
e. MIME Magic support [...]
NOTE: This extension is reported to be deprecated_ in favor of the
fileinfo PECL extension (see below). [...]Pick one or the other - there is no need to compile both.

The c-client from ports works well for us.

About hordeauth, check the pref_uid column of the horde_prefs table. If it's the full email address of the user then there should be no problem, otherwise you'll get conflicts.
 
interfasys said:
From the doc:


The c-client from ports works well for us.

About hordeauth, check the pref_uid column of the horde_prefs table. If it's the full email address of the user then there should be no problem, otherwise you'll get conflicts.

Updated the Howto with your tips. Thanks :).

Only I didn't update the hordeauth-setting in the howto. I have tried this and when I go to horde then I get PHP-errors:

Notice: Use of undefined constant full - assumed 'full' in /var/www/html/horde/imp/config/servers.php on line 202

Any ideas?
 
I copied/pasted from your line, but you're right, the correct syntax is:
'hordeauth' => 'full',

Ideas from improvements:
-Find a way to make Ingo use the user's filters.
-Find a way to make IMP use the user's spamassassin settings, whitelist, etc.
 
interfasys said:
I copied/pasted from your line, but you're right, the correct syntax is:
'hordeauth' => 'full',

That's working :). Thanks, added to the howto.

interfasys said:
Ideas from improvements:
-Find a way to make Ingo use the user's filters.
-Find a way to make IMP use the user's spamassassin settings, whitelist, etc.

I will take a look at that when I have time too much :D. Or maybe someone else have time for this? ;)

@All:

I found out Horde is not working for the fully 100% on PHP 4.4.0. So do not upgrade at this moment if u want to use Horde :(.
 
Back
Top