Table of Contents:
The horde project is an umbrella project that supports a lot of Web Hosted services using the Server Scripting powers of PHP. Prior to PHP 4 maintaining state between different sessions of the user / client communications used a series of PHP libraries coined "PHPLib."
In other words, if you've installed PHP4 then you do not need to read this guide. If you need to use php3 you may need to read this guide.
This Guide introduces you to the installation of Horde and PHPLib as distributed as a combined tar ball from http://www.horde.org.
Source File: horde-1.2.0-pre13.tar.gz (available from
http://www.horde.org)
[ref: horde-1.2.0-pre13/docs/INSTALL]
[ref: http://faq.horde.org]
Untar the source files and copy the files from the php directory into a directory that will be used by the server. (Note: This directory does not need to live under your web server's document root, so it's probably safer to put it somewhere outside the reaches of lurking web clients.[horde/doc/PHPLIB)
# cd /usr/src
# tar -zxf /[path-to-file]/horde-1.2.0-pre13.tar.gz
# mv horde-1.2.0-pre13 /var/www/horde
[ref: /var/www/horde/phplib/README]
[ref: /var/www/horde/scripts/database/MYSQL]
Horde is essentially installed and we now need to configure the settings of horde and PHPLib
1. Edit the /var/www/conf/php3.ini file (php.ini in PHP 4) to have the following modifications:
include_path = '.:/var/www/horde/phplib'
auto_prepend_file = /var/www/horde/phplib/prepend.php3
track_vars = on
magic_quotes_gpc = off
2. Edit the File: /var/www/horde/phplib/local.inc
Uncomment the references to SQL functions (this should include class HordeDB extends DB_Sql, function halt($msg), and class HordeCT extends CT_Sql. We make these changes since we have the MySQL database running and will use that server for database use.
The appropriate sections in local.inc should look like the below.
/* To use an SQL database, uncomment and edit the following: */
class HordeDB extends DB_Sql {
var $Host = 'localhost';
var $Database = 'horde';
var $User = 'horde';
var $Password = 'hordemgr';
var $Port = '';
function halt($msg) {
printf("Database error (HordeDB): %s\n", $msg);
}
}
class HordeCT extends CT_Sql {
var $database_class = 'HordeDB'; // Which database class to use...
var $database_table = 'active_sessions'; // and find our data in this table.
}
|
3. Edit the /var/www/horde/phplib/prepend.php3 file to specify the location of the 'libdir'
# The line that reads as # $_PHPLIB["libdir"] = "";
# should be changed to something like the below
$_PHPLIB["libdir"] = "/var/www/horde/phplib/";
4. Configure MySQL with the database that we will use with horde. This may require starting MySQL if we have not yet started it, and using the script provided with the horde distribution to create the database.
# /usr/local/bin/safe_mysqld --user=mysql --log &
# cd /var/www/horde/scripts/database
# /usr/local/bin/mysql -u root -p < mysql_create.sql
5. Now that we have the MySQL tables set up, we can configure /var/www/horde/phplib/local.inc to contain the user/password we will use for MySQL. Note that this information is derived from the mysql_create.sql script.
var $Host = 'localhost';
var $Database = 'horde';
var $User = 'hordemgr';
var $Password = 'hordemgr';
var $Port = '';
Security Note: Since the user/password combination is well known we will need to change the password. For extra security you may want to change the database and user which will require you hand-tuning a number of other php scripts. [ref IMP Security]
To finalise configuration, we modify the apache configuration file.
Edit the file /var/www/conf/httpd.conf to include new settings for horde
Alias /horde/ "/var/www/horde/"
<Directory "/var/www/horde">
Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
</Directory>
Force apache to re-read its configuration file
We can now test whether our horde and database access is working correctly by going to the url http://localhost/horde/test.php3
# lynx http://localhost/horde/test.php3
[ lynx displays the following ...]
View phpinfo() screen
PHP Version
* PHP Version: 3.0.16
* PHP Major Version: 3
* PHP Minor Version: 16
* Your PHP3 version is recent. You should not have any problems with
Horde modules, provided that you have applied the patch(es)
described in horde/docs/INSTALL.
PHP Module Capabilities
* IMAP Support: Yes
* LDAP Support: No
* MySQL Support: Yes
* PostgreSQL Support: No
[ ... more stuff cut out ... ]
If the above output shows then php is installed and functioning correctly.
Using the same php script ../horde/test.php3 we can test the PHPLib installation by selecting the "Click here to test PHPLIB for Horde". Selecting the link with lynx will ask for confirmation of cookies (choose YES/All to accept the cookies.) Reload the page displayed below to see the line "Per Session Data: 1" increment.
[ lynx displays the following ...]
Reload this page to see the counters increment.
Go back to the test.php3 page.
View the output of phpinfo().
Per Session Data: 1
If this page works correctly, then you have a correctly configured
HordeSession class. You should be done with PHPLIB setup.
If everything has worked well we now have a functioning installation of horde and PHPLib.
Copyright (c) 2000/1/2 Samiuela LV Taufa. All Rights Reserved.
I reserve the right to be totally incorrect even at the best advice of betters. In other words, I'm probably wrong in enough places for you to call me an idiot, but don't 'cause you'll hurt my sensibilities, just tell me where I went wrong and I'll try again.
You are permitted and encouraged to use this guide for fun or for profit as you see fit. If you republish this work in what-ever form, it would be nice (though not enforceable) to be credited.
|
Horde and PHPLib - The foundations for Web based Services |
Copyright © 2000/1/2 NoMoa Publishers All rights reserved. Caveat Emptor