# Installation

## SQL database requirements

Note that if you want to compile DataparkSearch with one of supported SQL database you must have this database already installed before installing DataparkSearch.

It is possible to use DataparkSearch with several SQL databases.

You also should have enough permission to create new database or to write into already existing one.

MySQL notes: If you want to build DataparkSearch with MySQL, 4.1 or later release required. libz library must be installed from `zlib-devel` RPM to successfully compile DataparkSearch with MySQL.

PostgreSQL notes: If you want to build DataparkSearch with PostgreSQL, 7.3.x or later release required. PostgreSQL 8.1 is recommended for better performance.

iODBC notes: iodbc-2.50.22a is known to work.

unixODBC notes: unixODBC-1.7 is known to work.

InterBase notes:

- Interbase 4.0 is known to work.

- InterBase CS 6.0 is known to work.

- FirebirdCS-0.9-4 is known to work.

FreeTDS notes: 0.52 version is known to work with MS SQL 7.0.

Oracle8 notes: 8.0.5.X is known to work.

Oracle8i notes: 8.1.6 R2 EE is known to work.

## Supported operating systems

We use GNU Autoconf so it is possible to compile and use DataparkSearch on almost every modern UNIX system with a C compiler without any modifications. We develop the software on FreeBSD 5.x using PostgreSQL 8.1.

Currently known systems where DataparkSearch has been successfully compiled and tested on are:

- CentOS 3.1, CentOS 3.3

- Debian GNU/Linux (i386)

- FreeBSD 2.2.5, 3.x, 4.x, 5.x, 6.x

- Linux Fedora Core-1, Kernel 2.4.22-1.2174

- Linux Mandrake 10.2

- Linux Red Hat 8.0, 9.0

- Solaris 9

- Solaris 10 x86, gcc

- Ubuntu Linux 6.10

- Gentoo Linux 2007.0 amd64

We hope DataparkSearch will work on other Unix platforms as well. Please report successful platforms to maxime@maxime.net.ru.

NFS notes: There are some problems reported running DataparkSearch over NFS v4 on Linux 2.6.17. Although, everything is OK on this system when NFS v3 is used.

## Tools required for installation

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

- Bzip2 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 recommended and sometimes required.

- A `sed` - stream editor.

- A `perl` interpreter, if `install.pl` will be used for installation.

- To build documentation from XML sources, you need `jade` or `openjade` installed.

  You need also `jadetex` installed to build documentation in PDF. Use `make book.pdf` command in `doc/` subdirectory to make that documentation.

## Installing DataparkSearch

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

   `tar -xyf dpsearch-x.x.tar.bz2`

2. To simplify configuration process we included a configuration script with the package - `install.pl`. Run `install.pl` and select DataparkSearch configuration options in a question-and-answer manner. After you specify all the configuration options, the script will run `./configure` with the options you chose. It will also create install.options file containing your configuration preferences that you can use to run the script later bypassing questions. After configuration is finished, build and install the package as described in section 3.

   In case you would like to configure DataparkSearch manually without using the configuration script, do the following:

   If you would like to configure the package with SQL database support:

   `sh$ ./configure --with-mysql`

   or

   `sh$ ./configure --with-pgsql`

   or with another depending on what database you prefer,

   or with multiple databases:

   `sh$ ./configure --with-mysql --with-pgsql --with-msql --with-freetds`

   By default, DataparkSearch is installed in `/usr/local/dpsearch` in the following subdirectories:

   Directory | Contents
   bin | `search.cgi`, `storedoc.cgi`, `dps-config`
   lib | `libdpsearch.a(so)`, `libdpcharset.a(so)`
   sbin | `indexer`, `cached`, `run-splitter`, `searchd`, `splitter`, `stored`
   etc | `indexer.conf-dist, search.htm-dist`, `langmap.conf-dist`, `searchd.conf-dist`, `stopwords.conf-dist`, `stored.conf-dist`, `storedoc.htm-dist`
   share | various documentation and sql scripts

   If you have no permission to write to that directory or just want to install DataparkSearch to another location, please use configure with `--prefix` option, e.g.

   `./configure --prefix=/user/home/data --with-mysql`

   To install DataparkSearch with HTTPS support use configure with the following option:

   `./configure --with-openssl`

   or in case the OpenSSL library is installed in a non-standard location:

   `./configure --with-openssl=/path/to/library`

   Please note that OpenSSL library installed on your system is required for HTTPS support.

   You can see all available options with `./configure --help`

   If you want to provide some specific flags to C compiler (for example, `'-O7 -mpentium'` to build highly optimized binary for Pentium processor if you use egcs/pgcc), you can do so using command

   `sh$ CFLAGS="-O7 -mpentium"`

   before running configure.

   To compile DataparkSearch on FreeBSD with Solid in old aout format use

   `sh$ CFLAGS="-aout"`

   before running configure.

   To compile DataparkSearch on FreeBSD with aout InterBase use

   `sh$ CFLAGS="-aout -static"`

   before running configure.

   You may also specify `--enable-freebsd-pthreads` or `--enable-linux-pthreads` to compile multi-threaded indexer on FreeBSD and Linux machines.

   To enable DMALLOC memory debugger support use `--enable-dmalloc`.

   The euc-kr, big5, gb2312, tscii, gujarati and shift-jis character sets are not supported by default. To built DataparkSearch with these charsets support use configure with `--with-extra-charsets` command line argument.

   To build DataparkSearch with all additional charsets support use:

   `./configure --with-extra-charsets=all`

   To build DataparkSearch with only one specified charset support use:

   `./configure --with-extra-charsets=tscii`

   To build DataparkSearch with support for Chinese or Japanese charsets, use:

   `./configure --with-extra-charsets=japanese` or `./configure --with-extra-charsets=chinese`

   To build DataparkSearch with support for several specified charsets, use a comma separated list of charsets you want:

   `./configure --with-extra-charset=japanese,tscii`

   If you run into problems with configure, please see .

3. Build and install the package.

   `sh$ make`

   `sh$ make install`

   If you run into problems with configure, please see .

4. Create database `search` (for SQL database only).

   You can use existing database, skip this step in this case.

   MySQL:

   `sh$ mysqladmin create search`

   PostgreSQL:

   `sh$ createdb search`

   See database specific information if you use another database.

5. Create configuration files.

   Copy `indexer.conf-dist` to `indexer.conf` and `search.htm-dist` to `search.htm` in the configuration directory (by default this directory is `/usr/local/dpsearch/etc/`). Then edit `indexer.conf` and `search.htm` according your needs. Basically your only have to edit `DBAddr` command in both of these files specifying a connection to SQL-server and desired dbmode.

6. Create sql-tables

   Run the command:

   `sh$ indexer -Ecreate`

   `indexer` creates all tables automatically according to the dbmode selected in your `indexer.conf` file.

7. Install search scripts

   Copy `search.cgi` to your web-server `cgi-bin` directory or make Apache alias to DataparkSearch bin directory.

## Possible installation problems

- Every time you run `configure`, you must run `make` again to recompile.

  To prevent old configuration information or object files from being used, run these commands before re-running `configure`:

  `sh$ rm config.cache`

  `sh$ make clean`

- If your compile fails with make errors, this can be because you are using the wrong version of make. The behavior of Solaris, FreeBSD, OpenBSD make is slightly different from GNU make. If you have make-related problems, you should use GNU make instead, often installed as gmake.

  GNU `make` version 3.77 is known to work.

- If starting Apache with mod_dpsearch module, you're getting the following error: `Undefined symbol "pthread_join"` (or something similar related to pthreads), try to add the following commmand into `httpd.conf` file before loading `mod_dpsearch.so`:

  `LoadFile /usr/lib/libpthread.so`

If above information doesn't help you, please feel free to contact DataparkSearch mailing list dataparksearch@yahoogroups.com.

## Quick usage tour

Before running `indexer` first time, you need specify web space to index (see ). Basically, if you want index one site, you should put a `Server` command similar to the following into your `indexer.conf` file:

    Server http://www.server.ext/

Run the `indexer` to index your data and write URL data:

`sh$ /usr/local/dpsearch/sbin/indexer -W`

## Installation registration

If you use DataparkSearch to build search on public accessible web site, you may register this site on our users page.