Installation Information For RIP
********************************

Prerequisites:
==============

These prerequisites are essential for the installation of RIP software.
Please make sure that they are fulfilled before going on with the
installation procedure.

You need to have the following software installed into your system (the
version that we use is in brackets):
	- gcc (2.95.2), or the ucbcc compiler from Solaris Workshop (5.0)
	- glib (1.2.7)
	- MySQL Server + Client libraries (3.22.29)
	- PERL (5.005_03)
	- If you want to regenerate the defs, you also need java (1.1.7)
	  and an XML parser.

We are running the software on a SPARC with Solaris 2.7 installed.


Installation Procedure:
=======================

To run the database you need to perform the following steps:

0. Download the reimplementation software release and unpack it.
   If you are reading this file, you probably have already done this.:-)
1. Compile the code.
   Please check the "Prerequisites"; you will not be able to compile
   the code if these are not fulfilled.
   Some variables are hardcoded in this version of update module, so you
   must have a look in the modules/up/dbupdate.h file and change 
   the appropriate #defines.
   Then you should issue "make" in the root directory of the tree.
   This will automatically compile whois_rip, loader and dbupdate.
2. Download a database snapshot containing all the split object files 
   and the current serial number.
   You can find the split object files under
	ftp://ftp.ripe.net/ripe/dbase/split
   And the current serial number is available at
	ftp://ftp.ripe.net/ripe/dbase/RIPE.CURRENTSERIAL
3. Create the databases.
4. Load the databases.
5. Run whois_rip .
6. Run dbupdate.

Steps 3,4,5,6 are explained in detail below.


Preparing the Database and Running the Server:
==============================================

INTRODUCTION
------------

The service relies on the following databases:
- main database containing object tables, and
- administrative database currently containing access control table.

In the text below the term 'database' will reference the main database.

CONFIGURATION VARIABLES
-----------------------

The database creation and loading process is controlled by the script 
bin/load/make_db. Before starting the script, you need to edit it 
in order to change several variables according to your site configuration.

The variables to change are:

MYSQL      - location of your MySQL client.
HOST       - name of the host where the database resides.
USER       - user name needed to access the database.
PASSWORD   - password needed to access the database.
DB         - name of the database.
OBJDIR     - location of your object files from the snapshot.
PROPERTIES - name of configuration file for whois_rip (see details below).

You also need to define several variables in whois_rip configuration file
referenced by PROPERTIES variable. To run query server and NRTM client you
need to define the following:

SV.whois_port=43      - port to answer whois queries
SV.config_port=43333  - port for configuration

DB.user=user1         - user name needed to access the database (same as $USER)
DB.password=mypswd    - password needed to access the database (same as $PASSWORD)
DB.host=dbhost.db.net - name of the host where the database resides (same as $HOST)
DB.database=RIPE      - name of the database (same as $DB)


# Value of the bits:
# 0 [1] dummy creation is allowed [0] not allowed
# 1 [1] update mode               [0] NRTM client mode
# 2 [1] standalone                [0] part of a server
#
UD.update_mode=7           - should be 7 for initial loading 



The following section is not needed for initial loading, but is used in NRTM
client mode.

MI.nrtm_host=nrtm.host.net - name of the NRTM server
MI.nrtm_port=43            - mirroring port of the server
MI.nrtm_logfile=nrtm.log   - name of the log
MI.nrtm_delay=1000         - delay between successive attempts to download serials


We have included a template for the PROPERTIES file in the distribution.
It is called PROPERTIES.example .


DATABASE CREATION AND LOADING
-----------------------------

As soon as this is done you may start bin/load/make_db script, 
which will perform the following operations:

- create main ($DB) and administrative (RIPADMIN) databases;
- load the database (I and II passes);
- create the necessary indexes.

After the script finishes look at the log files for errors.

Please note that loading the database might take a fair amount of time,
even several days. The more powerful your machine is, the less it will take
to do this task.


STARTING THE SERVICE
--------------------

The name of the RIP main server is bin/rip/whois_rip. 

To start the service:

$ cd bin/rip/
$ ./whois_rip <config_file_name>

where <config_file_name> points to a configuration file similar to one we used
for database loading. 

There is a wrapper called simply "rip" which changes some configurations
depending on the architecture, and restarts whois_rip whenever it dies.
To use it, simply type:

$ ./rip <config_file_name>

Depending on the desired operation mode you need to define 
the UD.update_mode variable.

Its most common values are:
7 - when you want to launch query and update mode, allowing dummy objects[*]
1 - when you want to launch query and NRTM client mode, allowing dummy objects[*]

_______________
[*] Dummy objects are temporary objects in the database created to maintain
referential integrity of the database when some object references a
non-existent other object. For example, while creating a domain object, a dummy
person object will be created for admin-c attribute if it references a
non-existent NIC handle. You may want to use this feature when loading
inconsistent data. When dummy creation is disabled you will get referential
integrity error when attempting to create inconsistent objects.

RUNNING DBUPDATE
----------------

bin/dbupdate program is used to create/delete/update objects. It accepts
three flags: -f, -M and -t. If you specify a file name with -f, dbupdate
reads the objects from that file, otherwise it reads the standard input.
You should specify -M flag if the file to be read is an e-mail message.
-t flag can be used to trace the program, it is there for debugging purposes.

One problem with the dbupdate program is that it contains a lot of hardcoded
variables in this version. Thus, you must have a look at modules/up/dbupdate.h
file and change #defines according to your system configuration.


