Wouter
Verified User
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:
And change the standard password (horde).
# cat /usr/local/directadmin/scripts/setup.txt
Search for “adminpass” and keep it in mind
.
# 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:
And replace with:
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>
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

# 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: