INSTALLATION
------------

Lndbase is tested on a i386 with Linux and glibc.

If you have such a system just type ``make''.
Hopefully an executable ``lndbase'' should be created.

If you have a different OS/arch or any problems read the file ``HELP''.


The remaining steps:

	- Place the executable in the PATH (/usr/bin or similar)

	- Create a directory '.lndbase' in your home directory. This will
	  be used to save the datafiles, keep temporary information, etc..


If that's the first time you're running lndbase here's how.

	- It is possible to run it with ``lndbase -s -C''
	  This way isn't much fun since you'll be talking directly
	  to the server. It is better to use lnsh....
	  The option '-s' sais that it will be in single user mode
	  and the option '-C' that there is no data to load but a brand
	  new database is created.

	- The file 'Doc/Running' documents all about running lndbase.



That's all.
Below are advanced compilation options.

Advanced
--------

- Authentication.

  Lndbase can be a network server and provide services to many clients (like
  ftp, http, ...). In this case authentication may be desired to allow only
  privileged users to modify the data (the lndbase command `sue').
  Two authentication mechanisms are supported.

   1) Simple authorization. This is the default and it's the same as telnet
      and ftp use. It is not secure if the communication channel is not
      secure.

   2) MD5 Digest authorization. This one is much like the HTTP Digest
      authentication shceme. To enable this, edit the auth/Makefile,
      locate the string ``simple_auth'' and change it to ``digest_auth''.
      In order to compile, you must get the files ``md5.c'' and ``md5.h''
      from the glibc-2.0 source and place them in the auth/ directory;
      If you have a CD with sources of your system's packages they can
      be found there. Else get them from a friend or from the WWW.

      Then type ``make clean; make''

      More about digest authentication is found at auth/README.digest

- Configuration.

  The file kernel/config.h has most of compilation defines.

  AUTO_CISTR and MSS:
	If AUTO_CISTR is defined (by default it is), lndbase will
	automatically register all new elements of size less than MSS
	bytes and containing printable characters to the cistr PMT.
	In other words, those elements can be located with a case
	insensitive search with the ``find'' lndbase command.

  BIG_ELEMENT:
	Data elements with size greater or equal to BIG_ELEMENT are not
	loaded to memory but they exist in temporary files.

  ELEMENT_HASH:
	The hash table size. Make it smaller to use less memory.
	Make it bigger if you have more than 50,000 elements and you really
	want optimum performance. It's good to be in powers of 2 (2048,
	4096).

  CWT:
	Lndbase uses a copy-on-write (kinda:) technique. Elements with size
	less than CWT are loaded to memory at initialization.
	Elements greater than CWT are loaded from the datafile each time
	their content is needed.
	If new data is inserted, if it's greater than CWT and less than
	BIG_ELEMENT it's loaded in memory.

	For optimum performance make this big (or equal to BIG_ELEMENT).
	This parameter is the default value, by the command line option
	'-th' this threshold can be adjusted.

  MRC:
	Maximum number of clients that can at the same time 'access' lndbase
	kernel for readonly actions.
	More clients can be 'connected' but some may block on MRC.

  CLIENT_TIMEOUT:
	The client timeout in milliseconds. This timeout is not about how
	long a client is idle, a client can be idle forever.
	It's about when we're expecting content from a client. If the client
	times out while we're expecting some content the client is
	disconnected and the thread dies.

  BUG_TRAP:
	Compiles lots of assertions to catch bugs. Those won't save us from
	bugs, they will just inform us where the bug is.

  USE_SFMALLOC:
	sfmalloc is a wrapper to malloc for allocating lots of small
	fixed-size structures. Normally its good to use it, on the other
	hand it increases the possibility of the existance of serious bugs.

 The rest are easy.
