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)
		Get it at ftp://ftp.gnu.org/gnu/gcc/
	- GNU Make (3.78.1)
		Get it at ftp://ftp.gnu.org/gnu/make/
	- glib (1.2.7)
		Get it at ftp://ftp.gtk.org/pub/gtk/
	- MySQL Server + Client libraries (3.22.29)
		Get it at http://www.mysql.net/download.html
	- PERL (5.005_03)
		Get it at http://www.cpan.org/
	- If you want to regenerate the defs, you also need java (1.1.7)
	  and an XML parser.

We tested the software on SPARC/Solaris 2.6 and 7, and on Intel/Solaris 7 .


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.
      a. Please check the "Prerequisites"; you will not be able to compile
         the code if these are not fulfilled.
      b. Edit the file "Makefile.site.generic", or rename it as
         "Makefile.site.$HOSTNAME" where HOSTNAME=`hostname` on your host.
         This file contains some site-specific variables you should modify,
         namely GLIBCONF, MYSQLINC, MYSQLLIB. You can also choose your
         compiler and change the compiler flags if necessary.
      c. Some variables are hardcoded in this version of the update module, 
	 so you must have a look in the modules/up/dbupdate.h file and change 
         the appropriate #defines. See below "RUNNING DBUPDATE" for details.
      d. 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 have here two possibilities:
      a. You can download the example snapshot, containing
	 a few objects of all "old" types. This snapshot
	 is located at
	   ftp://ftp.ripe.net/ripe/dbase/reimp/objects.tar.gz
      b. If you are an authorized Near-Real-Time Mirror,
	 you can try to mirror the RIPE Database using this software.
   	 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
      c. If you are not a Near-Real-Time Mirror but want to
	 become one, please contact <ripe-dbm@ripe.net>.
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 if you are loading the whole RIPE Database, 
doing this 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 
the one we used for database loading. 

The environment variable LD_LIBRARY_PATH should be set to
"$GLIBLIB:$MYSQLLIB" (where $GLIBLIB and $MYSQLLIB are your
site-specific directories for Glib and MySQL libraries).

In the same directory, you can find a wrapper called "rip" 
which sets LD_LIBRARY_PATH and restarts whois_rip whenever it dies,
sending a mail to a predefined e-mail address upon restart.
To use it, modify the site-specific variables inside
the script, then 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
----------------

The "bin/dbupdate/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.
The -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.

These are the defines that must be changed:

#define UPDATE_HOST "whois.mydb.net" 	
	/* Host running whois_rip where to send updates */
#define UPDATE_PORT 43006 	 	
	/* Update port */

#define QUERY_HOST "whois.mydb.net"	
	/* Host running whois_rip to query for checks   */
	/* This is normally the same as UPDATE_HOST,    */
	/* but can be different (e.g. many query hosts) */
#define QUERY_PORT 43003 		
	/* Query port */

#define CRYPTEDPASSWD "4cadsw534/5ok"   
	/* The crypted override password */

#define ACK_FILE_PREFIX "ack"		
	/* Prefix for the acknowledgement files */

#define MAIL_CMD "/usr/lib/sendmail -fbit-bucket -t" 
	/* Mail command to mail acknowledgements */

#define HUMAN_MAILBOX "bit-bucket@ripe.net" 
	/* Sender of the acknowledgements. It must not be */
	/* the automatic update robot, otherwise 	  */
	/* you'll get a loop in case of bounces.          */
