2 Description of the virtual host mechanism in YAZ GFS
3 Included in both manual and man page for yaz-ztest
7 The Virtual hosts mechanism allows a YAZ frontend server to
8 support multiple backends. A backend is selected on the basis of
9 the TCP/IP binding (port+listening adddress) and/or the virtual host.
12 A backend can be configured to execute in a particular working
13 directory. Or the YAZ frontend may perform CQL to RPN conversion, thus
14 allowing traditional Z39.50 backends to be offered as a SRW/SRU
15 service. SRW/SRU Explain information for a particular backend may also
19 For the HTTP protocol, the virtual host is specified in the Host header.
20 For the Z39.50 protocol, the virtual host is specified as in the
21 Initialize Request in the OtherInfo, OID 1.2.840.10003.10.1000.81.1.
25 Not all Z39.50 clients allows the VHOST information to be set.
26 For those the selection of the backend must rely on the
27 TCP/IP information alone (port and address).
31 The YAZ frontend server uses XML to describe the backend
32 configurations. Command-line option <literal>-f</literal>
33 specifies filename of the XML configuration.
36 The configuration uses the root element <literal>yazgfs</literal>.
37 This element includes a list of <literal>listen</literal> elements,
38 followed by one or more <literal>server</literal> elements.
41 The <literal>listen</literal> describes listener (transport end point),
42 such as TCP/IP, Unix file socket or SSL server. Content for
45 <varlistentry><term>CDATA (required)</term>
48 The CDATA for the <literal>listen</literal> element holds the
49 listener string, such as <literal>tcp:@:210</literal>,
50 <literal>tcp:server1:2100</literal>,
55 <varlistentry><term>attribute <literal>id</literal> (optional)</term>
58 identifier for this listener. This may be referred to from
66 We expect more information to be added for the listen section in
67 a future version, such as CERT file for SSL servers.
72 The <literal>server</literal> describes a server and the parameters
73 for this server type. Content for a server:
75 <varlistentry><term>attribute <literal>id</literal> (optional)</term>
78 Identifier for this server. Currently not used for anything,
79 but it might be for logging purposes.
84 <varlistentry><term>attribute <literal>listenref</literal> (optional)</term>
87 Specifies listener for this server. If this attribute is not
88 given, the server is accessible from all listener. In order
89 for the server to be used for real, howeever, the virtual host
90 must match (if specified in the configuration).
95 <varlistentry><term>element <literal>config</literal> (optional)</term>
98 Specifies the server configuration. This is equivalent
99 to the config specified using command line option
100 <literal>-c</literal>.
105 <varlistentry><term>element <literal>directory</literal> (optional)</term>
108 Specifies a working directory for this backend server. If
109 specifid, the YAZ fronend changes current working directory
110 to this directory whenever a backend of this type is
111 started (backend handler bend_start), stopped (backend handler hand_stop)
112 and initialized (bend_init).
117 <varlistentry><term>element <literal>host</literal> (optional)</term>
120 Specifies the virtual host for this server. If this is specified
121 a client <emphasis>must</emphasis> specify this host string in
122 order to use this backend.
127 <varlistentry><term>element <literal>cql2rpn</literal> (optional)</term>
130 Specifies a filename that includes CQL to RPN conversion for this
131 backend server. See &reference-tools-cql-map;
132 If given, the backend server will only "see" a Type-1/RPN query.
137 <varlistentry><term>element <literal>ccl2rpn</literal> (optional)</term>
140 Specifies a filename that includes CCL to RPN conversion for this
141 backend server. See &reference-tools-ccl-qualifiers;
142 If given, the backend server will only "see" a Type-1/RPN query.
147 <varlistentry><term>element <literal>stylesheet</literal> (optional)</term>
150 Specifies the stylesheet reference to be part of SRU HTTP responses
151 when the client does not specify one. If neither this is given, nor
152 the client specifies one, no stylesheet reference is part of the
158 <varlistentry><term>element <literal>docpath</literal> (optional)</term>
161 Specifies a path for local file access using HTTP. All URLs with
162 a leading prefix (/ exluded) that matches the value of docpath
163 are used for file access. For example, if the server is to offer
164 access in directory <literal>xsl</literal>, the docpath would be
165 <literal>xsl</literal> and all URLs of the form
166 <literal>http://host/exl</literal> will result in a local file access.
171 <varlistentry><term>element <literal>explain</literal> (optional)</term>
174 Specifies SRW/SRU ZeeRex content for this server. Copied verbatim
175 to the client. As things are now, some of the Explain content
176 seeem redundant because host information, etc. is also stored
182 <varlistentry><term>element <literal>maximumrecordsize</literal> (optional)</term>
185 Specifies maximum record size/message size, in bytes. This
186 value also servers as maximum size of <emphasis>incoming</emphasis>
187 packages (for Record Updates etc). It's the same value as that
188 given by the <literal>-k</literal> option.
193 <varlistentry><term>element <literal>retrievalinfo</literal> (optional)</term>
196 Enables the retrieval facility supporting conversions and
197 specifications of record formats/types.
198 See <xref linkend="tools.retrieval"/> for
208 The XML below configures a server that accepts connections from
209 two ports, TCP/IP port 9900 and a local UNIX file socket.
210 We name the TCP/IP server <literal>public</literal> and the
211 other server <literal>internal</literal>.
216 <listen id="public">tcp:@:9900</listen>
217 <listen id="internal">unix:/var/tmp/socket</listen>
218 <server id="server1">
219 <host>server1.mydomain</host>
220 <directory>/var/www/s1</directory>
221 <config>config.cfg</config>
223 <server id="server2">
224 <host>server2.mydomain</host>
225 <directory>/var/www/s2</directory>
226 <config>config.cfg</config>
227 <cql2rpn>../etc/pqf.properties</cql2rpn>
228 <explain xmlns="http://explain.z3950.org/dtd/2.0/">
230 <host>server2.mydomain</host>
232 <database>a</database>
236 <server id="server3" listenref="internal">
237 <directory>/var/www/s3</directory>
238 <config>config.cfg</config>
244 There are three configured backend servers. The first two
245 servers, <literal>"server1"</literal> and <literal>"server2"</literal>,
246 can be reached by both listener addresses - since
247 no <literal>listenref</literal> attribute is specified.
248 In order to distinguish between the two a virtual host has
249 been specified for each of server in the <literal>host</literal>
253 For <literal>"server2"</literal> elements for CQL to RPN conversion
254 is supported and explain information has been added (a short one here
255 to keep the example small).
258 The third server, <literal>"server3"</literal> can only be reached
259 via listener <literal>"internal"</literal>.
262 <!-- Keep this comment at the end of the file
267 sgml-minimize-attributes:nil
268 sgml-always-quote-attributes:t
271 sgml-parent-document: "yaz.xml"
272 sgml-local-catalogs: nil
273 sgml-namecase-general:t