Installing Horde with Virtualmin on Centos 5.x

Tags:

CentOS specific instructions found here; Also see the general Horde install document. Tested on CentOS 5.1, 5.2, 5.3.

CentOS + Virtualmin Walk-through Tutorial

With Centos 5.x and a Webmin/Virtualmin installation you'll do things this way:

# yum install horde imp

to install both the Horde general module and the Imp email IMAP gateway. Next, run the database generation script, usually like this:

# cd /usr/share/horde/scripts/sql/
# mysql -u root -p < create.mysql.sql

You'll need to use the MySQL root password. Then, in your database administration screen for MySQL, set the password for the new MySQL user "horde" to something nicely random and hard to guess; keep a momentary record as you'll need it below.

Make a copy of the default configuration, which is set to log everyone in as Horde Administrator without a password. You'll need this if you box yourself in, in the configuration later.

# cd /usr/share/horde/config
cp -a conf.php conf.php.everyone-as-admin

Later on you can always blitz a broken configuration by recopying the "everyone-as-admin" script right over the conf.php.

Redirection of domain URLs to the horde system is set in Apache's /etc/httpd/conf.d/horde.conf

#
# Horde is a web application framework written in PHP.
#

Alias /horde /usr/share/horde

which means that www.mydomain.com/horde [the first argument] is mapped to the default page [index.php] in the actual filesystem's /usr/share/horde directory. (You may have to refresh the Apache configuration if that file changes.)

Then you can direct your web browser to: http://my-domain.com/horde and fill in the Administration screens. Choose MySQL as the database. The user is "horde" and the password is the one you set above.

For authentication method, choose "Let a Horde application handle" and then select Imp as that application. You could pick IMAP authentication but then your users will have to login twice (they will see "Log in to mail" before they can get to their email).

When you click the Generate Horde Configuration button, you'll get the text of your new conf.php ... Unless you've set the 'apache' group to have write permission on the conf.php file, you'll have to select the new configuration text displayed, and paste it into the conf.php ... or use the command:

# cd /usr/share/horde/config
# cat > conf.php

and then paste (possibly with Shift+Insert) the copied text, pressing Ctrl+D (end-of-file) to return to a prompt.

You should then be able to logout of the Horde administration page and log back in normally as a user.

If things aren't working, check the logs. A few places to look:

/var/log/messages
/home/username/logs/error_log   (for Virtualmin setup with "username")

If you get messages about "can't include" then check permissions on the file noted; most of the php scripts should belong to group 'apache' and have group read permissions.

Another useful step is to add yourself as an administrator. If you didn't do that on the initial setup screens, you can edit conf.php and modify the appropriate line to look like:

 $conf['auth']['admins'] = array('Administrator'<strong>,'myusername'</strong>);

Note that you will have to manually edit the Imp mail-server configuration file:

/usr/share/horde/imp/config/servers.php

by adding, for example, the localhost with IMAP protocol:

'server' => 'localhost'
'protocol' => 'imap/notls'
'port' => '143'

The Turba Contact Manager

You might also want to install the Turba contact manager. You can install a version found on the Turba download page or, to be sure you have a version matching your Horde install, just do:

# yum install turba

and then following the remainder of the "Configuration" instructions in the Turba documentation ... note that in our configuration the package is in /usr/share/horde/turba ... you will probably want to use the 'horde' SQL database and the SQL username 'horde' as above, keeping all the Horde data together. Consult /usr/share/horde/config/conf.php and look for the lines like these for the values you set above:

$conf['sql']['username'] = 'horde';
$conf['sql']['database'] = 'horde';

And then you'll run the configuration script as:

$ mysql -u root -p horde < turba_objects.mysql.sql

and then go thru the Horde admin screens, setup the Turba parameters, and write the configuration file which in our example will be at /usr/share/horde/turba/config/conf.php.

If you don't see Turba (shown as main heading: Organizing) in the Horde menus, edit the main Horde configuration file (/usr/share/horde/config/conf.php in our case) and update the appropriate line to be:

$conf['menu']['apps'] = array('horde', 'imp', 'turba');