head	1.1;
access;
symbols
	STABLE_1_2:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	99.08.25.03.33.50;	author rkrusty;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	99.08.25.03.33.50;	author rkrusty;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	99.08.25.04.27.31;	author rkrusty;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	99.08.25.04.48.54;	author rkrusty;	state dead;
branches;
next	;


desc
@@


1.1
log
@file DATABASE was initially added on branch STABLE_1_2.
@
text
@@


1.1.2.1
log
@[IEM] Documentation sweep for horde

    1> Walked through HELP/INSTALL/README redoing installation instructions
       where needed.
    2> Migrated the IMP DATABASE file into the HORDE tree making changes
       where necessary.  (will remove database pieces out of INSTALL
       soon enough.
    3> updated more debian junk
@
text
@a0 230
HORDE Database Installation Guide
Copyright 1999 Ivan E. Moore II <rkrusty@@tdyc.com>
Copyright 1999 Mike Hardy <mikeh@@spark.com>

This code is licensed under the GNU Public License.
See the file COPYING in this directory.

Last Updated: 8/25/99 [IEM]

--------------------
Purpose of this file
--------------------

What this file will hopefully do for you is make setting up
your database for use with HORDE much easier.  The goal
is not to help you setup your database for general use, just
how to setup the tables and users for HORDE.


----------------------
Requirements for HORDE
----------------------

Horde uses PHPLib to handle it's database management.  If 
PHPLib supports your database of choice most likely it will
work with HORDE.  Currently we know for sure that HORDE works
with:

   MySql
   PostgreSql
   Oracle
   Sybase
   Informix

MySql was the original database supported by HORDE and should at all
times (most likely) work for sure.  PostgreSql I can verify works
like a champ.  The others are more recent additions or those that
have less support currently.  For this reason (and the reason
that I cannot verify personally that they work or have ever
configured them) they won't be mentioned much in this file.
No one using Informix has contacted us for a while, but Oracle and 
Sybase are both currently used and should work.

You will need to have your database preconfigured and working
on your system before you even get to this stage.  For help
with this please consult your database specific help files.


--------------------------
Methods of Installation
--------------------------

There are 2 basic methods for configuring your database. The
first is manually doing it yourself. This is the method
that will make sure that things are setup as you can see 
step by step that things are being configured properly.

The other method is to use one of the scripts that have been
created to automatically configure your database.  These
scripts should work but there are times when things may not
work the way they are supposed to.  Also, when using scripts
you need to be aware that they may not be setup exactly
for your system so you need to verify them to make sure things
are correct for your particular install before using them.


=-=-=-=-=-=-=-=-=
MANUAL INSTALL:
=-=-=-=-=-=-=-=-=

For the 1.2.x version of HORDE you will need to install the 
PHPLib session tables.  We have included the create scripts for
Postgresql and MySql.  You can find them in config/scripts.
If you are using a different type of database, please check your
PHPLib distribution for the proper creation scripts.  

Your database name needs to be 'horde'.  Insert the PHPLib 
session tables into your newly created 'horde' database.  If you
look through the creation scripts, you'll notice there are tables
for auth_user and auth_user_md5.  We are currently not using these
tables but are slowing working them in so it's a good idea to
insert them as well. 

Here is a breakdown of the tables and their elements:

Table 1:

   active_sessions (
      sid varchar(32) DEFAULT '',
      name varchar(32) DEFAULT '',
      val text,
      changed varchar(14) DEFAULT '' NOT NULL,
      PRIMARY KEY (sid,name)
   )

   auth_user (
      uid varchar(32) PRIMARY KEY,
      username varchar(32) DEFAULT '' NOT NULL,
      password varchar(32) DEFAULT '' NOT NULL,
      perms varchar(255)
   )

   auth_user_md5 (
       uid varchar(32) PRIMARY KEY,
       username varchar(32) DEFAULT '' NOT NULL,
       password varchar(32) DEFAULT '' NOT NULL,
       perms varchar(255)
   )
   


I kind of broke them down as they would go into the database...ie, the
name then what it is...(example:  val is a text field).

The database name itself needs to be "horde" and needs to be created.

Next you'll need to create a user or give a user access to this
database.  This user will need pretty much full control over this
database.  The username we use for the most part is hordemgr.
Here are a few configuration tips for MySql and PostGreSql:

MYSQL:

INSERT INTO user ( host, user, password )
   VALUES (
      'localhost',
      'hordemgr',
      password( 'hordemgr' )
      );

INSERT INTO db (
      host, db, user,
         Select_priv, Insert_priv, Update_priv, Delete_priv,
         Create_priv, Drop_priv )
      VALUES (
      'localhost',
      'horde',
      'hordemgr',
      'Y', 'Y', 'Y', 'Y',
      'Y', 'Y'
        );

This will setup a user called hordemgr with a password of 'hordemgr' and
give them access to the horde database.

POSTGRESQL:

insert into pg_shadow (usename, usesysid, usecreatedb, usetrace, usesuper, \
       usecatupd, passwd) values ('hordemgr', '33', 't', 't', 't', 't', \
       'hordemgr') ;

   This will create a postgres user called hordemgr who will be connecting
to the database as the user who's userid is 33 (on Debian, apache is ran
as user www-data which uses the userid of 33, this will be nobody on other
systems.).  This user also has the password of 'hordemgr'.

GRANT SELECT, INSERT, UPDATE ON active_sessions, auth_user, auth_user_md5 TO hordemgr;

  This will give the user hordemgr access to these tables (active_sessions, 
etc...).  

Also, you need to make sure you allow TCP connections into your 
database.  PostgreSql has a switch in one of it's configuration files
(postmaster.init on Debian) that needs to be set to yes:

PGALLOWTCPIP=yes

Without this set to yes HORDE won't be able to talk to your database and
you'll get tons of errors. :)

That's about it.  You need to restart your database just to make sure
everything starts up the way it should.

=-=-=-=-=-=-=-=-=
SCRIPTED INSTALL:
=-=-=-=-=-=-=-=-=

(NOTE: Scripts are located in horde/config/scripts)

The easier way of configuring your database is to use one of the
scripts that have been made available to you.  Here is a breakdown
of how to use each script.

MySql:

MySql's script is called mysql_create.sql.  The method you would call
it is by first logging into an account that has full access to the
database or by using a switch to call that user.  I'll show both
methods.

Before using any of these scripts, please look over them to make
sure that any system specific settings (or personal choices) are
set to your desired settings...ie usernames, etc...

MySql: 

 su - root

   mysql < mysql_create.sql
     or
   mysql -password=rootspasswordformysql < mysql_create.sql

 or (without changing to root)

   mysql -user=username < mysql_create.sql
     or
   mysql -user=username -password=rootspasswordformysql < mysql_create.sql


That's it..restart MySql and try it out

PostgreSql:

  su - postgres  (or whoever your database runs as..usually postgres)

  psql template1 < pgsql_create.sql

That's it, restart PostgreSql and try it out.

=-=-=-=
Notes:
=-=-=-=

     This is by far no complete HOWTO.  This is just a compiled list
of what people have contributed so far.  Some of this is from my
personal experience (MySql and PostgreSql).  If you have tips, ideas,
suggestions or anything else that you think could help others in
setting up their database for use with HORDE please let me know and
I'll include them.  (or contribute to HORDE yourself and change this
file on your own!)
@


1.1.2.2
log
@[IEM] Taking care of mysql from hell thread or whatever it was called.

Basically verified the installation instructions for MySql.  Added what
was missing.
@
text
@a145 23
*** NOTES ***

Use the scripts provided in horde/config/scripts.  They will make your
life alot happier.

After either using the scripts (read the top of them for instructions)
or manually doing it: ( 
       mysql> create database horde
       mysql> insert into user (host, user, password) values ('localhost', 'horde', password('hordemgr'));
       mysql> insert into db values ('localhost', 'horde', 'horde', 'y', 'y', 'y', 'y', 'y', 'y');
       mysql> quit
    )

After setting up your tables in MySql you need to run this command:

     mysqladmin -u root -p reload

It is always a good idea to stop and restart your mysql process as well.



=-=-=-=

@


1.1.2.3
log
@[IEM] migrating all core documentaiton (except readme and copying) into
the docs/ sub directory
@
text
@@


