1YAZ-ZTEST(8) [FIXME: manual] YAZ-ZTEST(8)
2
3
4
6 yaz-ztest - Z39.50 Test Server
7
9 application [-install] [-installa] [-remove] [-a file] [-v level]
10 [-l file] [-u uid] [-c config] [-f vconfig] [-C fname]
11 [-t minutes] [-k kilobytes] [-d daemon] [-w dir]
12 [-p pidfile] [-r kilobytes] [-ziDST1] [listener-spec...]
13
15 yaz-ztest is a Z39.50 test server that uses the YAZ generic frontend
16 server API. The server acts as a real Z39.50 server but does not use a
17 database. It returns a random hit count and returns a subset of a few
18 built-in records.
19
20 The listener-spec consists of a transport mode followed by a colon,
21 followed by a listener address. The transport mode is either tcp, unix,
22 or ssl.
23
24 For TCP and SSL, an address has the form:
25
26 hostname | IP-number [ : portnumber ]
27
28
29 For UNIX local socket the address is the filename of the local socket.
30
32 -a file
33 Specify a file for dumping PDUs (for diagnostic purposes). The
34 special name - (dash) sends output to stderr.
35
36 -S
37 Don´t fork or make threads on connection requests. This is good for
38 debugging, but not recommended for real operation: Although the
39 server is asynchronous and non-blocking, it can be nice to keep a
40 software malfunction (okay then, a crash) from affecting all
41 current users.
42
43 -1
44 Like -S but after one session the server exits. This mode is for
45 debugging only.
46
47 -T
48 Operate the server in threaded mode. The server creates a thread
49 for each connection rather than a fork a process. Only available on
50 UNIX systems that offers POSIX threads.
51
52 -s
53 Use the SR protocol (obsolete).
54
55 -z
56 Use the Z39.50 protocol (default). This option and -s complement
57 each other. You can use both multiple times on the same command
58 line, between listener-specifications (see below). This way, you
59 can set up the server to listen for connections in both protocols
60 concurrently, on different local ports.
61
62 -l file
63 The logfile.
64
65 -c config
66 A user option that serves as a specifier for some sort of
67 configuration, usually a filename. The argument to this option is
68 transferred to member configname of the statserv_options_block.
69
70 -f vconfig
71 This specifies an XML file that describes one or more YAZ frontend
72 virtual servers.
73
74 -C fname
75 Sets SSL certificate file name for server (PEM).
76
77 -v level
78 The log level. Use a comma-separated list of members of the set
79 {fatal,debug,warn,log,malloc,all,none}.
80
81 -u uid
82 Set user ID. Sets the real UID of the server process to that of the
83 given user. It´s useful if you aren´t comfortable with having the
84 server run as root, but you need to start it as such to bind a
85 privileged port.
86
87 -w dir
88 The server changes to this directory during before listening on
89 incoming connections. This option is useful when the server is
90 operating from the inetd daemon (see -i).
91
92 -p pidfile
93 Specifies that the server should write its Process ID to file given
94 by pidfile. A typical location would be /var/run/yaz-ztest.pid.
95
96 -i
97 Use this to make the the server run from the inetd server (UNIX
98 only).
99
100 -D
101 Use this to make the server put itself in the background and run as
102 a daemon. If neither -i nor -D is given, the server starts in the
103 foreground.
104
105 -install
106 Use this to install the server as an NT service (Windows NT/2000/XP
107 only). Control the server by going to the Services in the Control
108 Panel.
109
110 -installa
111 Use this to install and activate the server as an NT service
112 (Windows NT/2000/XP only). Control the server by going to the
113 Services in the Control Panel.
114
115 -remove
116 Use this to remove the server from the NT services (Windows
117 NT/2000/XP only).
118
119 -t minutes
120 Idle session timeout, in minutes.
121
122 -k size
123 Maximum record size/message size, in kilobytes.
124
125 -r size
126 Maximum size of log file before rotation occurs, in kilobytes.
127 Default size is 1048576 k (=1 GB).
128
129 -d daemon
130 Set name of daemon to be used in hosts access file. See
131 hosts_access(5) and tcpd(8).
132
133 -m time-format
134 Sets the format of time-stamps in the log-file. Specify a string in
135 the input format to strftime().
136
138 The Virtual hosts mechanism allows a YAZ frontend server to support
139 multiple backends. A backend is selected on the basis of the TCP/IP
140 binding (port+listening adddress) and/or the virtual host.
141
142 A backend can be configured to execute in a particular working
143 directory. Or the YAZ frontend may perform CQL to RPN conversion, thus
144 allowing traditional Z39.50 backends to be offered as a SRW/SRU
145 service. SRW/SRU Explain information for a particular backend may also
146 be specified.
147
148 For the HTTP protocol, the virtual host is specified in the Host
149 header. For the Z39.50 protocol, the virtual host is specified as in
150 the Initialize Request in the OtherInfo, OID
151 1.2.840.10003.10.1000.81.1.
152
153 Note
154 Not all Z39.50 clients allows the VHOST information to be set. For
155 those the selection of the backend must rely on the TCP/IP
156 information alone (port and address).
157
158 The YAZ frontend server uses XML to describe the backend
159 configurations. Command-line option -f specifies filename of the XML
160 configuration.
161
162 The configuration uses the root element yazgfs. This element includes a
163 list of listen elements, followed by one or more server elements.
164
165 The listen describes listener (transport end point), such as TCP/IP,
166 Unix file socket or SSL server. Content for a listener:
167
168 CDATA (required)
169 The CDATA for the listen element holds the listener string, such as
170 tcp:@:210, tcp:server1:2100, etc.
171
172 attribute id (optional)
173 identifier for this listener. This may be referred to from server
174 sections.
175
176 Note
177 We expect more information to be added for the listen section in a
178 future version, such as CERT file for SSL servers.
179
180 The server describes a server and the parameters for this server type.
181 Content for a server:
182
183 attribute id (optional)
184 Identifier for this server. Currently not used for anything, but it
185 might be for logging purposes.
186
187 attribute listenref (optional)
188 Specifies listener for this server. If this attribute is not given,
189 the server is accessible from all listener. In order for the server
190 to be used for real, howeever, the virtual host must match (if
191 specified in the configuration).
192
193 element config (optional)
194 Specifies the server configuration. This is equivalent to the
195 config specified using command line option -c.
196
197 element directory (optional)
198 Specifies a working directory for this backend server. If specifid,
199 the YAZ fronend changes current working directory to this directory
200 whenever a backend of this type is started (backend handler
201 bend_start), stopped (backend handler hand_stop) and initialized
202 (bend_init).
203
204 element host (optional)
205 Specifies the virtual host for this server. If this is specified a
206 client must specify this host string in order to use this backend.
207
208 element cql2rpn (optional)
209 Specifies a filename that includes CQL to RPN conversion for this
210 backend server. See ??? If given, the backend server will only
211 "see" a Type-1/RPN query.
212
213 element ccl2rpn (optional)
214 Specifies a filename that includes CCL to RPN conversion for this
215 backend server. See ??? If given, the backend server will only
216 "see" a Type-1/RPN query.
217
218 element stylesheet (optional)
219 Specifies the stylesheet reference to be part of SRU HTTP responses
220 when the client does not specify one. If neither this is given, nor
221 the client specifies one, no stylesheet reference is part of the
222 SRU HTTP response.
223
224 element docpath (optional)
225 Specifies a path for local file access using HTTP. All URLs with a
226 leading prefix (/ exluded) that matches the value of docpath are
227 used for file access. For example, if the server is to offer access
228 in directory xsl, the docpath would be xsl and all URLs of the form
229 http://host/exl will result in a local file access.
230
231 element explain (optional)
232 Specifies SRW/SRU ZeeRex content for this server. Copied verbatim
233 to the client. As things are now, some of the Explain content seeem
234 redundant because host information, etc. is also stored elsewhere.
235
236 element maximumrecordsize (optional)
237 Specifies maximum record size/message size, in bytes. This value
238 also servers as maximum size of incoming packages (for Record
239 Updates etc). It´s the same value as that given by the -k option.
240
241 element retrievalinfo (optional)
242 Enables the retrieval facility supporting conversions and
243 specifications of record formats/types. See ??? for more
244 information.
245
246 The XML below configures a server that accepts connections from two
247 ports, TCP/IP port 9900 and a local UNIX file socket. We name the
248 TCP/IP server public and the other server internal.
249
250
251 <yazgfs>
252 <listen id="public">tcp:@:9900</listen>
253 <listen id="internal">unix:/var/tmp/socket</listen>
254 <server id="server1">
255 <host>server1.mydomain</host>
256 <directory>/var/www/s1</directory>
257 <config>config.cfg</config>
258 </server>
259 <server id="server2">
260 <host>server2.mydomain</host>
261 <directory>/var/www/s2</directory>
262 <config>config.cfg</config>
263 <cql2rpn>../etc/pqf.properties</cql2rpn>
264 <explain xmlns="http://explain.z3950.org/dtd/2.0/">
265 <serverInfo>
266 <host>server2.mydomain</host>
267 <port>9900</port>
268 <database>a</database>
269 </serverInfo>
270 </explain>
271 </server>
272 <server id="server3" listenref="internal">
273 <directory>/var/www/s3</directory>
274 <config>config.cfg</config>
275 </server>
276 </yazgfs>
277
278
279
280 There are three configured backend servers. The first two servers,
281 "server1" and "server2", can be reached by both listener addresses -
282 since no listenref attribute is specified. In order to distinguish
283 between the two a virtual host has been specified for each of server in
284 the host elements.
285
286 For "server2" elements for CQL to RPN conversion is supported and
287 explain information has been added (a short one here to keep the
288 example small).
289
290 The third server, "server3" can only be reached via listener
291 "internal".
292
294 yaz-<version>/ztest/yaz-ztest.c
295
296 yaz-<version>/include/yaz/backend.h
297
299 yaz(7) yaz-log(7)
300
301
302
303YAZ 4.0.2 03/09/2010 YAZ-ZTEST(8)