File: yaz-ztest.8

package info (click to toggle)
yaz 3.0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,404 kB
  • ctags: 12,108
  • sloc: xml: 116,075; ansic: 52,205; sh: 9,746; tcl: 2,043; makefile: 1,141; yacc: 347
file content (391 lines) | stat: -rw-r--r-- 11,707 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
.\"     Title: yaz-ztest
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\"      Date: 06/18/2008
.\"    Manual: 
.\"    Source: YAZ 3.0.34
.\"
.TH "YAZ\-ZTEST" "8" "06/18/2008" "YAZ 3.0.34" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
yaz-ztest \- Z39.50 Test Server
.SH "SYNOPSIS"
.HP 12
\fBapplication\fR [\fB\-install\fR] [\fB\-installa\fR] [\fB\-remove\fR] [\fB\-a\ \fR\fB\fIfile\fR\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-l\ \fR\fB\fIfile\fR\fR] [\fB\-u\ \fR\fB\fIuid\fR\fR] [\fB\-c\ \fR\fB\fIconfig\fR\fR] [\fB\-f\ \fR\fB\fIvconfig\fR\fR] [\fB\-C\ \fR\fB\fIfname\fR\fR] [\fB\-t\ \fR\fB\fIminutes\fR\fR] [\fB\-k\ \fR\fB\fIkilobytes\fR\fR] [\fB\-d\ \fR\fB\fIdaemon\fR\fR] [\fB\-w\ \fR\fB\fIdir\fR\fR] [\fB\-p\ \fR\fB\fIpidfile\fR\fR] [\fB\-r\ \fR\fB\fIkilobytes\fR\fR] [\fB\-ziDST1\fR] [listener\-spec...]
.SH "DESCRIPTION"
.PP

\fByaz\-ztest\fR
is a Z39\&.50 test server that uses the YAZ generic frontend server API\&. The server acts as a real Z39\&.50 server but does not use a database\&. It returns a random hit count and returns a subset of a few built\-in records\&.
.PP
The
\fIlistener\-spec\fR
consists of a transport mode followed by a colon, followed by a listener address\&. The transport mode is either
tcp,
unix, or
ssl\&.
.PP
For TCP and SSL, an address has the form:
.sp
.RS 4
.nf
    hostname | IP\-number [ : portnumber ]
   
.fi
.RE
.PP
For UNIX local socket the address is the filename of the local socket\&.
.SH "OPTIONS"
.PP
\-a \fIfile\fR
.RS 4
Specify a file for dumping PDUs (for diagnostic purposes)\&. The special name
\-
(dash) sends output to
stderr\&.
.RE
.PP
\-S
.RS 4
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\&.
.RE
.PP
\-1
.RS 4
Like
\-S
but after one session the server exits\&. This mode is for debugging
\fIonly\fR\&.
.RE
.PP
\-T
.RS 4
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\&.
.RE
.PP
\-s
.RS 4
Use the SR protocol (obsolete)\&.
.RE
.PP
\-z
.RS 4
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\&.
.RE
.PP
\-l \fIfile\fR
.RS 4
The logfile\&.
.RE
.PP
\-c \fIconfig\fR
.RS 4
A user option that serves as a specifier for some sort of configuration, usually a filename\&. The argument to this option is transferred to member
configname
of the
statserv_options_block\&.
.RE
.PP
\-f \fIvconfig\fR
.RS 4
This specifies an XML file that describes one or more YAZ frontend virtual servers\&.
.RE
.PP
\-C \fIfname\fR
.RS 4
Sets SSL certificate file name for server (PEM)\&.
.RE
.PP
\-v \fIlevel\fR
.RS 4
The log level\&. Use a comma\-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}\&.
.RE
.PP
\-u \fIuid\fR
.RS 4
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\&.
.RE
.PP
\-w \fIdir\fR
.RS 4
The server changes to this directory during before listening on incoming connections\&. This option is useful when the server is operating from the
inetd
daemon (see
\-i)\&.
.RE
.PP
\-p \fIpidfile\fR
.RS 4
Specifies that the server should write its Process ID to file given by
\fIpidfile\fR\&. A typical location would be
\fI/var/run/yaz\-ztest\&.pid\fR\&.
.RE
.PP
\-i
.RS 4
Use this to make the the server run from the
inetd
server (UNIX only)\&.
.RE
.PP
\-D
.RS 4
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\&.
.RE
.PP
\-install
.RS 4
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\&.
.RE
.PP
\-installa
.RS 4
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\&.
.RE
.PP
\-remove
.RS 4
Use this to remove the server from the NT services (Windows NT/2000/XP only)\&.
.RE
.PP
\-t \fIminutes\fR
.RS 4
Idle session timeout, in minutes\&.
.RE
.PP
\-k \fIsize\fR
.RS 4
Maximum record size/message size, in kilobytes\&.
.RE
.PP
\-r \fIsize\fR
.RS 4
Maximum size of log file before rotation occurs, in kilobytes\&. Default size is 1048576 k (=1 GB)\&.
.RE
.PP
\-d \fIdaemon\fR
.RS 4
Set name of daemon to be used in hosts access file\&. See
\fBhosts_access\fR(5)
and
\fBtcpd\fR(8)\&.
.RE
.PP
\-m \fItime\-format\fR
.RS 4
Sets the format of time\-stamps in the log\-file\&. Specify a string in the input format to
strftime()\&.
.RE
.SH "GFS CONFIGURATION AND VIRTUAL HOSTS"
.PP
The Virtual hosts mechanism allows a YAZ frontend server to support multiple backends\&. A backend is selected on the basis of the TCP/IP binding (port+listening adddress) and/or the virtual host\&.
.PP
A backend can be configured to execute in a particular working directory\&. Or the YAZ frontend may perform CQL to RPN conversion, thus allowing traditional Z39\&.50 backends to be offered as a SRW/SRU service\&. SRW/SRU Explain information for a particular backend may also be specified\&.
.PP
For the HTTP protocol, the virtual host is specified in the Host header\&. For the Z39\&.50 protocol, the virtual host is specified as in the Initialize Request in the OtherInfo, OID 1\&.2\&.840\&.10003\&.10\&.1000\&.81\&.1\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
Note
.PP
Not all Z39\&.50 clients allows the VHOST information to be set\&. For those the selection of the backend must rely on the TCP/IP information alone (port and address)\&.
.PP
The YAZ frontend server uses XML to describe the backend configurations\&. Command\-line option
\-f
specifies filename of the XML configuration\&.
.PP
The configuration uses the root element
yazgfs\&. This element includes a list of
listen
elements, followed by one or more
server
elements\&.
.PP
The
listen
describes listener (transport end point), such as TCP/IP, Unix file socket or SSL server\&. Content for a listener:
.PP
CDATA (required)
.RS 4
The CDATA for the
listen
element holds the listener string, such as
tcp:@:210,
tcp:server1:2100, etc\&.
.RE
.PP
attribute id (optional)
.RS 4
identifier for this listener\&. This may be referred to from server sections\&.
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
Note
.PP
We expect more information to be added for the listen section in a future version, such as CERT file for SSL servers\&.

.PP
The
server
describes a server and the parameters for this server type\&. Content for a server:
.PP
attribute id (optional)
.RS 4
Identifier for this server\&. Currently not used for anything, but it might be for logging purposes\&.
.RE
.PP
attribute listenref (optional)
.RS 4
Specifies listener for this server\&. If this attribute is not given, the server is accessible from all listener\&. In order for the server to be used for real, howeever, the virtual host must match (if specified in the configuration)\&.
.RE
.PP
element config (optional)
.RS 4
Specifies the server configuration\&. This is equivalent to the config specified using command line option
\-c\&.
.RE
.PP
element directory (optional)
.RS 4
Specifies a working directory for this backend server\&. If specifid, the YAZ fronend changes current working directory to this directory whenever a backend of this type is started (backend handler bend_start), stopped (backend handler hand_stop) and initialized (bend_init)\&.
.RE
.PP
element host (optional)
.RS 4
Specifies the virtual host for this server\&. If this is specified a client
\fImust\fR
specify this host string in order to use this backend\&.
.RE
.PP
element cql2rpn (optional)
.RS 4
Specifies a filename that includes CQL to RPN conversion for this backend server\&. See
???
If given, the backend server will only "see" a Type\-1/RPN query\&.
.RE
.PP
element ccl2rpn (optional)
.RS 4
Specifies a filename that includes CCL to RPN conversion for this backend server\&. See
???
If given, the backend server will only "see" a Type\-1/RPN query\&.
.RE
.PP
element stylesheet (optional)
.RS 4
Specifies the stylesheet reference to be part of SRU HTTP responses when the client does not specify one\&. If neither this is given, nor the client specifies one, no stylesheet reference is part of the SRU HTTP response\&.
.RE
.PP
element docpath (optional)
.RS 4
Specifies a path for local file access using HTTP\&. All URLs with a leading prefix (/ exluded) that matches the value of docpath are used for file access\&. For example, if the server is to offer access in directory
xsl, the docpath would be
xsl
and all URLs of the form
http://host/exl
will result in a local file access\&.
.RE
.PP
element explain (optional)
.RS 4
Specifies SRW/SRU ZeeRex content for this server\&. Copied verbatim to the client\&. As things are now, some of the Explain content seeem redundant because host information, etc\&. is also stored elsewhere\&.
.RE
.PP
element maximumrecordsize (optional)
.RS 4
Specifies maximum record size/message size, in bytes\&. This value also servers as maximum size of
\fIincoming\fR
packages (for Record Updates etc)\&. It\'s the same value as that given by the
\-k
option\&.
.RE
.PP
element retrievalinfo (optional)
.RS 4
Enables the retrieval facility supporting conversions and specifications of record formats/types\&. See
???
for more information\&.
.RE
.PP
The XML below configures a server that accepts connections from two ports, TCP/IP port 9900 and a local UNIX file socket\&. We name the TCP/IP server
public
and the other server
internal\&.
.sp
.RS 4
.nf
  
 <yazgfs>
  <listen id="public">tcp:@:9900</listen>
  <listen id="internal">unix:/var/tmp/socket</listen>
  <server id="server1">
    <host>server1\&.mydomain</host>
    <directory>/var/www/s1</directory>
    <config>config\&.cfg</config>
  </server>
  <server id="server2">
    <host>server2\&.mydomain</host>
    <directory>/var/www/s2</directory>
    <config>config\&.cfg</config>
    <cql2rpn>\&.\&./etc/pqf\&.properties</cql2rpn>
    <explain xmlns="http://explain\&.z3950\&.org/dtd/2\&.0/">
      <serverInfo>
        <host>server2\&.mydomain</host>
        <port>9900</port>
        <database>a</database>
      </serverInfo>
    </explain>
  </server>
  <server id="server3" listenref="internal">
    <directory>/var/www/s3</directory>
    <config>config\&.cfg</config>
  </server>
 </yazgfs>

 
.fi
.RE
.PP
There are three configured backend servers\&. The first two servers,
"server1"
and
"server2", can be reached by both listener addresses \- since no
listenref
attribute is specified\&. In order to distinguish between the two a virtual host has been specified for each of server in the
host
elements\&.
.PP
For
"server2"
elements for CQL to RPN conversion is supported and explain information has been added (a short one here to keep the example small)\&.
.PP
The third server,
"server3"
can only be reached via listener
"internal"\&.
.SH "FILES"
.PP

\fIyaz\-<version>/ztest/yaz\-ztest\&.c\fR
.PP

\fIyaz\-<version>/include/yaz/backend\&.h\fR
.SH "SEE ALSO"
.PP

\fByaz\fR(7)
\fByaz-log\fR(7)