UdmSearch Installation notes
============================

Requirements
============

Note that you must have MySQL-3.22.xx installed before installing UdmSearch.
You can find MySQL at http://www.mysql.com/
You also must have privileges to create new MySQL database 
or to write in already exist one.


Operating systems
=================

We use GNU Autoconf so it is possible to port UdmSearch to all modern
systems with a C compiler. We develop the software on FreeBSD 3.1 and
Linux 2.2

We hope UdmSearch should work on other Unix platforms as well. Please report
sucessful platforms to devel@search.udm.net

Currently known systems UdmSearch has been sucessfully compiled and work on

    * FreeBSD 2.2.5
    * FreeBSD 3.x
    * Linux 2.2


Layouts
=======

By default, the UdmSearch is installed in '/usr/local/UdmSearch',
in the following subdirectories:

Directory            Contents
bin                  search.cgi, search.php3
etc                  indexer.conf-dist, other *.conf samples
man                  indexer.1, indexer.conf.5
sbin                 indexer


Installing UdmSearch
--------------------

You need the following tools to build and install UdmSearch from source:

   * GNU 'gunzip' to uncompress the distribution.

   * A reasonable 'tar' to unpack the distribution. GNU 'tar' is known
     to work.

   * A working ANSI C compiler. GNU 'gcc' is known to work.

   * A good 'Make' program.  GNU 'make' is always recommended and is
     sometimes required.


1. Unpack the distribution and change dir into the top-level directory 
of the unpacked distribution.

2. Create mysql database 'udmsearch':

You can also use currently exist MySQL database,
skip this step in this case.

	shell>mysqladmin create udmsearch

3. Change dir to 'create' directory of the distribution and create 
tables structure.

(IMPORTANT: If you already use UdmSearch and want to upgrade from 
UdmSearch-1.9 or earlier with keeping data safe, please use 
ONLY alter19-20.txt script to fix database structure:
	shell>mysql udmsearch < alter19-20.txt
)

If you are install UdmSearch first time:
	shell>mysql udmsearch < create.txt

then if you want you language(s) stop-list support:
	shell>mysql udmsearch <stop.yourlang(s).txt

Stop-list is a list of common words (such as 'am','he','does' etc) 
that are often present in all documents and should not be stored
in database.

Now english (stop.en.txt) and russian (stop.ru.txt) are 
available. Please send stop-lists for other different languages to
devel@search.udm.net

4. Change dir to 'include'. Edit search.h to set proper MYSQL_HOST,
MYSQL_DB, MYSQL_USER, MYSQL_PASS definitions.

CGI-program (search.cgi) will use these definitions to connect to database. 
Edit also GMT_OFFSET to define correctly your offset from GMT time zone.


5. Change directory to top-level of unpacked distribution

UdmSearch will be installed into /usr/local/UdmSearch by default.
If you have not permitions or want install it to another location,
please use configure with --prefix option. You can see all available 
options with ./configure --help

	shell>./configure
	shell>make
	shell>make install

If you have problems with configure or make,
see section 'Installation problems'



6. Change dir to '/usr/local/UdmSearch/etc' (or to 'etc' directory
where UdmSearch has been installed to).

 Copy indexer.conf-dist to indexer.conf and edit it.

7. Copy search.cgi to your web-server cgi-bin directory or make Apache alias
to UdmSearch bin directory. If you want to use php instead of search.cgi
edit the file search.php3 in UdmSearch bin directory to set proper mysql
variables: $db, $dbhost, $dbuser and $dbpasswd

There is also search.phtml for php/fi-2 available (no longer maintained)

8. Now it's time to start indexing. Change dir to 'sbin' directory of
UdmSearch installation and
	shell>./indexer

While indexer walks over you web server, you can already start
searching. Open search.cgi (or search.php3) in you browser.


Installation problems
---------------------

   * If you have problem with configure, there are some predefined
     Makefiles are available for different pratforms. 
     Check src/Makefiles/README.

   * Each time you run 'configure', you must run 'make' again to
     recompile.  However, you may want to remove old object files from
     previous builds first, since they were compiled using different
     configuration options.

To prevent old configuration information or object files from being
used, run these commands before rerunning 'configure':

     shell> rm config.cache
     shell> make clean

   * If your compile fails with errors, you must upgrade 
     your version of 'make' to GNU 'make'.
     The behavior of Solaris and FreeBSD 'make' is slightly different 
     from GNU 'make' version. If you have 'make'-related problems, 
     you should use GNU 'make' instead, often installed as 'gmake'.
     Use in step 3 after configure:

	shell>gmake
	shell>gmake install

     GNU 'make' version 3.77 is known to work.
