Chapter 11. The Z39.50 Server

Table of Contents

1. Running the Z39.50 Server (zebrasrv)
1.1. Description
1.2. Synopsis
1.3. Options
1.4. Files
1.5. See Also
2. Z39.50 Protocol Support and Behavior
2.1. Initialization
2.2. Search
2.3. Present
2.4. Scan
2.5. Sort
2.6. Close
2.7. Explain

1. Running the Z39.50 Server (zebrasrv)

1.1. Description

Zebra is a high-performance, general-purpose structured text indexing and retrieval engine. It reads structured records in a variety of input formats (eg. email, XML, MARC) and allows access to them through exact boolean search expressions and relevance-ranked free-text queries.

zebrasrv is the Z39.50 and SRW/U frontend server for the Zebra indexer.

On Unix you can run the zebrasrv server from the command line - and put it in the background. It may also operate under the inet daemon. On WIN32 you can run the server as a console application or as a WIN32 Service.

1.2. Synopsis

zebrasrv [-install] [-installa] [-remove] [-a file] [-v level] [-l file] [-u uid] [-c config] [-f vconfig] [-C fname] [-t minutes] [-k kilobytes] [-d daemon] [-w dir] [-p pidfile] [-ziDST1] [listener-spec...]

1.3. Options

The options for zebrasrv are the same as those for YAZ' yaz-ztest. Option -c specifies a Zebra configuration file - if omitted zebra.cfg is read.

-a file

Specify a file for dumping PDUs (for diagnostic purposes). The special name - (dash) sends output to stderr.

-S

Don't fork or make threads on connection requests. This is good for debugging, but not recommended for real operation: Although the server is asynchronous and non-blocking, it can be nice to keep a software malfunction (okay then, a crash) from affecting all current users. The server can only accept a single connection in this mode.

-1

Like -S but after one session the server exits. This mode is for debugging only.

-T

Operate the server in threaded mode. The server creates a thread for each connection rather than a fork a process. Only available on UNIX systems that offers POSIX threads.

-s

Use the SR protocol (obsolete).

-z

Use the Z39.50 protocol (default). This option and -s complement each other. You can use both multiple times on the same command line, between listener-specifications (see below). This way, you can set up the server to listen for connections in both protocols concurrently, on different local ports.

-l file

Specify an output file for the diagnostic messages. The default is to write this information to stderr

-c config-file

Read configuration information from config-file. The default configuration is ./zebra.cfg

-f vconfig

This specifies an XML file that describes one or more YAZ frontend virtual servers. See section VIRTUAL HOSTS for details.

-C fname

Sets SSL certificate file name for server (PEM).

-v level

The log level. Use a comma-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}.

-u uid

Set user ID. Sets the real UID of the server process to that of the given user. It's useful if you aren't comfortable with having the server run as root, but you need to start it as such to bind a privileged port.

-w working-directory

The server changes to this working directory during before listening on incoming connections. This option is useful when the server is operating from the inetd daemon (see -i).

-p pidfile

Specifies that the server should write its Process ID to file given by pidfile. A typical location would be /var/run/zebrasrv.pid.

-i

Use this to make the the server run from the inetd server (UNIX only). Make sure you use the logfile option -l in conjunction with this mode and specify the -l option before any other options.

-D

Use this to make the server put itself in the background and run as a daemon. If neither -i nor -D is given, the server starts in the foreground.

-install

Use this to install the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel.

-installa

Use this to install and activate the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel.

-remove

Use this to remove the server from the NT services (Windows NT/2000/XP only).

-t minutes

Idle session timeout, in minutes. Default is 60 minutes.

-k size

Maximum record size/message size, in kilobytes. Default is 1024 KB (1 MB).

-d daemon

Set name of daemon to be used in hosts access file. See hosts_access(5) and tcpd(8).

A listener-address consists of an optional transport mode followed by a colon (:) followed by a listener address. The transport mode is either a file system socket unix, a SSL TCP/IP socket ssl, or a plain TCP/IP socket tcp (default).

For TCP, an address has the form

    hostname | IP-number [: portnumber]
   

The port number defaults to 210 (standard Z39.50 port) for privileged users (root), and 9999 for normal users. The special hostname "@" is mapped to the address INADDR_ANY, which causes the server to listen on any local interface.

The default behavior for zebrasrv - if started as non-priviledged user - is to establish a single TCP/IP listener, for the Z39.50 protocol, on port 9999.

    zebrasrv @
    zebrasrv tcp:some.server.name.org:1234
    zebrasrv ssl:@:3000
   

To start the server listening on the registered port for Z39.50, or on a filesystem socket, and to drop root privileges once the ports are bound, execute the server like this from a root shell:

    zebrasrv -u daemon @
    zebrasrv -u daemon tcp:@:210
    zebrasrv -u daemon unix:/some/file/system/socket
   

Here daemon is an existing user account, and the unix socket /some/file/system/socket is readable and writable for the daemon account.

1.4. Files

zebra.cfg

1.5. See Also

zebraidx(1), yaz-ztest(8)

The Zebra software is Copyright Index Data http://www.indexdata.dk and distributed under the GPLv2 license.