]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
5b45423991c6861a564f1c6313e091105d53b720
[working/Evergreen.git] / 1.6 / admin / ServersideInstallation.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter xml:id="ServersideInstallation" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xl="http://www.w3.org/1999/xlink">
3         <info>
4                 <title>Server-side Installation of Evergreen Software</title>
5                 <abstract>
6                         <para>This section describes installation of the Evergreen server-side software and its associated components. Installation, configuration, testing and verification of the software is straightforward if you follow some simple directions.</para>
7                 </abstract>
8         </info>
9         <section xml:id="serversideinstallation-overview">
10                 <title>Overview</title>
11                 <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current stable software release. See <xref linkend="serversideinstallation-all"/> for instructions tailored to installing on some particular distributions of the <systemitem class="osname">Linux</systemitem> operating system. Earlier software distributions are described in <xref linkend="serversideinstallation-previousversions"/>.</para>
12                 <para>The current version of the Evergreen server-side software runs as a native application on any of several well-known <systemitem class="osname">Linux</systemitem> distributions (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). It does not currently run as a native application on the <systemitem class="osname">Microsoft Windows</systemitem> operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can still be installed and run on <systemitem class="osname">Windows</systemitem> via a so-called <emphasis>virtualized</emphasis> Unix-guest Operating System (using, for example, <application>VirtualBox</application>, or <application>VMware</application>, or <application>VirtualPC</application> to emulate a <systemitem class="osname">Linux</systemitem> environment). It can also be installed to run on other <systemitem class="osname">Linux</systemitem> systems via virtualized environments (using, for example, <application>VirtualBox</application> or <application>VMware</application>). More information on virtualized environments can be found in <xref linkend="serversideinstallation-virtual"/>.</para>
13                 <para>Installation of some sub-components of the Evergreen server-side software is mentioned only in abbreviated form in this section. More detailed information is available in <xref linkend="serversideinstallation-postgresql"/> and <xref linkend="serversideinstallation-apache"/>.</para>
14                 <para>Finally, installation of the Evergreen Staff Client software is reviewed in <xref linkend="serversideinstallation-staffclient"/>. </para>
15                 <section>
16                         <title>Evergreen Software Dependencies</title>
17                         <para>The Evergreen server-side software has dependencies on particular versions of certain major software sub-components. Successful installation of Evergreen software requires that software versions agree with those listed here:</para>
18                         <table>
19                                 <title>Evergreen Software Dependencies</title>
20                                 <tgroup align="left" cols="3" colsep="1" rowsep="1">
21                                         <thead>
22                                                 <row>
23                                                         <entry>Evergreen</entry>
24                                                         <entry>OpenSRF</entry>
25                                                         <entry>PostgreSQL</entry>
26                                                 </row>
27                                         </thead>
28                                         <tbody>
29                                                 <row>
30                                                         <entry>1.6.x</entry>
31                                                         <entry>1.2</entry>
32                                                         <entry>8.2 / 8.3</entry>
33                                                 </row>
34                                                 <row>
35                                                         <entry>1.4.x</entry>
36                                                         <entry>1.0</entry>
37                                                         <entry>8.1 / 8.2</entry>
38                                                 </row>
39                                                 <row>
40                                                         <entry>1.2.x</entry>
41                                                         <entry>0.9</entry>
42                                                         <entry>8.1 / 8.2</entry>
43                                                 </row>
44                                         </tbody>
45                                 </tgroup>
46                         </table>
47                 </section>
48                 <section>
49                         <title>Current Stable Software Release</title>
50                         <para>The current stable release of Evergreen is version <emphasis><emphasis role="bold">1.6.0.7</emphasis></emphasis>. Instructions for installing, configuring and testing that version on the <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> <systemitem class="osname">Linux</systemitem> systems are found in <xref linkend="serversideinstallation-ubuntudebian"/>.</para>
51                         <para>This release of Evergreen software is dependent on the Open Service Request Framework (OpenSRF). The current stable release of OpenSRF is version <emphasis><emphasis role="bold">1.2.2</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in <xref linkend="serversideinstallation-opensrf"/>.</para>
52                 </section>
53                 <section>
54                         <title>Previous Software Releases</title>
55                         <para>Earlier releases of Evergreen are also available. Instructions for installing, configuring and testing earlier versions are found in <xref linkend="serversideinstallation-previousversions"/>.</para>
56                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold">1.4.0.6</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in <xref linkend="serversideinstallation-ubuntudebian-previous"/>.</para>
57                         <para>The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in <xref linkend="serversideinstallation-opensrf-previous"/>.</para>
58                 </section>
59         </section>
60         <section xml:id="serversideinstallation-all">
61                 <title>Installing Server-Side Software</title>
62                 <para>This section describes the installation of the major components of Evergreen server-side software.</para>
63                 <para>As far as possible, you should perform the following steps in the exact order given since the success of many steps relies on the successful completion of earlier steps. You should make backup copies of files and environments when you are instructed to do so. In the event of installation problems those copies can allow you to back out of a step gracefully and resume the installation from a known state. See <xref linkend="adminmisc-backingup"/> for further information.</para>
64                 <para>Of course, after you successfully complete and test the entire Evergreen installation you should take a final snapshot backup of your system(s). This can be the first in the series of regularly scheduled system backups that you should probably also begin.</para>
65                 <section xml:id="serversideinstallation-opensrf">
66                         <title>Installing OpenSRF 1.2.x On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>
67                         <para>This section describes the installation of the latest version of the Open Service Request Framework (OpenSRF), a major component of the Evergreen server-side software, on <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> systems. Evergreen software is integrated with and depends on the OpenSRF software system.</para>
68                         <para>Follow the steps outlined here and run the specified tests to ensure that OpenSRF is properly installed and configured. Do not continue with any further Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>
69                         <note>
70                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) platforms. OpenSRF 1.2.2 has been tested on <systemitem class="osname">Debian Etch (4.0)</systemitem>, <systemitem class="osname">Debian Lenny</systemitem>, <systemitem class="osname">Ubuntu Hardy Heron (8.04)</systemitem>, and <systemitem class="osname">Ubuntu Intrepid Ibex (8.10)</systemitem>.</para>
71                                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>
72                                 <itemizedlist>
73                                         <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>
74                                         <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>
75                                 </itemizedlist>
76                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue the command <command>exit"</command>.</para>
77                         </note>
78                         <section>
79                                 <title>Add the OpenSRF User</title>
80                                 <para>As the <systemitem class="username">root</systemitem> user, add the opensrf user to the system. The default shell for the new user is automatically set to <command>/bin/bash</command> to inherit a reasonable environment:</para>
81                                 <figure>
82                                         <title>Commands to add <systemitem class="username">opensrf</systemitem> user</title>
83                                         <screen>
84                                         $ su - opensrf
85                                         $ useradd -m -s /bin/bash opensrf
86                                         $ passwd opensrf
87                                         Enter new UNIX password: ******
88                                         Retype new UNIX password: ******
89                                         passwd: password updated successfully
90                                         $
91                                         </screen>
92                                 </figure>
93                         </section>
94                         <section>
95                                 <title>Download and Unpack Latest OpenSRF Version</title>
96                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of OpenSRF. The latest version can be found here: <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz"></ulink></para>
97                                 <figure>
98                                         <title>Commands to download and unpack OpenSRF</title>
99                                         <screen>
100                                         $ su - opensrf
101                                         $ wget http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz
102                                         $ tar zxf OpenSRF-1.2.2.tar.gz
103                                         </screen>
104                                 </figure>
105                                 <para>The new directory <filename class="directory">/home/opensrf/OpenSRF-1.2.2</filename> will be created.</para>
106                         </section>
107                         <section>
108                                 <title>Install Prerequisites to Build OpenSRF</title>
109                                 <para>In this section you will install and configure a set of prerequisites that will be used to build OpenSRF. In a following step you will actually build the software using the <command>make</command> utility.</para>
110                                 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-1">"Keywords"</link> figure below.</para>
111                                 <figure>
112                                         <title>Commands to install prerequisites for OpenSRF</title>
113                                         <screen>
114                                         $ su - root
115                                         $ cd /home/opensrf/OpenSRF-1.2.2
116                                         $ make -f src/extras/Makefile.install [DISTRIBUTION]
117                                         ...
118                                         </screen>
119                                 </figure>
120                                 <table xml:id="serversideinstallation-keywords-figure-1">
121                                         <title>Keywords Targets for <application>make</application></title>
122                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
123                                                 <colspec colnum="1" colwidth="1*"/>
124                                                 <colspec colnum="2" colwidth="3*"/>
125                                                 <thead>
126                                                         <row>
127                                                                 <entry>Keyword</entry>
128                                                                 <entry>Description</entry>
129                                                         </row>
130                                                 </thead>
131                                                 <tbody>
132                                                         <row>
133                                                                 <entry>debian-lenny</entry>
134                                                                 <entry>for Debian Lenny (5.0)</entry>
135                                                         </row>
136                                                         <row>
137                                                                 <entry>debian-etch</entry>
138                                                                 <entry>for Debian Etch (4.0)</entry>
139                                                         </row>
140                                                         <row>
141                                                                 <entry>ubuntu-karmic</entry>
142                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
143                                                         </row>
144                                                         <row>
145                                                                 <entry>ubuntu-intrepid</entry>
146                                                                 <entry>for Ubuntu Jaunty (9.04) or Intrepid (8.10)</entry>
147                                                         </row>
148                                                         <row>
149                                                                 <entry>ubuntu-hardy</entry>
150                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
151                                                         </row>
152                                                 </tbody>
153                                         </tgroup>
154                                 </table>
155                                 <indexterm>
156                                         <primary>ZZZ-REVIEW</primary>
157                                         <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>
158                                 </indexterm>
159                                 <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
160                                 <para>This will install a number of packages on the system that are required by OpenSRF, including some Perl modules from CPAN. You can say <literal>No</literal> to the initial CPAN configuration prompt to allow it to automatically configure itself to download and install Perl modules from CPAN. The CPAN installer will ask you a number of times whether it should install prerequisite modules - say <literal>Yes</literal>.</para>
161                         </section>
162                         <section>
163                                 <title>Configure OpenSRF</title>
164                                 <para>As the <systemitem class="username">opensrf</systemitem> user, return to the OpenSRF build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software. You can include the  <option>--enable-python</option> and <option>--enable-java</option> configuration options if you wish to include support for Python and Java, respectively:</para>
165                                 <figure>
166                                         <title>Commands to configure OpenSRF</title>
167                                         <screen>
168                                         $ su - opensrf
169                                         $ cd /home/opensrf/OpenSRF-1.2.2
170                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
171                                         $ make
172                                         ...
173                                         </screen>
174                                 </figure>
175                         </section>
176                         <section>
177                                 <title>Compile, Link and Install OpenSRF</title>
178                                 <para>As the <systemitem class="username">root</systemitem> user, return to the OpenSRF build directory and use the <command>make</command> utility to compile, link and install OpenSRF:</para>
179                                 <figure>
180                                         <title>Commands to build, link and install OpenSRF</title>
181                                         <screen>
182                                         $ su - opensrf
183                                         $ cd /home/opensrf/OpenSRF-1.2.2
184                                         $ make install
185                                         ...
186                                         </screen>
187                                 </figure>
188                         </section>
189                         <section>
190                                 <title>Update the System Dynamic Library Path</title>
191                                 <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a new library path, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>
192                                 <figure>
193                                         <title>Commands to modify system dynamic library path</title>
194                                         <screen>
195                                         $ su - root
196                                         $ echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf
197                                         $ ldconfig
198                                         </screen>
199                                 </figure>
200                         </section>
201                         <section>
202                                 <title>Define Public and Private OpenSRF Domains</title>
203                                 <para>Define your public and private OpenSRF domains. For security purposes, OpenSRF uses Jabber domains to separate services into public and private realms. Throughout these instructions, we will use the example domains <systemitem class="domainname">public.localhost</systemitem> for the public domain and <systemitem class="domainname">private.localhost</systemitem> for the private domain. On a single-server system, the easiest way to define public and private domains is to define separate hostnames by adding entries to the file <filename>/etc/hosts</filename>.</para>
204                                 <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/hosts</filename> and add the following entries for our example domains:</para>
205                                 <figure>
206                                         <title>Example public and private domains in /etc/hosts</title>
207                                         <screen>
208                                         127.0.1.2       public.localhost        public
209                                         127.0.1.3       private.localhost       private
210                                         </screen>
211                                 </figure>
212                         </section>
213                         <section>
214                                 <title>Change File Ownerships</title>
215                                 <para>As the <systemitem class="username">root</systemitem> user, change the ownership of files installed in the directory <filename class="directory">/openils</filename> to the <systemitem class="username">opensrf</systemitem> user:</para>
216                                 <figure>
217                                         <title>Commands to change file ownerships</title>
218                                         <screen>
219                                         $ chown -R opensrf:opensrf /openils
220                                         </screen>
221                                 </figure>
222                         </section>
223                         <section>
224                                 <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>
225                                 <para>As the <systemitem class="username">root</systemitem> user, stop the <systemitem class="service">ejabberd</systemitem> service:</para>
226                                 <figure>
227                                         <title>Commands to stop the <systemitem class="service">ejabberd</systemitem> service</title>
228                                         <screen>
229                                         $ /etc/init.d/ejabberd stop
230                                         </screen>
231                                 </figure>
232                                 <para>If <systemitem class="service">ejabberd</systemitem> reports that it is already stopped, it may have run into a problem starting back at the installation stage. One possible fix is to kill any remaining <systemitem class="daemon">beam</systemitem> and <systemitem class="daemon">epmd</systemitem> processes, then edit the configuration file <filename>/etc/ejabberd/ejabberd.cfg</filename> to hardcode a domain:</para>
233                                 <figure>
234                                         <title>Commands to recover from <systemitem class="service">ejabberd</systemitem> errors</title>
235                                         <screen>
236                                         $ su - root
237                                         $ epmd -kill
238                                         $ killall beam; killall beam.smp
239                                         $ rm /var/lib/ejabberd/*
240                                         $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd
241                                         </screen>
242                                 </figure>
243                         </section>
244                         <section>
245                                 <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>
246                                 <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>
247                                 <itemizedlist>
248                                         <listitem>Change <literal>{hosts, ["localhost"]}.</literal> to <literal>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</literal></listitem>
249                                         <listitem>
250                                                 <para>Change <literal>{max_user_sessions, 10}.</literal> to <literal>{max_user_sessions, 10000}.</literal></para>
251                                                 <para>If you see something like this instead: <literal>{access, max_user_sessions, [{10, all}]}.</literal> then change it to <literal>{access, max_user_sessions, [{10000, all}]}.</literal></para>
252                                         </listitem>
253                                         <listitem>Change all three occurrences of <literal>max_stanza_size</literal> to <literal>2000000</literal>.</listitem>
254                                         <listitem>Change both occurrences of <literal>maxrate</literal> to <literal>500000</literal>.</listitem>
255                                         <listitem>Comment out the line <literal>{mod_offline, []}</literal> by placing two comment signs <literal>%%</literal> in front.</listitem>
256                                 </itemizedlist>
257                         </section>
258                         <section>
259                                 <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>
260                                 <para>As the <systemitem class="username">root</systemitem> user, restart the <systemitem class="service">ejabberd</systemitem> service to test the configuration changes and to register your users:</para>
261                                 <figure>
262                                         <title>Commands to restart the <systemitem class="service">ejabberd</systemitem> service</title>
263                                         <screen>
264                                         $ /etc/init.d/ejabberd start
265                                         </screen>
266                                 </figure>
267                         </section>
268                         <section>
269                                 <title>Register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>
270                                 <para>On each domain, you need two <systemitem class="service">ejabberd</systemitem> users to manage the OpenSRF communications:</para>
271                                 <itemizedlist>
272                                         <listitem>a <systemitem class="username">router</systemitem> user, to whom all requests to connect to an OpenSRF service will be routed; this <systemitem class="service">ejabberd</systemitem> user must be named <systemitem class="username">router</systemitem></listitem>
273                                         <listitem>an <systemitem class="username">opensrf</systemitem> user, which clients use to connect to OpenSRF services; this user can be named anything you like, but we will use <literal>opensrf</literal> in our examples</listitem>
274                                 </itemizedlist>
275                                 <para>As the <systemitem class="username">root</systemitem> user, use the <command>ejabberdctl</command> utility to register your ejabber users <emphasis>router</emphasis> and <emphasis>opensrf</emphasis> for the OpenSRF router service on each domain. The users should have different passwords on each domain. These users will correspond to those configured in the file <filename>/openils/conf/opensrf_core.xml</filename>:</para>
276                                 <figure>
277                                         <title>Commands to register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>
278                                         <programlisting language="xml"><![CDATA[
279 # Syntax for registering a user with ejabberdctl:
280 #    ejabberdctl register <user> <domain> <password>
281 #
282 $ ejabberdctl register router private.localhost  <password>
283 $ ejabberdctl register opensrf private.localhost <password>
284 $ ejabberdctl register router public.localhost   <password>
285 $ ejabberdctl register opensrf public.localhost  <password>
286 ]]></programlisting>
287                                 </figure>
288                         </section>
289                         <section>
290                                 <title>Create configuration files</title>
291                                 <para>As the <systemitem class="username">opensrf</systemitem> user, use the example templates to create the configuration files <filename>/openils/conf/opensrf_core.xml</filename> and <filename>/openils/conf/opensrf.xml</filename>:</para>
292                                 <figure>
293                                         <title>Commands to create configuration files</title>
294                                         <screen>
295                                         $ su - root
296                                         $ cd /openils/conf
297                                         $ cp opensrf.xml.example      opensrf.xml
298                                         $ cp opensrf_core.xml.example opensrf_core.xml
299                                         </screen>
300                                 </figure>
301                         </section>
302                         <section>
303                                 <title>Edit opensrf_core.xml</title>
304                                 <para>Edit the file <filename>/openils/conf/opensrf_core.xml</filename> to change the <systemitem class="service">ejabberd</systemitem> usernames and passwords as follows.</para>
305                                 <note>
306                                         <para>
307                                                 <emphasis>The following example uses common XPath syntax on the left-hand side to indicate the aproximage position needing changes within the XML file.</emphasis>
308                                         </para>
309                                 </note>
310                                 <figure>
311                                         <title>Updates needed in the file <filename>/openils/conf/opensrf_core.xml</filename></title>
312                                         <screen>
313                                         /config/opensrf/username = opensrf
314
315                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
316
317                                         /config/gateway/username = opensrf
318
319                                         /config/gateway/passwd = password for "public.localhost" opensrf user
320
321                                         # first entry, where "transport/server" == "public.localhost" :
322                                         /config/routers/router/transport 
323                                             username = router
324                                             password = password for "public.localhost" router user
325
326                                         # second entry, where "transport/server" == "private.localhost" :
327                                         /config/routers/router/transport
328                                             username = router
329                                             password = password for "private.localhost" router user
330                                         </screen>
331                                 </figure>
332                                 <para>You also need to specify the domains from which OpenSRF will accept and to which it will make connections. If you are installing OpenSRF on a single server and using the <systemitem class="domainname">private.localhost</systemitem> / <systemitem class="domainname">public.localhost</systemitem> domains, these will already be set to the correct values. Otherwise, search and replace to match your values.</para>
333                         </section>
334                         <section>
335                                 <title>Modify the file <filename>opensrf.xml</filename></title>
336                                 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the file <filename>/openils/conf/opensrf.xml</filename> to set the location of the persistent database in the <literal>dbfile</literal> element near the end of the file:</para>
337                                 <figure>
338                                         <title>Example of the file <filename>opensrf.xml</filename></title>
339                                         <programlisting language="xml"><![CDATA[
340 <!-- Example of an app-specific setting override -->
341 <opensrf.persist>
342   <app_settings>
343     <dbfile>/tmp/persist.db</dbfile>
344   </app_settings>
345 </opensrf.persist>
346 ]]></programlisting>
347                                 </figure>
348                         </section>
349                         <section>
350                                 <title>Create Configuration Files for Users Needing <application>srfsh</application></title>
351                                 <para>In this section you will set up a special configuration file for each user who will need to run the <application>srfsh</application> (pronounced <emphasis>surf shell</emphasis>) utility.</para>
352                                 <para>The software installation will automatically create <application>srfsh</application>. This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See <xref linkend="serversideinstallation-testing"/> for further information.</para>
353                                 <para>As the <systemitem class="username">root</systemitem> user, copy the short sample configuration file <filename>/openils/conf/srfsh.xml.example</filename> to the file <filename>.srfsh.xml</filename> (note the leading dot in the file name!) in the home directory of each user who will use <application>srfsh</application>. Finally, edit each file <filename>.srfsh.xml</filename> and make the following changes. When you finish, remember to change the owner of the file to match the owner of the home directory.</para>
354                                 <itemizedlist>
355                                         <listitem>Modify <literal>domain</literal> to be the router hostname (following our domain examples, <systemitem class="domainname">private.localhost</systemitem> will give <application>srfsh</application> access to all OpenSRF services, while <systemitem class="domainname">public.localhost</systemitem> will only allow access to those OpenSRF services that are publicly exposed).</listitem>
356                                         <listitem>Modify <literal>username</literal> and <literal>password</literal> to match the <literal>opensrf</literal> Jabber user for the chosen domain</listitem>
357                                         <listitem>Modify <literal>logfile</literal> to be the full path for a log file to which the user has write access</listitem>
358                                         <listitem>Modify <literal>loglevel</literal> as needed for testing</listitem>
359                                 </itemizedlist>
360                                 <figure>
361                                         <title>Example of the file <filename>/openils/conf/srfsh.xml.example</filename></title>
362                                         <programlisting language="xml"><![CDATA[
363 <?xml version="1.0"?>
364 <!-- This file follows the standard bootstrap config file layout -->
365 <!-- found in opensrf_core.xml -->
366 <srfsh>
367 <router_name>router</router_name>
368 <domain>private.localhost</domain>
369 <username>opensrf</username>
370 <passwd>privsrf</passwd>
371 <port>5222</port>
372 <logfile>/tmp/srfsh.log</logfile>
373 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
374 <loglevel>4</loglevel>
375 </srfsh>]]></programlisting>
376                                 </figure>
377                         </section>
378                         <section>
379                                 <title>Modify <envar>PATH</envar> Environment Variable for User <systemitem class="username">opensrf</systemitem></title>
380                                 <para>As the <systemitem class="username">opensrf</systemitem> user, modify the environmental variable <envar>PATH</envar> by adding a new file path to the <systemitem class="username">opensrf</systemitem> user's shell configuration file <filename>.bashrc</filename>:</para>
381                                 <figure>
382                                         <title>Commands to add path to <filename>.bashrc</filename> configuration file</title>
383                                         <screen>
384                                         $ su - opensrf
385                                         $ echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc
386                                         </screen>
387                                 </figure>
388                         </section>
389                         <section>
390                                 <title>Starting OpenSRF</title>
391                                 <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services:</para>
392                                 <figure>
393                                         <title>Commands to start <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services</title>
394                                         <screen>
395                                         $ su - root
396                                         $ /etc/init.d/ejabberd start
397                                         $ /etc/init.d/memcached start
398                                         </screen>
399                                 </figure>
400                                 <para/>
401                                 <para>Finally, as the <systemitem class="username">opensrf</systemitem> user, start OpenSRF:</para>
402                                 <figure>
403                                         <title>Commands to start OpenSRF</title>
404                                         <screen>
405                                         $ su - opensrf
406
407                                         # ensure you have the needed path
408                                         $ export PATH=$PATH:/openils/bin
409
410                                         # start the OpenSRF service:
411                                         # use "-l" to force hostname to be "localhost"
412                                         $ osrf_ctl.sh -l -a start_all     
413                                         </screen>
414                                 </figure>
415                                 <note>
416                                         <para>
417                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but <emphasis>osrf_ctl.sh</emphasis> must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>
418                                         </para>
419                                 </note>
420                         </section>
421                         <section>
422                                 <title>Testing connections to OpenSRF</title>
423                                 <para>Once you have installed and started OpenSRF, as the <systemitem class="username">root</systemitem> user, test your connection to OpenSRF using the <application>srfsh</application> utility and trying to call the <emphasis>add</emphasis> method on the OpenSRF <systemitem class="service">math</systemitem> service:</para>
424                                 <figure>
425                                         <title>Commands to test OpenSRF with <application>srfsh</application></title>
426                                         <screen>
427                                         $ su - opensrf
428                                         $ /openils/bin/srfsh
429                                         srfsh#  request opensrf.math add 2 2
430                                         Received Data: 4
431                                         ------------------------------------
432                                         Request Completed Successfully
433                                         Request Time in seconds: 0.007519
434                                         ------------------------------------
435                                         srfsh#
436                                         </screen>
437                                 </figure>
438                                 <para>For other <application>srfsh</application> commands, type <userinput>help</userinput> at the prompt.</para>
439                         </section>
440                         <section>
441                                 <title>Stopping OpenSRF</title>
442                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop OpenSRF:</para>
443                                 <figure>
444                                         <title>Commands to stop OpenSRF</title>
445                                         <screen>
446                                         $ su - opensrf
447                                         $ osrf_ctl.sh -l -a stop_all
448                                         </screen>
449                                 </figure>
450                         </section>
451                 </section>
452                 <section xml:id="serversideinstallation-ubuntudebian">
453                         <title>Installing Evergreen 1.6.x.x On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>
454                         <para>This section outlines the installation process for the latest stable version of Evergreen.</para>
455                         <para>In this section you will download, unpack, install, configure and test the Evergreen system, including the Evergreen server and the PostgreSQL database system. You will make several configuration changes and adjustments to the software, including updates to configure the system for your own locale, and some updates needed to work around a few known issues.</para>
456                         <note>
457                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) architectures. There may be differences between the Desktop and Server editions of Ubuntu. These instructions assume the Server edition.</para>
458                                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>
459                                 <itemizedlist>
460                                         <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>
461                                         <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>
462                                 </itemizedlist>
463                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue the command <command>exit</command>.</para>
464                         </note>
465                         <section xml:id="serversideinstallation-opensrf-overview">
466                                 <title>Installing OpenSRF</title>
467                                 <para>Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see <xref linkend="serversideinstallation-opensrf"/>.</para>
468                                 <para>Follow the steps outlined in that section and run the specified tests to ensure that OpenSRF is properly installed and configured. Do not continue with any further Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>
469                         </section>
470                         <section>
471                                 <title>Download and Unpack Latest Evergreen Version</title>
472                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of Evergreen. The latest version can be found here: <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz"></ulink></para>
473                                 <figure>
474                                         <title>Commands to download and unpack Evergreen</title>
475                                         <screen>
476                                         $ su - opensrf
477                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz
478                                         $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz
479                                         </screen>
480                                 </figure>
481                                 <para>The new directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7</filename> will be created.</para>
482                         </section>
483                         <section>
484                                 <title>Install Prerequisites to Build Evergreen</title>
485                                 <para>In this section you will install and configure a set of prerequisites that will be used to build Evergreen. In a following step you will actually build the software using the <command>make</command> utility.</para>
486                                 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[distribution]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-2">"Keywords"</link> figure below.</para>
487                                 <figure>
488                                         <title>Commands to install prerequisites for Evergreen</title>
489                                         <screen>
490                                         $ su - root
491                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
492                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]
493                                         ...
494                                         </screen>
495                                 </figure>
496                                 <table xml:id="serversideinstallation-keywords-figure-2">
497                                         <title>Keywords Targets for <application>make</application></title>
498                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
499                                                 <colspec colnum="1" colwidth="1*"/>
500                                                 <colspec colnum="2" colwidth="3*"/>
501                                                 <thead>
502                                                         <row>
503                                                                 <entry>Keyword</entry>
504                                                                 <entry>Description</entry>
505                                                         </row>
506                                                 </thead>
507                                                 <tbody>
508                                                         <row>
509                                                                 <entry>debian-lenny</entry>
510                                                                 <entry>for Debian Lenny (5.0), the most recent version</entry>
511                                                         </row>
512                                                         <row>
513                                                                 <entry>debian-etch</entry>
514                                                                 <entry>for Debian Etch (4.0)</entry>
515                                                         </row>
516                                                         <row>
517                                                                 <entry>ubuntu-karmic</entry>
518                                                                 <entry>for Ubuntu Lucid (10.04) [same as for Karmic]</entry>
519                                                         </row>
520                                                         <row>
521                                                                 <entry>ubuntu-karmic</entry>
522                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
523                                                         </row>
524                                                         <row>
525                                                                 <entry>ubuntu-intrepid</entry>
526                                                                 <entry>for Ubuntu Intrepid (8.10)</entry>
527                                                         </row>
528                                                         <row>
529                                                                 <entry>ubuntu-hardy</entry>
530                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
531                                                         </row>
532                                                         <row>
533                                                                 <entry>ubuntu-gutsy</entry>
534                                                                 <entry>for Ubuntu Gutsy (7.10)</entry>
535                                                         </row>
536                                                         <row>
537                                                                 <entry>gentoo</entry>
538                                                                 <entry>generic for Gentoo versions</entry>
539                                                         </row>
540                                                         <row>
541                                                                 <entry>centos</entry>
542                                                                 <entry>generic for Centos versions</entry>
543                                                         </row>
544                                                 </tbody>
545                                         </tgroup>
546                                 </table>
547                                 <indexterm>
548                                         <primary>ZZZ-REVIEW</primary>
549                                         <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>
550                                 </indexterm>
551                                 <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
552                         </section>
553                         <section>
554                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>
555                                 <para>Since the PostgreSQL server is usually a standalone server in multi-server production systems, the prerequisite installer Makefile in the previous step does not automatically install PostgreSQL. If your PostgreSQL server is on a different system, just skip this step.</para>
556                                 <para>For further information on installing PostgreSQL, see <xref linkend="serversideinstallation-postgresql"/>.</para>
557                                 <para>If your PostgreSQL server will be on the same system as your Evergreen software, then as the <systemitem class="username">root</systemitem> user install the required PostgreSQL server packages:</para>
558                                 <figure>
559                                         <title>Commands to install the PostgreSQL server</title>
560                                         <screen>
561                                         $ su - root
562         
563                                         # Debian Lenny and Ubuntu Hardy (8.04)
564                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
565                                         ...
566
567                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
568                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
569                                         ...
570                                         </screen>
571                                 </figure>
572                                 <note>
573                                         <para>
574                                                 <emphasis>PostgreSQL 8.1 is deprecated and will become unsupported in a future release, though existing installations upgrading from Evergreen 1.4 or before will work fine. However, consider upgrading your Postgres soon!</emphasis>
575                                         </para>
576                                 </note>
577                                 <indexterm>
578                                         <primary>ZZZ-REVIEW</primary>
579                                         <secondary>VERIFY: IS THIS STILL TRUE? </secondary>
580                                 </indexterm>
581                                 <caution>VERIFY: IS THIS STILL TRUE? </caution>
582                                 <indexterm>
583                                         <primary>ZZZ-REVIEW</primary>
584                                         <secondary>ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE </secondary>
585                                 </indexterm>
586                                 <caution>ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE </caution>
587                         </section>
588                         <section>
589                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
590                                 <para>If PostgreSQL is running on the same system as your Evergreen software, then the Perl modules will automatically be available. Just skip this step.</para>
591                                 <para>Otherwise, if your PostgreSQL server is running on another system, then as the <systemitem class="username">root</systemitem> user install the following Perl modules on that system:</para>
592                                 <figure>
593                                         <title>Commands to install Perl modules</title>
594                                         <screen>
595                                         # ensure the gcc compiler is installed
596                                         $ su - root
597                                         $ aptitude install gcc
598         
599                                         # install the Perl modules
600                                         $ perl -MCPAN -e shell
601                                         cpan> install JSON::XS
602                                         cpan> install MARC::Record
603                                         cpan> install MARC::File::XML
604                                         </screen>
605                                 </figure>
606                                 <indexterm>
607                                         <primary>ZZZ-REVIEW</primary>
608                                         <secondary>ADD INFO ON HOW TO INSTALL THE PERL MODULES </secondary>
609                                 </indexterm>
610                                 <caution>ADD INFO ON HOW TO INSTALL THE PERL MODULES </caution>
611                                 <indexterm>
612                                         <primary>ZZZ-REVIEW</primary>
613                                         <secondary>ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </secondary>
614                                 </indexterm>
615                                 <caution>ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </caution>
616                         </section>
617                         <section>
618                                 <title>Update the System Dynamic Library Path</title>
619                                 <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/eg.conf</filename> containing two new library paths, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>
620                                 <figure>
621                                         <title>Commands to modify system dynamic library path</title>
622                                         <screen>
623                                         $ su - root
624                                         $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
625                                         /usr/local/lib
626                                         /usr/local/lib/dbd
627                                         ENDOFFILE
628                                         $ ldconfig
629                                         </screen>
630                                 </figure>
631                         </section>
632                         <section>
633                                 <title>(OPTIONAL) Restart the PostgreSQL Server</title>
634                                 <para>If PostgreSQL is running on the same system as the rest of Evergreen, as the <systemitem class="username">root</systemitem> user you must restart the PostgreSQL server to avoid a problem where the library <filename>plperl.so</filename> cannot be found. If your PostgreSQL server is running on another system, just skip this step.</para>
635                                 <indexterm>
636                                         <primary>ZZZ-REVIEW</primary>
637                                         <secondary>ADD INFO ON OTHER VERSIONS OF POSTGRESQL </secondary>
638                                 </indexterm>
639                                 <caution>ADD INFO ON OTHER VERSIONS OF POSTGRESQL </caution>
640                                 <figure>
641                                         <title>Commands to restart PostgreSQL server</title>
642                                         <screen>
643                                         $ su - root
644                                         $ /etc/init.d/postgresql-PGSQL_VERSION restart
645                                         </screen>
646                                 </figure>
647                                 <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</emphasis>
648                         </section>
649                         <section xml:id="serversideinstallation-configure">
650                                 <title>Configure Evergreen</title>
651                                 <para>As the <systemitem class="username">opensrf</systemitem> user, return to the Evergreen build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software:</para>
652                                 <figure>
653                                         <title>Commands to configure Evergreen</title>
654                                         <screen>
655                                         $ su - opensrf
656                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
657                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
658                                         $ make
659                                         ...
660                                         </screen>
661                                 </figure>
662                         </section>
663                         <section xml:id="serversideinstallation-compilingevergreen">
664                                 <title>Compile, Link and Install Evergreen</title>
665                                 <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>
666                                 <para>As the <systemitem class="username">root</systemitem> user, return to the Evergreen build directory and use the <command>make</command> utility as shown below. The Staff Client will also be automatically built, but you must remember to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the Staff Client you will use to connect to the Evergreen server.</para>
667                                 <para>For further information on manually building the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>
668                                 <figure>
669                                         <title>Commands to build, link and install Evergreen</title>
670                                         <screen>
671                                         $ su - root
672                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
673                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
674                                         ...
675                                         </screen>
676                                         <para>The above commands will create a new subdirectory <filename class="directory">/openils/var/web/xul/rel_1_6_0_7</filename> containing the Staff Client.</para>
677                                 </figure>
678                                 <para>To complete the Staff Client installation, as the <systemitem class="username">root</systemitem> user create a symbolic link named <emphasis>server</emphasis> in the head of the Staff Client directory <filename class="directory">/openils/var/web/xul</filename> that points to the subdirectory <filename class="directory">/server</filename> of the new Staff Client build:</para>
679                                 <figure>
680                                         <title>Commands to create symbolic link</title>
681                                         <screen>
682                                         $ su - root
683                                         $ cd /openils/var/web/xul
684                                         $ ln -sf rel_1_6_0_7/server server
685                                         </screen>
686                                 </figure>
687                         </section>
688                         <section>
689                                 <title>Copy the OpenSRF Configuration Files</title>
690                                 <para>As the <systemitem class="username">root</systemitem> user, copy the example OpenSRF configuration files into place. This replaces the configuration files that you set up in a previous step when you installed and tested OpenSRF. You should also create backup copies of the old files for troubleshooting purposes. Finally, change the ownership on the installed files to the <systemitem class="username">opensrf</systemitem> user:</para>
691                                 <figure>
692                                         <title>Commands to copy OpenSRF configuration files</title>
693                                         <screen>
694                                         $ su - root
695                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
696                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
697                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
698                                         $ chown -R opensrf:opensrf /openils/
699                                         </screen>
700                                 </figure>
701                         </section>
702                         <section>
703                                 <title>Create and Configure PostgreSQL Database</title>
704                                 <para>As the <systemitem class="username">postgres</systemitem> user on your PostgreSQL server, create the Evergreen database.</para>
705                                 <para>In the commands below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis> repository to match your PostgreSQL server layout. For example, if you built PostgreSQL from source the path would be <filename class="directory">/usr/local/share/contrib</filename>; if you installed the PostgreSQL 8.3 server packages on Ubuntu 8.04, the path would be <filename class="directory">/usr/share/postgresql/8.3/contrib/</filename>.</para>
706                                 <procedure>
707                                         <step>
708                                                 <para>
709                                                         <emphasis role="bold">Create and configure the database</emphasis>
710                                                 </para>
711                                                 <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
712                                                 <figure>
713                                                         <title>Commands to create database and adjust the path</title>
714                                                         <screen>
715                                                         # create the database
716                                                         $ su - postgres
717                                                         $ createdb -E UNICODE evergreen
718                                                         $ createlang plperl   evergreen
719                                                         $ createlang plperlu  evergreen
720                                                         $ createlang plpgsql  evergreen
721                 
722                                                         # adjust the paths
723                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen
724                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen
725                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen
726                                                         </screen>
727                                                 </figure>
728                                                 <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</emphasis>
729                                         </step>
730                                         <step>
731                                                 <para>
732                                                         <emphasis role="bold">Create new Evergreen superuser</emphasis>
733                                                 </para>
734                                                 <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system, create the new database <systemitem class="username">evergreen</systemitem> user and assign a password:</para>
735                                                 <figure>
736                                                         <title>Commands to create the <systemitem class="username">evergreen</systemitem> user</title>
737                                                         <screen>
738                                                         # create superuser 'evergreen' and set the password
739                                                         $ su - postgres
740                                                         $ createuser -P -s evergreen
741                                                         Enter password for new role: MYNEWPASSWORD
742                                                         Enter it again: MYNEWPASSWORD
743                                                         </screen>
744                                                 </figure>
745                                                 <emphasis>Where <literal>MYNEWPASSWORD</literal> is the password chosen.</emphasis>
746                                         </step>
747                                 </procedure>
748                         </section>
749                         <section>
750                                 <title>Create Database Schema</title>
751                                 <para>As the <systemitem class="username">root</systemitem> user, create the database schema and configure your system with the corresponding database authentication details for the <emphasis>evergreen</emphasis> database user that you created in the previous step.</para>
752                                 <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>
753                                 <figure>
754                                         <title>Commands to create Evergreen database schema</title>
755                                         <screen>
756                                         $ su - root
757                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
758                                         $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
759                                                 --service all --create-schema --create-bootstrap --create-offline \
760                                                 --hostname HOSTNAME --port PORT \
761                                                 --user evergreen --password PASSWORD --database DATABASENAME
762                                         </screen>
763                                 </figure>
764                                 <emphasis>Where, on most systems, <emphasis>HOSTNAME</emphasis> will be <emphasis role="bold">localhost</emphasis>, <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>, and <emphasis>PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> will be those assigned when PostgreSQL was installed in the previous step.</emphasis>
765                                 <note>
766                                         <para>
767                                                 <emphasis>If you are entering the above command on a single line, do not include the <literal>\</literal> (backslash) characters. If you are using the <command>bash</command> shell, these should only be used at the end of a line at a bash prompt to indicate that the command is continued on the next line.</emphasis>
768                                         </para>
769                                 </note>
770                         </section>
771                         <section>
772                                 <title>Configure the Apache Server</title>
773                                 <para>As the <systemitem class="username">root</systemitem> user, configure the Apache server and copy several new configuration files to the Apache server directories:</para>
774                                 <figure>
775                                         <title>Commands to configure the Apache server</title>
776                                         <screen>
777                                         # configure the Apache server
778                                         $ su - root
779                                         $ a2enmod ssl        # enable mod_ssl
780                                         $ a2enmod rewrite    # enable mod_rewrite
781                                         $ a2enmod expires    # enable mod_expires
782                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
783         
784                                         # copy files
785                                         $ cp Open-ILS/examples/apache/eg.conf    /etc/apache2/sites-available/
786                                         $ cp Open-ILS/examples/apache/eg_vhost.conf   /etc/apache2/
787                                         $ cp Open-ILS/examples/apache/startup.pl      /etc/apache2/
788                                         </screen>
789                                 </figure>
790                         </section>
791                         <section>
792                                 <title>Create a Security Certificate (SSL Key)</title>
793                                 <para>Use the command <command>openssl</command> to create a new SSL key for your Apache server. For a public production server you should configure or purchase a signed SSL certificate, but for now you can just use a self-signed certificate and accept the warnings in the Staff Client and browser during testing and development:</para>
794                                 <figure>
795                                         <title>Commands to create an SSL key</title>
796                                         <screen>
797                                         $ mkdir /etc/apache2/ssl
798                                         $ cd /etc/apache2/ssl
799                                         $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
800                                         </screen>
801                                 </figure>
802                                 <warning>
803                                         <para>
804                                                 <emphasis>This is only a temporary measure to expedite testing. You <emphasis role="bold">must</emphasis> get a proper SSL certificate for a public production system.</emphasis>
805                                         </para>
806                                 </warning>
807                                 <indexterm>
808                                         <primary>ZZZ-REVIEW</primary>
809                                         <secondary>ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </secondary>
810                                 </indexterm>
811                                 <caution>ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </caution>
812                         </section>
813                         <section xml:id="serversideinstallation-modify-apache">
814                                 <title>Modify the Apache Configuration File</title>
815                                 <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/sites-available/eg.conf</filename> and make the following changes:</para>
816                                 <procedure>
817                                         <step>
818                                                 <para>Comment out the line <literal>Allow from 10.0.0.0/8</literal>, then uncomment the line <literal>Allow from all</literal>.</para>
819                                                 <para>
820                                                         <emphasis>This change allows access to your configuration CGI scripts from <emphasis role="bold">any</emphasis> workstation on <emphasis role="bold">any</emphasis> network. This is only a temporary change to expedite testing and should be removed after you have finished and successfully tested the Evergreen installation.</emphasis>
821                                                 </para>
822                                                 <warning>
823                                                         <para>
824                                                                 <emphasis>You must remove these changes after testing is completed. See <xref linkend="serversideinstallation-postinstallation"/> for further details on removing this change after the Evergreen installation is complete.</emphasis>
825                                                         </para>
826                                                 </warning>
827                                         </step>
828                                         <step>
829                                                 <para>Comment out the line <literal>Listen 443</literal> as it conflicts with the same declaration in the configuration file: <filename>/etc/apache2/ports.conf</filename>. <systemitem class="osname">Debian Etch</systemitem> users should not do this.</para>
830                                                 <indexterm>
831                                                         <primary>ZZZ-REVIEW</primary>
832                                                         <secondary>ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </secondary>
833                                                 </indexterm>
834                                                 <caution>ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </caution>
835                                         </step>
836                                         <step>
837                                                 <para>The following updates are needed to allow the logs to function properly, but it may break other Apache applications on your server. We hope to make this unnecessary in a future Evergreen release.</para>
838                                                 <itemizedlist>
839                                                         <listitem>
840                                                                 <para>For the <systemitem class="osname">Linux</systemitem> distributions <systemitem class="osname">Ubuntu Hardy</systemitem> or <systemitem class="osname">Debian Etch</systemitem>, as the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and change the user: <emphasis role="bold">www-data</emphasis> to the user: <systemitem class="username">opensrf</systemitem>.</para>
841                                                         </listitem>
842                                                         <listitem>
843                                                                 <para>For the <systemitem class="osname">Linux</systemitem> distributions <systemitem class="osname">Ubuntu Karmic</systemitem> or <systemitem class="osname">Ubuntu Lucid</systemitem> or <systemitem class="osname">Debian Lenny</systemitem>, as the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/envvars</filename> and change the phrase: <emphasis role="bold">export APACHE_RUN_USER=www-data</emphasis> to the phrase: <emphasis role="bold">export APACHE_RUN_USER=opensrf</emphasis>.</para>
844                                                         </listitem>
845                                                 </itemizedlist>
846                                         </step>
847                                         <step>
848                                                 <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and add the line <emphasis role="bold">KeepAliveTimeout 1</emphasis>, or modify an existing line if it already exists.</para>
849                                         </step>
850                                 </procedure>
851                         </section>
852                         <section>
853                                 <title>(OPTIONAL) Performance Modifications for Apache</title>
854                                 <para>Some further configuration changes to Apache may be necessary for busy systems. These changes increase the number of Apache server processes that are started to support additional browser connections.</para>
855                                 <procedure>
856                                         <step>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename>, locate and modify the section related to <emphasis>prefork configuration</emphasis> to suit the load on your system.</step>
857                                         <step>
858                                                 <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and add the line <emphasis role="bold">MaxKeepAliveRequests 100</emphasis>, or modify an existing line if it already exists.</para>
859                                                 <figure>
860                                                         <title>(OPTIONAL) Example of updates to Apache configuration</title>
861                                                         <programlisting language="xml"><![CDATA[
862 <IfModule mpm_prefork_module>
863    StartServers           20
864    MinSpareServers         5
865    MaxSpareServers        15
866    MaxClients            150
867    MaxRequestsPerChild 10000
868 </IfModule>
869 MaxKeepAliveRequests 100
870 ]]></programlisting>
871                                                 </figure>
872                                         </step>
873                                 </procedure>
874                         </section>
875                         <section>
876                                 <title>Enable the Evergreen Site</title>
877                                 <para>As the <systemitem class="username">root</systemitem> user, execute the following Apache configuration commands to disable the default <emphasis>It Works</emphasis> web page and to enable the Evergreen web site:</para>
878                                 <figure>
879                                         <title>Commands to enable the Evergreen Web Site</title>
880                                         <screen>
881                                         $ su - root
882
883                                         # disable the default site
884                                         $ a2dissite default
885         
886                                         # enable the Evergreen web site
887                                         $ a2ensite eg.conf
888                                         </screen>
889                                 </figure>
890                         </section>
891                         <section>
892                                 <title>Modify the OpenSRF Configuration File</title>
893                                 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename> to update the Jabber usernames and passwords, and to specify the domain from which we will accept and to which we will make connections.</para>
894                                 <para>If you are installing Evergreen on a single server and using the <systemitem class="domainname">private.localhost</systemitem> / <systemitem class="domainname">public.localhost</systemitem> domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values.</para>
895                                 <note>
896                                         <para>
897                                                 <emphasis>The following example uses common XPath syntax on the left-hand side to indicate the approximate position needing changes within the XML file:</emphasis>
898                                         </para>
899                                 </note>
900                                 <indexterm>
901                                         <primary>ZZZ-REVIEW</primary>
902                                         <secondary>ADD A BETTER DIAGRAM HERE </secondary>
903                                 </indexterm>
904                                 <caution>ADD A BETTER DIAGRAM HERE </caution>
905                                 <figure>
906                                         <title>Updates needed in the file <filename>/openils/conf/opensrf_core.xml</filename></title>
907                                         <screen>
908                                         /config/opensrf/username = opensrf
909         
910                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
911         
912                                         /config/gateway/username = opensrf
913         
914                                         /config/gateway/passwd = password for "public.localhost" opensrf user
915         
916                                         # first entry, where "transport/server" == "public.localhost" :
917                                         /config/routers/router/transport 
918                                             username = router
919                                             password = password for "public.localhost" router user
920
921                                         # second entry, where "transport/server" == "private.localhost" :
922                                         /config/routers/router/transport
923                                             username = router
924                                             password = password for "private.localhost" router user
925                                         </screen>
926                                 </figure>
927                         </section>
928                         <section>
929                                 <title>Create Configuration Files for Users Needing <application>srfsh</application></title>
930                                 <para>The software installation will automatically create a utility named <application>srfsh</application> (surf shell). This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See <xref linkend="serversideinstallation-testing"/> for further information.</para>
931                                 <para>In this section you will set up a special configuration file for each user who will need to run the utility. Copy the short sample configuration file <filename>/openils/conf/srfsh.xml.example</filename> to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of each user who will use <application>srfsh</application>. Finally, edit each users' <filename>.srfsh.xml</filename> file and make the following changes:</para>
932                                 <procedure>
933                                         <step>Modify <emphasis role="bold">domain</emphasis> to be the router hostname (following our domain examples, <systemitem class="domainname">private.localhost</systemitem>> will give <application>srfsh</application> access to all OpenSRF services, while <systemitem class="domainname">public.localhost</systemitem> will only allow access to those OpenSRF services that are publicly exposed).</step>
934                                         <step>Modify <emphasis role="bold">username</emphasis> and <emphasis role="bold">password</emphasis> to match the <systemitem class="username">opensrf</systemitem> Jabber user for the chosen domain</step>
935                                         <step>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</step>
936                                         <step>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</step>
937                                 </procedure>
938                                 <figure>
939                                         <title>Example of user's file <filename>.srfsh.xml</filename></title>
940                                         <programlisting language="xml"><![CDATA[
941 <?xml version="1.0"?>
942 <!-- This file follows the standard bootstrap config file layout -->
943 <!-- found in opensrf_core.xml -->
944 <srfsh>
945 <router_name>router</router_name>
946 <domain>private.localhost</domain>
947 <username>opensrf</username>
948 <passwd>evergreen</passwd>
949 <port>5222</port>
950 <logfile>/tmp/srfsh.log</logfile>
951 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
952 <loglevel>4</loglevel>
953 </srfsh>
954 ]]></programlisting>
955                                 </figure>
956                         </section>
957                         <section>
958                                 <title>Modify the OpenSRF Environment</title>
959                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change the permissions of <emphasis>.cgi</emphasis> files in the directory <filename class="directory">/openils/var/cgi-bin</filename> to <emphasis>executable</emphasis>, then modify the shell configuration file <filename>~/.bashrc</filename> for <systemitem class="username">opensrf</systemitem> by adding a Perl environmental variable. Finally, execute the shell configuration file to load the new variables into your current environment.</para>
960                                 <note>
961                                         <para>
962                                                 <emphasis>In a multi-server environment, you must add any modifications to <filename>~/.bashrc</filename> to the top of the file <emphasis>before</emphasis> the line <literal>[ -z "$PS1" ] &amp;&amp; return </literal>. This will allow headless (scripted) logins to load the correct environment.</emphasis>
963                                         </para>
964                                 </note>
965                                 <figure>
966                                         <title>Commands to modify the OpenSRF environment</title>
967                                         <screen>
968                                         # change permissions
969                                         $ su - opensrf
970                                         $ chmod 755 /openils/var/cgi-bin/*.cgi
971         
972                                         # add environmental variable
973                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
974         
975                                         # inherit the new environment
976                                         $ . ~/.bashrc
977                                         </screen>
978                                 </figure>
979                         </section>
980                         <section xml:id="serversideinstallation-starting">
981                                 <title>Starting Evergreen</title>
982                                 <procedure>
983                                         <step>
984                                                 <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services (if they are not already running):</para>
985                                                 <figure>
986                                                         <title>Commands to start <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services</title>
987                                                         <screen>
988                                                         $ su - root
989                                                         $ /etc/init.d/ejabberd start
990                                                         $ /etc/init.d/memcached start
991                                                         </screen>
992                                                 </figure>
993                                         </step>
994                                         <step>
995                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, start Evergreen.</para>
996                                                 <para>Use the flag <emphasis>-l</emphasis> to force Evergreen to use <emphasis>localhost</emphasis> (your current system) as the hostname. Using the <emphasis>start_all</emphasis> option will start the OpenSRF router, Perl services, and C services:</para>
997                                                 <figure>
998                                                         <title>Commands to start Evergreen</title>
999                                                         <screen>
1000                                                         $ su - opensrf
1001
1002                                                         # ensure you have the needed path
1003                                                         $ export PATH=$PATH:/openils/bin
1004
1005                                                         # start the OpenSRF service:
1006                                                         # use "-l" to force hostname to be "localhost"
1007                                                         $ osrf_ctl.sh -l -a start_all     
1008                                                         </screen>
1009                                                 </figure>
1010                                                 <note>
1011                                                         <para>
1012                                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but the <command>osrf_ctl.sh</command> utility must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>
1013                                                         </para>
1014                                                         <para>Execute the following command to determine the fully qualified domain name of your system:</para>
1015                                                         <figure>
1016                                                                 <title>(OPTIONAL) Commands to determine the fully qualified domain name</title>
1017                                                                 <screen>
1018                                                                 $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
1019                                                                 </screen>
1020                                                         </figure>
1021                                                 </note>
1022                                                 <indexterm>
1023                                                         <primary>ZZZ-REVIEW</primary>
1024                                                         <secondary>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </secondary>
1025                                                 </indexterm>
1026                                                 <caution>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1027                                                 <itemizedlist>
1028                                                         <listitem>
1029                                                                 <para>When you attempt to start Evergreen, if you receive an error message similar to <emphasis>osrf_ctl.sh: command not found</emphasis>, then your environment variable <envar>PATH</envar> does not include the directory <filename class="directory">/openils/bin</filename>. As the <systemitem class="username">opensrf</systemitem> user, edit the configuration file <filename>/home/opensrf/.bashrc</filename> and add the following line: <literal>export PATH=$PATH:/openils/bin</literal></para>
1030                                                         </listitem>
1031                                                         <listitem>
1032                                                                 <para>When you attempt to start Evergreen, if you receive an error message similar to <emphasis>Can't locate OpenSRF/System.pm in @INC ... BEGIN failed--compilation aborted</emphasis>, then your environment variable <emphasis role="bold">PERL5LIB</emphasis> does not include the directory <filename class="directory">/openils/lib/perl5</filename>. As the <systemitem class="username">opensrf</systemitem> user, edit the configuration file <filename>/home/opensrf/.bashrc</filename> and add the following line: <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>
1033                                                         </listitem>
1034                                                 </itemizedlist>
1035                                         </step>
1036                                         <step>
1037                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, generate the Web files needed by the Staff Client and catalogue, and calculate the proximity of locations in the Organizational Unit tree (which allows <emphasis>Holds</emphasis> to work properly).</para>
1038                                                 <para>You must do this the first time you start Evergreen, and after making any changes to the library hierarchy in the configuration file <filename>config.cgi</filename>.</para>
1039                                                 <figure>
1040                                                         <title>Commands to generate web files</title>
1041                                                         <screen>
1042                                                         $ su - opensrf
1043                                                         $ cd /openils/bin
1044                                                         $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u
1045                                                         Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
1046                                                         Updating fieldmapper
1047                                                         ...
1048                                                         </screen>
1049                                                 </figure>
1050                                                 <indexterm>
1051                                                         <primary>ZZZ-REVIEW</primary>
1052                                                         <secondary>ADD RESULTS OF TESTS FROM "autogen.sh" </secondary>
1053                                                 </indexterm>
1054                                                 <caution>ADD RESULTS OF TESTS FROM <filename>autogen.sh</filename> </caution>
1055                                         </step>
1056                                         <step>
1057                                                 <para>As the <systemitem class="username">root</systemitem> user, restart the Apache Web server:</para>
1058                                                 <figure>
1059                                                         <title>Commands to restart Apache web server</title>
1060                                                         <screen>
1061                                                         $ su - root
1062                                                         $ /etc/init.d/apache2 restart
1063                                                         </screen>
1064                                                 </figure>
1065                                                 <note>If the Apache Web server was running when you started the OpenSRF services, you might not be able to successfully log in to the OPAC or Staff Client until the Apache Web server is restarted.</note>
1066                                         </step>
1067                                 </procedure>
1068                         </section>
1069                         <section xml:id="serversideinstallation-testing">
1070                                 <title>Testing the Installation</title>
1071                                 <para>This section describes several simple tests you can perform to verify that the Evergreen server-side software has been installed and configured properly and is running as expected.</para>
1072                                 <section xml:id="serversideinstallation-testing-connections">
1073                                         <title>Testing Connections to Evergreen</title>
1074                                         <para>Once you have installed and started Evergreen, test your connection to Evergreen. As the <systemitem class="username">opensrf</systemitem> user start the <application>srfsh</application> application and try logging onto the Evergreen server using the default administrator username and password. Following is sample output generated by executing that script after a successful Evergreen installation:</para>
1075                                         <figure>
1076                                                 <title>Commands to test Evergreen with <application>srfsh</application></title>
1077                                                 <screen>
1078                                                 $ su - opensrf
1079                                                 $ /openils/bin/srfsh
1080                                                 srfsh% login admin open-ils
1081                                                 Received Data: "250bf1518c7527a03249858687714376"
1082                                                 ------------------------------------
1083                                                 Request Completed Successfully
1084                                                 Request Time in seconds: 0.045286
1085                                                 ------------------------------------
1086                                                 Received Data: {
1087                                                    "ilsevent":0,
1088                                                    "textcode":"SUCCESS",
1089                                                    "desc":" ",
1090                                                    "pid":21616,
1091                                                    "stacktrace":"oils_auth.c:304",
1092                                                    "payload":{
1093                                                       "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
1094                                                       "authtime":420
1095                                                    }
1096                                                 }
1097                                                 ------------------------------------
1098                                                 Request Completed Successfully
1099                                                 Request Time in seconds: 1.336568
1100                                                 ------------------------------------
1101                                                 </screen>
1102                                         </figure>
1103                                 </section>
1104                                 <section>
1105                                         <title>Other Connection Tests with <application>srfsh</application></title>
1106                                         <para></para>
1107                                         <para>There is another <application>srfsh</application> command called <command>math_bench</command> that sends queries to the math servers. Note that the <systemitem class="service">opensrf.math</systemitem> and <systemitem class="service">opensrf.dbmath</systemitem> must be running for this command to work:</para>
1108                                         <figure>
1109                                                 <title>Example of math_bench usage</title>
1110                                                 <screen>
1111                                                 srfsh# math_bench 10
1112                                                 |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
1113                                                 ++++++++++++++++++++++++++++++++++++++++
1114                                                 Average round trip time: 0.033425
1115                                                 srfsh#
1116                                                 </screen>
1117                                         </figure>
1118                                         <para>The first argument is how many sets of 4 queries (+ - * /) are sent to <systemitem class="service">opensrf.math</systemitem>. When the response is successful, you will see the string of <literal>+</literal> symbols. If the system is not running correctly, you will either get an exception or no result at all.</para>
1119                                         <para>For other <application>srfsh</application> commands, type <userinput>help</userinput> in at the prompt.</para>
1120                                         <para/>
1121                                         <para>If this does not work, try the troubleshooting steps in the following section.</para>
1122                                 </section>
1123                                 <section>
1124                                         <title>Testing with <application>settings-tester.pl</application></title>
1125                                         <para>As the <systemitem class="username">opensrf</systemitem> user, run the script <command>settings-tester.pl</command> to see if it finds any system configuration problems. Following is sample output generated by executing that script after a successful Evergreen installation:</para>
1126                                         <section>
1127                                                 <title>Example of execution of <command>settings-tester.pl</command></title>
1128                                                 <programlisting language="xml"><![CDATA[
1129                                                 $ su - root
1130                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.0
1131                                                 $ perl Open-ILS/src/support-scripts/settings-tester.pl
1132                                                 LWP::UserAgent version 5.810
1133                                                 XML::LibXML version 1.70
1134                                                 XML::LibXML::XPathContext version 1.70
1135                                                 XML::LibXSLT version 1.70
1136                                                 Net::Server::PreFork version 0.97
1137                                                 Cache::Memcached version 1.24
1138                                                 Class::DBI version 0.96
1139                                                 Class::DBI::AbstractSearch version 0.07
1140                                                 Template version 2.19
1141                                                 DBD::Pg version 2.8.2
1142                                                 Net::Z3950::ZOOM version 1.24
1143                                                 MARC::Record version 2.0.0
1144                                                 MARC::Charset version 1.1
1145                                                 MARC::File::XML version 0.92
1146                                                 Text::Aspell version 0.04
1147                                                 CGI version 3.29
1148                                                 DateTime::TimeZone version 0.7701
1149                                                 DateTime version 0.42
1150                                                 DateTime::Format::ISO8601 version 0.06
1151                                                 DateTime::Format::Mail version 0.3001
1152                                                 Unix::Syslog version 1.1
1153                                                 GD::Graph3d version 0.63
1154                                                 JavaScript::SpiderMonkey version 0.19
1155                                                 Log::Log4perl version 1.16
1156                                                 Email::Send version 2.192
1157                                                 Text::CSV version 1.06
1158                                                 Text::CSV_XS version 0.52
1159                                                 Spreadsheet::WriteExcel::Big version 2.20
1160                                                 Tie::IxHash version 1.21
1161                                                 Parse::RecDescent version 1.95.1
1162                                                 SRU version 0.99
1163                                                 JSON::XS version 2.27
1164
1165                                                 Checking Jabber connection for user opensrf, domain private.localhost
1166                                                 * Jabber successfully connected
1167                                                 
1168                                                 Checking Jabber connection for user opensrf, domain public.localhost
1169                                                 * Jabber successfully connected
1170                                                 
1171                                                 Checking Jabber connection for user router, domain public.localhost
1172                                                 * Jabber successfully connected
1173                                                 
1174                                                 Checking Jabber connection for user router, domain private.localhost
1175                                                 * Jabber successfully connected
1176                                                 ]]></programlisting>
1177                                                 <programlisting language="xml"><![CDATA[
1178                                                 Checking database connections
1179                                                 * /opensrf/default/reporter/setup :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1180                                                   * Database has the expected server encoding UTF8.
1181                                                 * /opensrf/default/apps/open-ils.storage/app_settings/databases :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1182                                                   * Database has the expected server encoding UTF8.
1183                                                 * /opensrf/default/apps/open-ils.cstore/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1184                                                   * Database has the expected server encoding UTF8.
1185                                                 * /opensrf/default/apps/open-ils.pcrud/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1186                                                   * Database has the expected server encoding UTF8.
1187                                                 * /opensrf/default/apps/open-ils.reporter-store/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1188                                                   * Database has the expected server encoding UTF8.
1189                                                 
1190                                                 Checking database drivers to ensure <driver> matches <language>
1191                                                 * OK: Pg language is undefined for reporter base configuration
1192                                                 * OK: Pg language is undefined for reporter base configuration
1193                                                 * OK: Pg language is perl in /opensrf/default/apps/open-ils.storage/language
1194                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.cstore/language
1195                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.pcrud/language
1196                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.reporter-store/language
1197                                                 
1198                                                 Checking libdbi and libdbi-drivers
1199                                                   * OK - found locally installed libdbi.so and libdbdpgsql.so in shared library path
1200                                                 
1201                                                 Checking hostname
1202                                                  * OK: found hostname 'localhost' in <hosts> section of opensrf.xml
1203                                                 $
1204                                                 ]]></programlisting>
1205                                         </section>
1206                                         <para>If the output from the script does not help you find the problem, please do not make any further significant changes to your configuration. Follow the steps in the troubleshooting guide in <xref linkend="troubleshooting"/>.</para>
1207                                         <para>If you have followed the entire set of installation steps listed here closely, you are probably extremely close to a working system. Gather your configuration files and log files and contact the <ulink url="http://open-ils.org/listserv.php">Evergreen development mailing list</ulink> for assistance before making any drastic changes to your system configuration.</para>
1208                                 </section>
1209                                 <section xml:id="serversideinstallation-testing-opac">
1210                                         <title>Testing the Catalog</title>
1211                                         <para>By default, the OPAC will live at the URL <uri>http://my.domain.com/opac/</uri>.</para>
1212                                         <para>Navigate to this URL and the front page of the OPAC should load. There is a basic text entry field with some extra search options. If you have any problems loading this page, check the Apache error logs. If the page loads but does not function correctly, then check for possible javascript errors. We hightly reccommend testing with the <application>Firefox</application> browser because of the helpful javascript debugging tools.</para>
1213                                         <para>Assuming that the OPAC is functioning and there is data in your database, you can now perform other simple functional tests (e.g., searching the catalog).</para>
1214                                         <indexterm>
1215                                                 <primary>ZZZ-REVIEW</primary>
1216                                                 <secondary>ADD OTHER SIMPLE FUNCTIONAL TESTS </secondary>
1217                                         </indexterm>
1218                                         <caution>ADD OTHER SIMPLE FUNCTIONAL TESTS </caution>
1219                                 </section>
1220                                 <section>
1221                                         <title>Running the Evergreen Staff Client</title>
1222                                         <para>Run the Evergreen Staff Client by using the application <application>XULRunner</application> (installed automatically and by default with Firefox version 3.0 and later on <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem> distributions).</para>
1223                                         <para>For example, if the source files for the Evergreen installation are in the directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7/</filename>, start the Staff Client as follows:</para>
1224                                         <figure>
1225                                                 <title>Commands to run the Staff Client</title>
1226                                                 <screen>
1227                                                 $ su - opensrf
1228                                                 $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
1229                                                 </screen>
1230                                         </figure>
1231                                 </section>
1232                                 <section xml:id="serversideinstallation-starting-apache-server">
1233                                         <title>Testing the Apache Web Server</title>
1234                                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>
1235                                         <para>As the <systemitem class="username">root</systemitem> user, execute the following commands. Note the use of <emphasis>restart</emphasis> to force the new Evergreen modules to be reloaded even if the Apache server is already running. Any problems found with your configuration files should be displayed:</para>
1236                                         <figure>
1237                                                 <title>Commands to test the Apache Web Server</title>
1238                                                 <screen>
1239                                                 $ su - root
1240                                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart
1241                                                 </screen>
1242                                         </figure>
1243                                 </section>
1244                         </section>
1245                         <section xml:id="serversideinstallation-stopping">
1246                                 <title>Stopping Evergreen</title>
1247                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all Evergreen services by using the following command:</para>
1248                                 <figure>
1249                                         <title>Commands to stop Evergreen</title>
1250                                         <screen>
1251                                         $ su - opensrf
1252
1253                                         # stop the server:
1254                                         # use "-l" to force hostname to be "localhost"
1255                                         $ osrf_ctl.sh -l -a stop_all
1256                                         </screen>
1257                                 </figure>
1258                                 <note>
1259                                         <para>
1260                                                 <emphasis>You can also stop Evergreen services <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but the <command>osrf_ctl.sh</command> utility must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>
1261                                         </para>
1262                                 </note>
1263                                 <indexterm>
1264                                         <primary>ZZZ-REVIEW</primary>
1265                                         <secondary>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </secondary>
1266                                 </indexterm>
1267                                 <caution>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1268                         </section>
1269                         <section xml:id="serversideinstallation-postinstallation">
1270                                 <title>Post-Installation Chores</title>
1271                                 <section>
1272                                         <title>Remove temporary changes from Apache configuration file</title>
1273                                         <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/sites-available/eg.conf</filename> again and make the following change:</para>
1274                                         <para>Uncomment the line <literal>Allow from 10.0.0.0/8</literal>, then comment out the line <literal>Allow from all</literal>. You modified this file in an earlier step as a temporary measure to expedite testing (see <xref linkend="serversideinstallation-modify-apache"/> for further information). Those changes must now be reversed in order to deny unwanted access to your CGI scripts from users on other public networks. You <emphasis role="bold">must</emphasis> secure this for a public production system.</para>
1275                                 </section>
1276                                 <section>
1277                                         <title>Configure a permanent SSL key</title>
1278                                         <para>In a previous step, we used the command <command>openssl</command> to temporarily create a new SSL key for the Apache server. For a public production server you should configure or purchase a signed SSL certificate</para>
1279                                         <warning>
1280                                                 <para>
1281                                                         <emphasis>The temporary SSL key was only created to expedite testing. You <emphasis role="bold"> must</emphasis> get a proper SSL certificate for a public production system.</emphasis>
1282                                                 </para>
1283                                         </warning>
1284                                         <indexterm>
1285                                                 <primary>ZZZ-REVIEW</primary>
1286                                                 <secondary>ADD EXPLANATION OF HOW TO GET PERMANENT SSL CERTIFICATE </secondary>
1287                                         </indexterm>
1288                                         <caution>ADD EXPLANATION OF HOW TO GET PERMANENT SSL CERTIFICATE </caution>
1289                                 </section>
1290                                 <section>
1291                                         <title>Set Up Support For Reports</title>
1292                                         <para>Evergreen reports are extremely powerful, but some configuration is required. See <xref linkend="report-introduction"/> for details.</para>
1293                                         <itemizedlist>
1294                                                 <listitem>
1295                                                         <para>Starting the Reporter Daemon</para>
1296                                                         <para>Once the <systemitem class="daemon">open-ils.reporter</systemitem> process is running and enabled on the gateway, you can start the reporter daemon. That process periodically checks for requests for new reports or scheduled reports and gets them running.</para>
1297                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, start the reporter daemon using the following command:</para>
1298                                                         <figure>
1299                                                                 <title>Commands to start the Reporter daemon</title>
1300                                                                 <screen>
1301                                                                 $ su - opensrf
1302                                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/src/reporter
1303                                                                 $ ./clark-kent.pl --daemon
1304                                                                 </screen>
1305                                                         </figure>
1306                                                         <para>You can also specify other options with this utility:</para>
1307                                                         <itemizedlist>
1308                                                                 <listitem><option>--sleep=interval</option> : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>
1309                                                                 <listitem><option>--lockfile=filename</option> : where to place the lockfile for the process; defaults to <filename>/tmp/reporter-LOCK</filename></listitem>
1310                                                                 <listitem><option>--concurrency=integer</option> : number of reporter daemon processes to run; defaults to <literal>1</literal></listitem>
1311                                                                 <listitem><option>--bootstrap=filename</option> : OpenSRF bootstrap configuration file; defaults to <filename>/openils/conf/opensrf_core.xml</filename></listitem>
1312                                                         </itemizedlist>
1313                                                 </listitem>
1314                                                 <listitem>
1315                                                         <para>Stopping the Reporter Daemon</para>
1316                                                         <para>To stop the Reporter daemon, you must kill the process and remove the lockfile. The daemon may have just a single associated process, with a lockfile in the default location.</para>
1317                                                         <note>
1318                                                                 <para>
1319                                                                         <emphasis>It is possible that several processes are running; see the optional commands in the previous section. As the <systemitem class="username">opensrf</systemitem> user, perform the following commands to stop the Reporter daemon:</emphasis>
1320                                                                 </para>
1321                                                         </note>
1322                                                         <figure>
1323                                                                 <title>Commands to stop the Reporter daemon</title>
1324                                                                 <screen>
1325                                                                 $ su - opensrf
1326                                                                 # find and kill the process ID number(s)
1327                                                                 $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
1328                                                                 # remove the lock file
1329                                                                 $ rm /tmp/reporter-LOCK
1330                                                                 </screen>
1331                                                         </figure>
1332                                                 </listitem>
1333                                         </itemizedlist>
1334                                 </section>
1335                                 <section xml:id="serversideinstallation-organizationandpolicy">
1336                                         <title>Organization and Policy Editing</title>
1337                                         <para>After installing Evergreen, you will want to make configuration changes to reflect the organizational hierarchy and the policies of your library or libraries. See <xref linkend="serveradministration-orgunits"/> for further information. Examples of what can be configured include:</para>
1338                                         <itemizedlist>
1339                                                 <listitem>Adding a branch library</listitem>
1340                                                 <listitem>Changing circulation rules for an existing library</listitem>
1341                                                 <listitem>Adding a new staff position or user group</listitem>
1342                                         </itemizedlist>
1343                                         <indexterm>
1344                                                 <primary>ZZZ-REVIEW</primary>
1345                                                 <secondary>ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </secondary>
1346                                         </indexterm>
1347                                         <caution>ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </caution>
1348                                 </section>
1349                         </section>
1350                 </section>
1351                 <section xml:id="serversideinstallation-virtual">
1352                         <title>Installing In Virtualized Unix Environments</title>
1353                         <para>Evergreen software currently runs as a native application on any of several well-known <systemitem class="osname">Linux</systemitem> distributions (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). It does not run as a native application on the <systemitem class="osname">Windows</systemitem> operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can be installed and run on <systemitem class="osname">Windows</systemitem> via a virtualized Unix-guest Operating System (using, for example, <application>VirtualBox</application> or <application>VMware</application> to emulate a <systemitem class="osname">Linux</systemitem> environment).</para>
1354                         <indexterm>
1355                                 <primary>ZZZ-REVIEW</primary>
1356                                 <secondary>ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </secondary>
1357                         </indexterm>
1358                         <caution>ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </caution>
1359                         <section xml:id="serversideinstallation-virtualized-virtualbox">
1360                                 <title>VirtualBox</title>
1361                                 <indexterm>
1362                                         <primary>ZZZ-REVIEW</primary>
1363                                         <secondary>ADD CONTENT FOR VirtualBox </secondary>
1364                                 </indexterm>
1365                                 <caution>ADD CONTENT FOR VirtualBox </caution>
1366                         </section>
1367                         <section xml:id="serversideinstallation-virtualized-vmware">
1368                                 <title>VMware</title>
1369                                 <indexterm>
1370                                         <primary>ZZZ-REVIEW</primary>
1371                                         <secondary>ADD CONTENT FOR VMware </secondary>
1372                                 </indexterm>
1373                                 <caution>ADD CONTENT FOR VMware </caution>
1374                         </section>
1375                         <section xml:id="serversideinstallation-virtualized-virtualpc">
1376                                 <title>VirtualPC</title>
1377                                 <indexterm>
1378                                         <primary>ZZZ-REVIEW</primary>
1379                                         <secondary>ADD CONTENT FOR VirtualPC </secondary>
1380                                 </indexterm>
1381                                 <caution>ADD CONTENT FOR VirtualPC </caution>
1382                         </section>
1383                 </section>
1384                 <section xml:id="serversideinstallation-previousversions">
1385                         <title>Installing Previous Versions of Evergreen</title>
1386                         <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>
1387                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold">1.4.0.6</emphasis></emphasis>. The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>.</para>
1388                         <section xml:id="serversideinstallation-ubuntudebian-previous">
1389                                 <title>Installing Evergreen 1.4.0.6 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>
1390                                 <indexterm>
1391                                         <primary>ZZZ-REVIEW</primary>
1392                                         <secondary>ADD CONTENT FOR INSTALLING EVERGREEN 1.4.0.6 ON UBUNTU OR DEBIAN </secondary>
1393                                 </indexterm>
1394                                 <caution>ADD CONTENT FOR INSTALLING EVERGREEN 1.4.0.6 ON UBUNTU OR DEBIAN </caution>
1395                         </section>
1396                         <section xml:id="serversideinstallation-opensrf-previous">
1397                                 <title>Installing OpenSRF 1.0.x</title>
1398                                 <indexterm>
1399                                         <primary>ZZZ-REVIEW</primary>
1400                                         <secondary>ADD CONTENT FOR INSTALLING OPENSRF 1.0.x </secondary>
1401                                 </indexterm>
1402                                 <caution>ADD CONTENT FOR INSTALLING OPENSRF 1.0.x </caution>
1403                         </section>
1404                 </section>
1405                 <section xml:id="serversideinstallation-postgresql">
1406                         <title>Installing PostgreSQL</title>
1407                         <indexterm>
1408                                 <primary>ZZZ-REVIEW</primary>
1409                                 <secondary>ADD CONTENT FOR POSTGRESQL </secondary>
1410                         </indexterm>
1411                         <caution>ADD CONTENT FOR POSTGRESQL </caution>
1412                 </section>
1413                 <section xml:id="serversideinstallation-apache">
1414                         <title>Installing Apache</title>
1415                         <section>
1416                                 <title>Securing Apache (httpd)</title>
1417                                 <para>The main consideration is to secure the directory <filename class="directory">cgi-bin</filename>. The only persons that need access to this directory are Evergreen system administrators. This directory should be restricted by both IP (to those workstations designated as Evergeen Administration systems), and by username/password.</para>
1418                                 <indexterm>
1419                                         <primary>ZZZ-REVIEW</primary>
1420                                         <secondary>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </secondary>
1421                                 </indexterm>
1422                                 <caution>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </caution>
1423                                 <para>A user could add new libraries, re-arrange consortia, or change user groups; or a staff member could access the directory, and change his associated security group to administrative level privileges.</para>
1424                         </section>
1425                         <indexterm>
1426                                 <primary>ZZZ-REVIEW</primary>
1427                                 <secondary>ADD MORE CONTENT FOR APACHE </secondary>
1428                         </indexterm>
1429                         <caution>ADD MORE CONTENT FOR APACHE </caution>
1430                 </section>
1431         </section>
1432         <section>
1433                 <title>Installing the Staff Client</title>
1434                 <para>You can install the Staff Client from pre-built images and packages without actually having to first build it. Pre-built packages are currently available for <systemitem class="osname">Windows</systemitem>, <systemitem class="osname">Mac OS X</systemitem>, and <systemitem class="osname">Linux</systemitem>. If you need to manually build the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>
1435                 <section xml:id="serversideinstallation-prebuilt-staffclient">
1436                         <title>Installing a Pre-Built Staff Client</title>
1437                         <para>This section reviews the process of installing pre-built versions of the Staff Client in various environments.</para>
1438                         <section>
1439                                 <title>Installing on <systemitem class="osname">Windows</systemitem></title>
1440                                 <para>A standard <systemitem class="osname">Windows</systemitem> installer that contains the current version of the Staff Client is available from the downloads section of the Evergreen website at <ulink url="http://www.evergreen-ils.org/downloads.php">http://www.evergreen-ils.org/downloads.php</ulink>. Download the staff client installer, then run it. A screen that looks similar to this should appear:</para>
1441                                 <figure>
1442                                         <title>Running the Staff Client installer</title>
1443                                         <mediaobject>
1444                                                 <imageobject>
1445                                                         <imagedata fileref="../media/serversideinstallation-staffclient-1.png" scalefit="1" width="70%"/>
1446                                                 </imageobject>
1447                                         </mediaobject>
1448                                 </figure>
1449                                 <para>Click <guibutton>Next</guibutton> to continue through the guided install process. The install wizard will ask you to agree to the end-user license, ask you where to install the software, ask about where to place icons, and then will install the software on your workstation.</para>
1450                                 <para>When you run the staff client for the first time, a screen similar to this should appear:</para>
1451                                 <figure>
1452                                         <title>Running the Staff Client for the first time</title>
1453                                         <mediaobject>
1454                                                 <imageobject>
1455                                                         <imagedata fileref="../media/serversideinstallation-staffclient-2.png" scalefit="1" width="70%"/>
1456                                                 </imageobject>
1457                                         </mediaobject>
1458                                 </figure>
1459                                 <para>First, configure the server you would like to connect to in the <emphasis role="bold">Server</emphasis> section. For example, the PINES demo system is <systemitem class="domain">demo.gapines.org</systemitem>. After selecting a server, click <guibutton>Re-Test Server</guibutton>.</para>
1460                                 <para>Because this is the initial run of the staff client, the <emphasis role="bold">Workstation</emphasis> section in the upper-right states: <emphasis role="bold">Not yet configured for the specified server</emphasis>. The first thing that must be done to the Staff Client on every workstation is to assign it a workstation name. This is covered in <xref linkend="serversideinstallation-workstationnames"/>.</para>
1461                         </section>
1462                         <section>
1463                                 <title>Installing on <systemitem class="osname">Mac OS X</systemitem></title>
1464                                 <para>A <systemitem class="osname">Mac OS X</systemitem> package that contains the current version of the Staff Client is available for use with <application>xulrunner</application>.</para>
1465                                 <section>
1466                                         <title>Evergreen Indiana Pkg file [Evergreen v1.2.3.0]</title>
1467                                         <procedure>
1468                                                 <step>Download and install the latest version of <application>xulrunner</application> for <systemitem class="osname">Mac OS X</systemitem>. Release notes for the latest version can be found here: <ulink url="http://developer.mozilla.org/en/docs/XULRunner_1.8.0.4_Release_Notes">http://developer.mozilla.org/en/docs/XULRunner_1.8.0.4_Release_Notes</ulink>. Note, later versions may not work correctly.</step>
1469                                                 <step>Download and install the <systemitem class="osname">Mac OS X</systemitem> Installation package for the 1_2_3_0 Version Staff Client from <ulink url="http://evergreen.lib.in.us/opac/extras/files/evergreen_osx_staff_client_1_2_3.zip">http://evergreen.lib.in.us/opac/extras/files/evergreen_osx_staff_client_1_2_3.zip</ulink>.</step>
1470                                                 <step>To upgrade to a more recent version of the staff client, you can copy the directory <emphasis>build</emphasis> from a working <systemitem class="osname">Windows</systemitem> installation of the desired version of the staff client to your Mac. The required files may be located in a directory like this on the <systemitem class="osname">Windows</systemitem> machine: <filename class="directory">C:\Program Files\Evergreen Staff Client\build</filename>. Copy these files into the folder <filename class="directory">Resources</filename> within the Open-ILS package in your Applications directory on the Mac, overwriting files with the same names.</step>
1471                                                 <step>Drag the application's icon into your toolbar for easier access.</step>
1472                                         </procedure>
1473                                         <para/>
1474                                         <para>When you run the staff client installer, a screen will appear that looks similar to this:</para>
1475                                         <figure>
1476                                                 <title>Running the Staff Client installer</title>
1477                                                 <mediaobject>
1478                                                         <imageobject>
1479                                                                 <imagedata fileref="../media/serversideinstallation-staffclient-3.png" scalefit="1" width="20%"/>
1480                                                         </imageobject>
1481                                                 </mediaobject>
1482                                         </figure>
1483                                         <caution> FIX BAD LINK: http://es.zionsville.lib.in.us/atheos/eg_osx_a.gif </caution>
1484                                         <para>Click <guibutton>Continue</guibutton>, accept the license, then finish the installation. The application will be located at the destination you selected during installation. You will then be able to drag the application into your toolbar for easier access.</para>
1485                                         <figure>
1486                                                 <title>Finishing the installation</title>
1487                                                 <mediaobject>
1488                                                         <imageobject>
1489                                                                 <imagedata fileref="../media/serversideinstallation-staffclient-4.png" scalefit="1" width="20%"/>
1490                                                         </imageobject>
1491                                                 </mediaobject>
1492                                         </figure>
1493                                         <caution> FIX BAD LINK: http://es.zionsville.lib.in.us/atheos/eg_osx_a.gif </caution>
1494                                 </section>
1495                                 <section>
1496                                         <title>Running directly using <application>xulrunner</application></title>
1497                                         <para>You must install an apropriate version of <application>xulrunner</application> to match the Evergreen version. See the following table for the recommended version of <application>xulrunner</application>:</para>
1498                                         <table>
1499                                                 <title>Evergreen / XULRunner Dependencies</title>
1500                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1501                                                         <colspec colnum="1" colwidth="1*"/>
1502                                                         <colspec colnum="2" colwidth="3*"/>
1503                                                         <tbody>
1504                                                                 <row>
1505                                                                         <entry>Evergreen 1.6.x.x</entry>
1506                                                                         <entry>XULrunner 1.9</entry>
1507                                                                 </row>
1508                                                                 <row>
1509                                                                         <entry>Evergreen 1.4.x.x</entry>
1510                                                                         <entry>XULrunner 1.8.0.4 or XULrunner 1.8.0.3</entry>
1511                                                                 </row>
1512                                                                 <row>
1513                                                                         <entry>Evergreen 1.2.x.x</entry>
1514                                                                         <entry>XULrunner 1.8.0.4 or XULrunner 1.8.0.3</entry>
1515                                                                 </row>
1516                                                         </tbody>
1517                                                 </tgroup>
1518                                         </table>
1519                                         <note>If you have issues removing previously installed <application>xulrunner</application> versions see <xref linkend="serversideinstallation-staffclient-remove-xulrunner"/> for information on removing previous <application>XULRunner</application> versions.</note>
1520                                         <para>The staff client data from the directory <filename class="directory">./staff_client/build</filename> must be placed somewhere on the machine (e.g. <emphasis>~/Desktop/Evergreen_Staff_Client</emphasis>). Remember to call <application>XULRunner</application> with the full path to the binary, followed by the install command and the path to the client data. See the following command:</para>
1521                                         <figure>
1522                                                 <title>Executing <application>xulrunner</application></title>
1523                                                 <screen>
1524                                                 /Library/Frameworks/XUL.framework/xulrunner-bin --install-app ~/Desktop/Evergreen_Staff_Client
1525                                                 </screen>
1526                                         </figure>
1527                                         <para>This command should exit quietly. A folder will be created, named <emphasis>/Applications/OpenILS</emphasis>, containing a launcher named <emphasis>open_ils_staff_client</emphasis>.</para>
1528                                 </section>
1529                                 <section xml:id="serversideinstallation-staffclient-remove-xulrunner">
1530                                         <title>Removing previously installed <application>xulrunner</application> versions</title>
1531                                         <para>If you already have a newer version installed, per the release notes, you will need to remove the entire directory <filename class="directory">/Library/Frameworks/XUL.framework</filename> before downgrading.</para>
1532                                         <para>In addition, you may also need to remove the previous file <filename>/Library/Receipts/xulrunner-ver-mak.pkg</filename>.</para>
1533                                         <para>If there is no file <filename>/Library/Receipts/xulrunner-ver-mak.pkg</filename> (possibly in newer OSX releases) you need to flush the file <emphasis>receiptdb</emphasis>.</para>
1534                                         <note>If you install a newer version over a previous (older) install, the older one is not removed but the symlinks get changed to the newer one.</note>
1535                                         <para>First, get the package identifier, then purge/forget the build that was initially installed:</para>
1536                                         <figure>
1537                                                 <title>Purging previous build</title>
1538                                                 <screen>
1539                                                 sudo pkgutil --pkgs > /tmp/pkgs.txt
1540                                                 sudo pkgutil --forget org.mozilla.xulrunner
1541                                                 </screen>
1542                                         </figure>
1543                                         <note>It may not be necessary to edit the file <filename>/Library/Receipts/InstallHistory.plist</filename> after deleting the folder <emphasis>XUL.framework</emphasis>.</note>
1544                                 </section>
1545                                 <section>
1546                                         <title>Creating an APP file: Staff Client &amp; <application>xulrunner</application> Bundled</title>
1547                                         <para>An APP file is basically a folder. Start with a folder stucture like this:</para>
1548                                         <figure>
1549                                                 <title>Sample APP file folder structure</title>
1550                                                 <screen>
1551                                                 * Evergreen.app
1552                                                   * Contents
1553                                                     * Frameworks
1554                                                     * Resources
1555                                                     * MacOS
1556                                                 </screen>
1557                                         </figure>
1558                                         <para>Create an APP folder structure with the following commands:</para>
1559                                         <figure>
1560                                                 <title>Creating a folder structure</title>
1561                                                 <screen>
1562                                                 mkdir -p Evergreen.app/Contents/Frameworks
1563                                                 mkdir -p Evergreen.app/Contents/Resources
1564                                                 mkdir -p Evergreen.app/Contents/MacOS
1565                                                 </screen>
1566                                         </figure>
1567                                         <para/>
1568                                         <procedure>
1569                                                 <step>
1570                                                         <para>Create a new file in the folder <emphasis>Evergreen.app/Contents/Info.plist</emphasis> containing the following data (adjust for your version of Evergreen):</para>
1571                                                         <figure>
1572                                                                 <title>Creating a new file</title>
1573                                                                 <programlisting language="xml"><![CDATA[
1574 <?xml version="1.0" encoding="UTF-8"?>
1575 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
1576 <plist version="1.0">
1577 <dict>
1578         <key>CFBundleExecutable</key>
1579         <string>xulrunner</string>
1580         <key>CFBundleGetInfoString</key>
1581         <string>OpenILS open_ils_staff_client rel_1_6_0_7</string>
1582         <key>CFBundleInfoDictionaryVersion</key>
1583         <string>6.0</string>
1584         <key>CFBundleName</key>
1585         <string>Evergreen Staff Client</string>
1586         <key>CFBundlePackageType</key>
1587         <string>APPL</string>
1588         <key>CFBundleShortVersionString</key>
1589         <string>rel_1_6_0_7</string>
1590         <key>CFBundleVersion</key>
1591         <string>rel_1_6_0_7.rel_1_6_0_7</string>
1592         <key>NSAppleScriptEnabled</key>
1593         <true/>
1594         <key>CFBundleTypeIconFile</key>
1595         <string>Evergreen.icns</string>
1596 </dict>
1597 </plist>
1598 ]]></programlisting>
1599                                                         </figure>
1600                                                 </step>
1601                                                 <step>Download and install an appropriate <systemitem class="osname">Mac OS X</systemitem>package of <application>XULRunner</application> from the Mozilla website (see above for recommendations).</step>
1602                                                 <step>
1603                                                         <para>Make a copy of <emphasis>/Library/Frameworks/XUL.Framework</emphasis> inside your APP file. It should look something like this:</para>
1604                                                         <figure>
1605                                                                 <title>Example of APP file framework</title>
1606                                                                 <screen>
1607                                                                 * Evergreen.app/
1608                                                                 __* Contents/
1609                                                                 ____* Frameworks/
1610                                                                 ______* XUL.Framework/
1611                                                                 ______* Versions/
1612                                                                 ________* Current -> 1.9.1.3 (symlink)
1613                                                                 ________* 1.9.1.3/
1614                                                                 ______* XUL -> Versions/Current/XUL
1615                                                                 ______* libxpcom.dylib -> Versions/Current/libxpcom.dylib
1616                                                                 ______* xulrunner-bin -> Versions/Current/xulrunner-bin
1617                                                                 </screen>
1618                                                         </figure>
1619                                                 </step>
1620                                                 <step>Copy <emphasis>XUL.Framework/Versions/Current/xulrunner</emphasis> into <emphasis>Evergreen.app/MacOS</emphasis> (do not symlink; copy the file).</step>
1621                                                 <step>
1622                                                         <para>Make <emphasis>Evergreen.app/Resources</emphasis> the root of your Evergreen application files like this:</para>
1623                                                         <figure>
1624                                                                 <title>Example APP file</title>
1625                                                                 <screen>
1626                                                                 * Evergreen.app/
1627                                                                 __* Contents/
1628                                                                 ____* Resources/
1629                                                                 ______* BUILD_ID
1630                                                                 ______* application.ini
1631                                                                 ______* chrome/
1632                                                                 ______* components/
1633                                                                 ______* etc.
1634                                                                 </screen>
1635                                                         </figure>
1636                                                 </step>
1637                                                 <step>Put a <systemitem class="osname">Mac</systemitem> format icon file named <emphasis>Evergreen.icns</emphasis> in Resources.</step>
1638                                         </procedure>
1639                                 </section>
1640                         </section>
1641                         <section xml:id="serversideinstallation-staffclient">
1642                                 <title>Installing on <systemitem class="osname">Linux</systemitem></title>
1643                                 <section>
1644                                         <title>Quick Upgrade of the Staff Client</title>
1645                                         <para>A <systemitem class="osname">Linux</systemitem> Staff Client is automatically built on the server as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side software. To upgrade the Staff Client on a remote workstation with a new version, just copy the directory tree containing the Staff Client from the server to the remote workstation.</para>
1646                                         <para>The following example assumes you already have an <systemitem class="username">opensrf</systemitem> user account on both the server and the remote workstation. Remember to replace <literal>user</literal>, <literal>client.linux.machine</literal> and <literal>eg-client-x.x.x.x</literal> with the proper user name, client machine name, and version number in the following example.</para>
1647                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then recursively copy the entire directory tree to the remote workstation:</para>
1648                                         <figure>
1649                                                 <title>Copying the Staff Client to a remote workstation</title>
1650                                                 <screen>
1651                                                 $ su - opensrf
1652                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1653                                                 $ scp -r build user@client.linux.machine:~/eg-client-x.x.x.x/
1654                                                 </screen>
1655                                         </figure>
1656                                         <para>To test the newly copied Staff Client, as the <systemitem class="username">opensrf</systemitem> user log into the remote workstation and execute it as shown:</para>
1657                                         <figure>
1658                                                 <title>Testing the copied Staff Client</title>
1659                                                 <screen>
1660                                                 $ su - opensrf
1661                                                 $ xulrunner ~/eg-client-x.x.x.x/build/application.ini
1662                                                 </screen>
1663                                         </figure>
1664                                 </section>
1665                                 <section>
1666                                         <title>Building the Staff Client on the Server</title>
1667                                         <para>A <systemitem class="osname">Linux</systemitem> Staff Client is automatically built on the server as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side software.</para>
1668                                         <para>In order to install a compatible Staff Client on another <systemitem class="osname">Linux</systemitem> system, just copy the applicable files from the server to that system, or even manually build it on that system. Ensure that the BUILD_ID you choose on the server matches the BUILD_ID for each staff client you use on other systems.</para>
1669                                         <para>If you will be using a pre-packaged <systemitem class="osname">Windows</systemitem> version on some systems, you may want to choose the BUILD_ID on both server and other versions to match that of the <systemitem class="osname">Windows</systemitem> Staff Client. To determine which BUILD_ID is used in an existing Staff Client installation, just click <guibutton>About this Client</guibutton> on the running Staff Client.</para>
1670                                         <para>If you are allowed to make changes on the Evergreen server, another option is to create a symbolic link. In order for a copy of the Staff Client and server to work together, the BUILD_ID must match the name of the directory containing the server components of the Staff Client, or the name of a symbolic link to that directory.</para>
1671                                         <figure>
1672                                                 <title>Creating a symbolic link</title>
1673                                                 <screen>
1674                                                 $ su - root
1675                                                 $ cd /openils/var/web/xul
1676                                                 $ ln -s SERVER_BUILD_ID/ CLIENT_BUILD_ID
1677                                                 </screen>
1678                                         </figure>
1679                                 </section>
1680                                 <section>
1681                                         <title>Building the Staff Client on the client Machine</title>
1682                                         <para>This section is directed toward end-users who wish to use <systemitem class="osname">Linux</systemitem> rather than <systemitem class="osname">Windows</systemitem> for client machines, but have limited <systemitem class="osname">Linux</systemitem> experience. You can build the Staff Client on a <systemitem class="osname">Linux</systemitem> system without installing the Evergreen Server component. This is a relatively simple process compared to server installation, but does require some command-line work. The following directions are for building Staff Client version 1.2.1.4 on Kubuntu 7.10; you must modify them for other distributions (the instructions should work as-is for Ubuntu or Ubuntu derivatives).</para>
1683                                         <procedure>
1684                                                 <step>
1685                                                         <para>Prerequisites</para>
1686                                                         <para>Both <application>subversion</application> and <application>xulrunner</application> are required to build the Staff Client. As the <systemitem class="username">root</systemitem> user, use <application>apt-get</application> to install packages for <application>subversion</application> and <application>xulrunner</application>. You can also use <application>synaptic</application>, the graphical user interface for <application>apt-get</application>. For <application>subversion</application>, select the latest version; for <application>xulrunner</application>, select version <emphasis>1.8.1.4-2ubuntu5</emphasis>.</para>
1687                                                         <figure>
1688                                                                 <title>Installing subversion and xulrunner</title>
1689                                                                 <screen>
1690                                                                 $ sudo apt-get install subversion
1691                                                                 $ sudo apt-get install xulrunner
1692                                                                 </screen>
1693                                                         </figure>
1694                                                 </step>
1695                                                 <step>
1696                                                         <para>Download the Source Code</para>
1697                                                         <itemizedlist>
1698                                                                 <listitem>
1699                                                                         <para>Determine which version is needed</para>
1700                                                                         <para>For most end-users, a specific version is required to communicate properly with the Evergreen server. Check with your system admininstrator, IT person, or HelpDesk to determine which Staff Client versions are supported.</para>
1701                                                                         <para>Next, you need to determine which <emphasis>tag</emphasis> to use when downloading the source code. Tags are markers in the source code to create a snapshot of the code as it existed at a certain time; tags usually point to tested and stable code, or at least a community-recognized release version.</para>
1702                                                                         <para>To determine which tag to use, browse to <ulink url="http://svn.open-ils.org/trac/ILS/browser">http://svn.open-ils.org/trac/ILS/browser</ulink>. Look in the <guibutton>Visit</guibutton> drop-down box; see the list of Branches and, further down, a list of Tags. You may have to do some guesswork, but it is fairly straightforward to determine which tag to use. If the server is version 1.2.1.4, you will want to use the tag that looks most appropriate. For example, as you look through the tag list, notice the tag named 'rel_1_2_1_4'. This is the tag you need; make a note of it for the next step.</para>
1703                                                                 </listitem>
1704                                                                 <listitem>
1705                                                                         <para>Download the Code</para>
1706                                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, open a terminal (command-line prompt) and navigate to the directory in which you wish to download the Staff Client. Use the following commands to download the proper version of the source code by tag name:</para>
1707                                                                         <figure>
1708                                                                                 <title>Downloading the source code</title>
1709                                                                                 <screen>
1710                                                                                 $ su - opensrf
1711                                                                                 $ cd /YOUR/DOWNLOAD/DIRECTORY
1712                                                                                 $ svn co svn://svn.open-ils.org/ILS/tags/rel_1_2_1_4/
1713                                                                                 </screen>
1714                                                                         </figure>
1715                                                                         <para>Remember to change <literal>rel_1_2_1_4</literal> to the appropriate tag for your installation.</para>
1716                                                                 </listitem>
1717                                                         </itemizedlist>
1718                                                 </step>
1719                                                 <step>
1720                                                         <para>Build the Staff Client</para>
1721                                                         <section>
1722                                                                 <title>Evergreen 1.2.x</title>
1723                                                                 <para>In the following example, navigate to the directory in which the source code was downloaded, then navigate to the proper subdirectory and run the <command>make</command> utility to actually build the Staff Client. Remember to check with your system administrator about which Staff Client BUILD_ID to use. The server checks the Staff Client BUILD_ID against itself to determine whether or not a connecting client is supported. For instance, for the PINES installation (version 1.2.1.4) the supported BUILD_ID is <literal>rel_1_2_1_4</literal>. Modify the following commands accordingly.</para>
1724                                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands to build the Staff Client:</para>
1725                                                                 <figure>
1726                                                                         <title>Finding the downloaded source code</title>
1727                                                                         <screen>
1728                                                                         $ su - opensrf
1729                                                                         $ cd /YOUR/DOWNLOAD/DIRECTORY
1730                                                                         $ cd Open-ILS/xul/staff_client
1731                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_2_1_4'
1732                                                                         ...
1733                                                                         </screen>
1734                                                                 </figure>
1735                                                         </section>
1736                                                         <section>
1737                                                                 <title>Evergreen 1.4.x</title>
1738                                                                 <para>The 1.4 series of Evergreen has complicated the build process for the Staff Client a bit. If you downloaded a .tar.gz (compressed tar archive) of Evergreen, then your steps will resemble the following:</para>
1739                                                                 <caution>FIXME -- Need instructions for getting certain Javascript files from OpenSRF, preferably without actually installing OpenSRF.
1740 </caution>
1741                                                                 <figure>
1742                                                                         <title>Building 1.4.x</title>
1743                                                                         <screen>
1744                                                                         $ su - opensrf
1745                                                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.4.0.4.tar.gz
1746                                                                         $ tar xfz Evergreen-ILS-1.4.0.4.tar.gz
1747                                                                         $ cd Evergreen-ILS-1.4.0.4/
1748                                                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
1749                                                                         $ cd Open-ILS/xul/staff_client/
1750                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_4_0_4' install
1751                                                                         </screen>
1752                                                                 </figure>
1753                                                                 <para/>
1754                                                                 <para>If you're installing from a Subversion checkout:</para>
1755                                                                 <figure>
1756                                                                         <title>Building from a <application>subversion</application> checkout</title>
1757                                                                         <screen>
1758                                                                         $ su - opensrf
1759                                                                         $ svn co svn://svn.open-ils.org/ILS/tags/rel_1_4_0_4/
1760                                                                         $ cd rel_1_4_0_4
1761                                                                         $ ./autogen.sh   # If you downloaded a .tar.gz of Evergreen, you may skip this step
1762                                                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
1763                                                                         $ cd Open-ILS/xul/staff_client/
1764                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_4_0_4' install
1765                                                                         </screen>
1766                                                                 </figure>
1767                                                         </section>
1768                                                 </step>
1769                                                 <step>
1770                                                         <para>Run the Staff Client (from the command line)</para>
1771                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, navigate to the directory <filename class="directory">build/</filename> (not <filename class="directory">staff_client/</filename>) and run the following command:</para>
1772                                                         <figure>
1773                                                                 <title>Running the Staff Client</title>
1774                                                                 <screen>
1775                                                                 $ su - opensrf
1776                                                                 $ xulrunner application.ini
1777                                                                 </screen>
1778                                                         </figure>
1779                                                 </step>
1780                                                 <step>
1781                                                         <para>(OPTIONAL) Cleaning Up / Creating Shortcuts</para>
1782                                                         <para>The source code download included many files that are needed to build the Staff Client, but are not necessary to run it. You may wish to remove them to save space, or to create a clean directory containing the built staff client that can be copied to other machines. To create a clean "staging" directory in which to place the finished staff client, issue the following commands:</para>
1783                                                         <figure>
1784                                                                 <title>Creating a "staging" directory</title>
1785                                                                 <screen>
1786                                                                 $ mkdir ~/&lt;Destination Directory>
1787                                                                 $ cd ~/&lt;Download Directory>/Open-ILS/xul/
1788                                                                 $ cp -r staff_client ~/&lt;Destination Directory>
1789                                                                 </screen>
1790                                                         </figure>
1791                                                         <para>Finally, test the Staff Client to verify that all the necessary files were moved to the destination directory:</para>
1792                                                         <figure>
1793                                                                 <title>Testing the copied Staff Client</title>
1794                                                                 <screen>
1795                                                                 $ cd ~/&lt;Destination Directory>/staff_client/build
1796                                                                 $ xulrunner application.ini
1797                                                                 </screen>
1798                                                         </figure>
1799                                                         <para>If there were no problems, then finish the cleanup by removing the original download directory and all subdirectories:</para>
1800                                                         <figure>
1801                                                                 <title>Cleaning up</title>
1802                                                                 <screen>
1803                                                                 $ rm -r -f ~/&lt;Download Directory>
1804                                                                 </screen>
1805                                                         </figure>
1806                                                         <para>Finally, test the copied Staff Client. You can create "Desktop / Start Menu / K-Menu" shortcuts for the Staff Client by using the following command as the target:</para>
1807                                                         <figure>
1808                                                                 <title>Running the copied Staff Client</title>
1809                                                                 <screen>
1810                                                                 $ xulrunner ~/&lt;Destination Directory>/staff_client/build/application.ini
1811                                                                 </screen>
1812                                                         </figure>
1813                                                 </step>
1814                                         </procedure>
1815                                 </section>
1816                                 <section>
1817                                         <title>Using <application>Wine</application> to Install On Linux</title>
1818                                         <para>The <systemitem class="osname">Linux</systemitem> application <application>Wine</application> is another alternative for those who wish to install the packaged <systemitem class="osname">Windows</systemitem> versions rather than building the Staff Client manually. <application>Wine</application> is a <systemitem class="osname">Linux</systemitem> application that allows users to directly run <systemitem class="osname">Windows</systemitem> executables, and is a simple way for casual <systemitem class="osname">Linux</systemitem> users to use the Staff Client. More information about <application>Wine</application> can be found at <ulink url="http://www.winehq.org/site/docs/wineusr-guide/getting-wine">http://www.winehq.org/site/docs/wineusr-guide/getting-wine</ulink>.</para>
1819                                         <para>As the <systemitem class="username">root</systemitem> user, use <application>apt-get</application> to install the package for <application>Wine</application>. You can also use <application>synaptic</application>, the graphical user interface.</para>
1820                                         <procedure>
1821                                                 <step>
1822                                                         <para>Install <application>Wine</application></para>
1823                                                         <figure>
1824                                                                 <title>Installing <application>Wine</application></title>
1825                                                                 <screen>
1826                                                                 $ sudo apt-get install wine
1827                                                                 </screen>
1828                                                         </figure>
1829                                                 </step>
1830                                                 <step>
1831                                                         <para>Download <systemitem class="osname">Windows</systemitem> installer for the Staff Client</para>
1832                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands to download the <systemitem class="osname">Windows</systemitem> installer for the proper Staff Client from the <emphasis>open-ils.org</emphasis> website and place it in a temporary directory:</para>
1833                                                         <figure>
1834                                                                 <title>Downloading the Staff Client installer</title>
1835                                                                 <screen>
1836                                                                 $ su - opensrf
1837                                                                 $ cd /YOUR/DOWNLOAD/DIRECTORY
1838                                                                 $ wget http://open-ils.org/downloads/evergreen-setup-rel_version-number.exe
1839                                                                 </screen>
1840                                                         </figure>
1841                                                 </step>
1842                                                 <step>
1843                                                         <para>Run the downloaded <systemitem class="osname">Windows</systemitem> installer</para>
1844                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, navigate to the directory where you downloaded the <systemitem class="osname">Windows</systemitem> executable file, then execute it:</para>
1845                                                         <figure>
1846                                                                 <title>Using Wine to run the <systemitem class="osname">Windows</systemitem> installer</title>
1847                                                                 <screen>
1848                                                                 $ su - opensrf
1849                                                                 $ cd /YOUR/DOWNLOAD/DIRECTORY
1850                                                                 $ wine evergreen-setup-rel_version-number.exe
1851                                                                 </screen>
1852                                                         </figure>
1853                                                         <para>If this step fails, you may need to configure Wine first to properly emulate <systemitem class="osname">WindowsXP</systemitem>. To do so, type the command <command>winecfg</command> from the command line; in the <guibutton>Applications</guibutton> tab of the window that pops up, select <guibutton>Default Settings</guibutton> and choose <guibutton>Windows XP</guibutton> from the drop-down menu, then click <guibutton>Apply</guibutton>.</para>
1854                                                 </step>
1855                                                 <step>
1856                                                         <para>Launch the Staff Client</para>
1857                                                         <para>A new entry for the Staff Client should now appear somewhere in the <guibutton>All Applications</guibutton> menu of your <systemitem class="osname">Linux</systemitem> desktop. Also, find a new desktop shortcut for the Staff Client. To launch the Staff Client, visit the <guibutton>All Applications</guibutton> menu, find a section similar to <emphasis><menuchoice><guimenu>Wine</guimenu><guimenuitem>Program Files</guimenuitem><guimenuitem>Evergreen Staff Client</guimenuitem><guimenuitem>Evergreen Staff Client</guimenuitem></menuchoice></emphasis>
1858 , or else launch the Staff Client from the desktop shortcut.</para>
1859                                                 </step>
1860                                         </procedure>
1861                                 </section>
1862                                 <section>
1863                                         <title>Running the Staff Client over an SSH Tunnel</title>
1864                                         <para>The Staff Client can use an SSH tunnel as a SOCKS 5 proxy. For more details, see <xref linkend="serversideinstallation-proxy"/>.</para>
1865                                 </section>
1866                         </section>
1867                         <section xml:id="serversideinstallation-workstationnames">
1868                                 <title>Assigning Workstation Names</title>
1869                                 <para>The Staff Client must be assigned to a library and given a unique name before it will connect fully to the Evergreen server. The only restriction is that the workstation's name must be unique within the assigned library. Make sure to select a workstation name that you will remember later, and reflects the role, purpose, and/or location of a particular computer. These names will come up later in statistical reporting, and can also be handy when troubleshooting.</para>
1870                                 <figure>
1871                                         <title>Example of unconfigured Staff Client</title>
1872                                         <mediaobject>
1873                                                 <imageobject>
1874                                                         <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-1.png" scalefit="1" width="70%"/>
1875                                                 </imageobject>
1876                                         </mediaobject>
1877                                 </figure>
1878                                 <para>In order to assign a workstation a name, a user with appropriate permissions must login to the Staff Client. In PINES, the local system administrator (OPSM) has the ability to assign workstation names in his or her library system. Library managers (LIBM's) have the ability within their branch. To assign a workstation a name, login to the system. You will be prompted to assign the workstation a library and a name:</para>
1879                                 <figure>
1880                                         <title>Example of configured Staff Client</title>
1881                                         <mediaobject>
1882                                                 <imageobject>
1883                                                         <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-2.png" scalefit="1" width="70%"/>
1884                                                 </imageobject>
1885                                         </mediaobject>
1886                                 </figure>
1887                                 <para>Select the library this workstation physically operates in from the drop down menu. In this example, we have selected <literal>MGRL-MA</literal>. Type in a friendly name for the workstation. In this example, we are installing the Staff Client on the director's personal system, and have named it as such. Then hit <emphasis role="bold">Register</emphasis>.</para>
1888                                 <para>Once you have registered your workstation with the server, your screen will look like this:</para>
1889                                 <figure>
1890                                         <title>Example of registered Staff Client</title>
1891                                         <mediaobject>
1892                                                 <imageobject>
1893                                                         <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-3.png" scalefit="1" width="70%"/>
1894                                                 </imageobject>
1895                                         </mediaobject>
1896                                 </figure>
1897                                 <para>You are now ready to log into the Staff Client for the first time. Type in your password again, and hit <emphasis role="bold">Login</emphasis>.</para>
1898                         </section>
1899                 </section>
1900                 <section xml:id="serversideinstallation-building-staffclient">
1901                         <title>Manually Building the Staff Client</title>
1902                         <para>This section reviews the process of manually building the Staff Client in various environments.</para>
1903                         <para>The Staff Client is automatically built by default as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side software. See <xref linkend="serversideinstallation-compilingevergreen"/> to review details related to building the Staff Client in the final compile/link/install phase of the default Evergreen build process.</para>
1904                         <section>
1905                                 <title>Building the Staff Client</title>
1906                                 <para>You can also manually build the Staff Client by using the <command>make</command> utility in the Staff Client source directory (e.g., the directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.x/Open-ILS/xul/staff_client</filename> for the current Evergreen version). There are a number of possible options to manually build special versions of the Staff Client on a <systemitem class="osname">Linux</systemitem> system. Following is a list of environment variables that can be passed to <command>make</command> to influence the manual build process:</para>
1907                                 <section>
1908                                         <title>Option STAFF_CLIENT_BUILD_ID</title>
1909                                         <para>During the normal <emphasis>make install</emphasis> Evergreen server-side software build process, the variable defaults to an automatically generated date/time string, but you can also override the value of BUILD_ID.</para>
1910                                         <para>The following commands could be used during the normal build process:</para>
1911                                         <figure>
1912                                                 <title>Commands used during normal Evergreen build</title>
1913                                                 <screen>
1914                                                 $ su - root
1915                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
1916                                                 $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
1917                                                 ...
1918                                                 </screen>
1919                                         </figure>
1920                                         <para>The following commands will manually build the Staff Client using a different BUILD_ID.</para>
1921                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>
1922                                         <figure>
1923                                                 <title>Commands to manually build the Staff Client</title>
1924                                                 <screen>
1925                                                 $ su - opensrf
1926                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1927                                                 $ make STAFF_CLIENT_BUILD_ID=my_test_id  build
1928                                                 ...
1929                                                 </screen>
1930                                         </figure>
1931                                 </section>
1932                                 <section>
1933                                         <title>Option STAFF_CLIENT_VERSION</title>
1934                                         <para>During the normal <emphasis>make install</emphasis> Evergreen server-side software build process, the variable is pulled automatically from a README file in the Evergreen source root. The variable defaults to <emphasis>0trunk.revision</emphasis>, where the value of <literal>revision</literal> is automatically generated. You can override the value of VERSION similarly to the BUILD_ID.</para>
1935                                         <para>The following commands could be used during the normal build process:</para>
1936                                         <figure>
1937                                                 <title>Commands used during normal Evergreen build</title>
1938                                                 <screen>
1939                                                 $ su - root
1940                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
1941                                                 $ make STAFF_CLIENT_VERSION=0mytest.200 install
1942                                                 ...
1943                                                 </screen>
1944                                         </figure>
1945                                         <para>The following commands will manually build the Staff Client using a different VERSION.</para>
1946                                         <para>If you plan to make extensions update automatically, the VERSION needs to conform to the format recommended in <ulink url="https://developer.mozilla.org/en/Toolkit_version_format">Toolkit Version Format</ulink> and newer versions need to be "higher" than older versions.</para>
1947                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>
1948                                         <figure>
1949                                                 <title>Commands to manually build the Staff Client</title>
1950                                                 <screen>
1951                                                 $ su - opensrf
1952                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1953                                                 $ make STAFF_CLIENT_VERSION=0mytest.200  build
1954                                                 ...
1955                                                 </screen>
1956                                         </figure>
1957                                 </section>
1958                                 <section>
1959                                         <title>Option STAFF_CLIENT_STAMP_ID variable</title>
1960                                         <para>During the normal <emphasis>make install</emphasis> Evergreen server-side software build process, this variable is generated from STAFF_CLIENT_VERSION. You can override the value of STAMP_ID similarly to the BUILD_ID.</para>
1961                                         <para>The following commands could be used during the normal build process:</para>
1962                                         <figure>
1963                                                 <title>Commands used during normal Evergreen build</title>
1964                                                 <screen>
1965                                                 $ su - root
1966                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
1967                                                 $ make STAFF_CLIENT_STAMP_ID=my_test_stamp install
1968                                                 ...
1969                                                 </screen>
1970                                         </figure>
1971                                         <para>The following commands will manually build the Staff Client using a different STAMP_ID.</para>
1972                                         <para>It is possible to have multiple versions of the Staff Client by specifying a different STAMP_ID for each, possibly for different uses or client-side customizations.</para>
1973                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>
1974                                         <figure>
1975                                                 <title>Commands to manually build the Staff Client</title>
1976                                                 <screen>
1977                                                 $ su - opensrf
1978                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1979                                                 $ make STAFF_CLIENT_STAMP_ID=my_test_stamp  build
1980                                                 ...
1981                                                 </screen>
1982                                         </figure>
1983                                 </section>
1984                         </section>
1985                         <section>
1986                                 <title>Advanced Build Options</title>
1987                                 <para>In addition to the basic options listed above, there are a number of advanced options for building the Staff Client. Most are target names for the <command>make</command> utility and require that you build the Staff Client from its source directory. See the following table for a list of possible <command>make</command> target keywords:</para>
1988                                 <table>
1989                                         <title>Keywords Targets for <application>make</application> Command</title>
1990                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
1991                                                 <colspec colnum="1" colwidth="1*"/>
1992                                                 <colspec colnum="2" colwidth="3*"/>
1993                                                 <thead>
1994                                                         <row>
1995                                                                 <entry>Keyword</entry>
1996                                                                 <entry>Description</entry>
1997                                                         </row>
1998                                                 </thead>
1999                                                 <tbody>
2000                                                         <row>
2001                                                                 <entry>clients</entry>
2002                                                                 <entry>Runs "make win-client", "make linux-client", and "make generic-client" individually</entry>
2003                                                         </row>
2004                                                         <row>
2005                                                                 <entry>client_dir</entry>
2006                                                                 <entry>Builds a client directory from the build directory, without doing a rebuild. The same as "copy everything but server/".</entry>
2007                                                         </row>
2008                                                         <row>
2009                                                                 <entry>client_app</entry>
2010                                                                 <entry>Prerequisite "client_dir"; removes "install.rdf" from client directory so an APP bundle can't be installed as an extension</entry>
2011                                                         </row>
2012                                                         <row>
2013                                                                 <entry>client_ext</entry>
2014                                                                 <entry>Prerequisite "client_dir"; remove "application.ini", "autoupdate.js", "standalone_xul_app.js" from client directory so an extension won't break Firefox</entry>
2015                                                         </row>
2016                                                         <row>
2017                                                                 <entry>extension</entry>
2018                                                                 <entry>Prerequisite "client_ext"; rewritten to use "client_ext"</entry>
2019                                                         </row>
2020                                                         <row>
2021                                                                 <entry>generic-client</entry>
2022                                                                 <entry>Prerequisite "client_app"; makes an XPI file suitable for use with "xulrunner --install-app""</entry>
2023                                                         </row>
2024                                                         <row>
2025                                                                 <entry>win-xulrunner</entry>
2026                                                                 <entry>Prerequisite "client_app"; adds Windows xulrunner to client build</entry>
2027                                                         </row>
2028                                                         <row>
2029                                                                 <entry>linux-xulrunner</entry>
2030                                                                 <entry>Prerequisite "client_app"; adds Linux xulrunner to client build</entry>
2031                                                         </row>
2032                                                         <row>
2033                                                                 <entry>win-client</entry>
2034                                                                 <entry>Prerequisite "win-xulrunner"; builds "setup exe" (requires that "nsis" package be installed, will add options for automatic update if configured and developer options if client build was a "make devbuild")</entry>
2035                                                         </row>
2036                                                         <row>
2037                                                                 <entry>linux-client</entry>
2038                                                                 <entry>Prerequisite "linux_xulrunner"; builds a "tar.bz2" bundle of the Linux client</entry>
2039                                                         </row>
2040                                                         <row>
2041                                                                 <entry>[generic-|win-|linux-|extension-]updates[-client]</entry>
2042                                                                 <entry>Calls external/make_updates.sh to build full and partial updates generic/win/linux/extension prefix limit to that distribution; Adding the string "-client" builds clients and copies them to a subdirectory of the directory <filename class="directory">updates</filename> as well; the target "extension-updates-client" doesn't exist.</entry>
2043                                                         </row>
2044                                                 </tbody>
2045                                         </tgroup>
2046                                 </table>
2047                                 <para>Descriptions of other special build options follow:</para>
2048                                 <itemizedlist>
2049                                         <listitem>
2050                                                 <para>Developer Build</para>
2051                                                 <para>You can create a so-called "developer build" of the Staff Client by substituting <literal>devbuild</literal> for <literal>build</literal> when running <command>make</command>. The build will contain an extra configuration file that enables some developer options.</para>
2052                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>make</command> from the Staff Client source directory:</para>
2053                                                 <figure>
2054                                                         <title>Commands to do a "developer build"</title>
2055                                                         <screen>
2056                                                         $ su - opensrf
2057                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2058                                                         $ make devbuild
2059                                                         ...
2060                                                         </screen>
2061                                                 </figure>
2062                                         </listitem>
2063                                         <listitem>
2064                                                 <para>Compressed Javascript</para>
2065                                                 <para>You can execute the Google application <application>Closure Compiler</application> to automatically review and compress Javascript code after the build process completes, by substituting <literal>compress-javascript</literal> for <literal>build</literal> when running <command>make</command>. For more information see <ulink url="http://code.google.com/closure/compiler/">Google "Closure Compiler"</ulink>.</para>
2066                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands from the Staff Client source directory:</para>
2067                                                 <figure>
2068                                                         <title>Commands to compress Javascript</title>
2069                                                         <screen>
2070                                                         $ su - opensrf
2071                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2072                                                         $ make compress-javascript
2073                                                         ...
2074                                                         </screen>
2075                                                 </figure>
2076                                                 <para>You can also combine Javascript review and compression, and also perform a "developer build".</para>
2077                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands from the Staff Client source directory:</para>
2078                                                 <figure>
2079                                                         <title>Commands to compress Javascript and do a "developer build"</title>
2080                                                         <screen>
2081                                                         $ su - opensrf
2082                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2083         
2084                                                         # order of options is important!
2085                                                         $ make  devbuild  compress-javascript
2086                                                         ...
2087                                                         </screen>
2088                                                 </figure>
2089                                         </listitem>
2090                                         <listitem>
2091                                                 <para>Automatic Update Host</para>
2092                                                 <para>The host used to check for automatic Staff Client updates can be overridden by specifying the AUTOUPDATE_HOST option. The following commands could have been used during the normal build process:</para>
2093                                                 <figure>
2094                                                         <title>Commands to set AUTOUPDATE_HOST for normal Evergreen build</title>
2095                                                         <screen>
2096                                                         $ su - root
2097                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
2098                                                         $ make AUTOUPDATE_HOST=localhost install
2099                                                         ...
2100                                                         </screen>
2101                                                 </figure>
2102                                                 <para>You can manually set AUTOUPDATE_HOST to set up automatic update checking. The following commands will manually build the Staff Client using a different AUTOUPDATE_HOST.</para>
2103                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>
2104                                                 <figure>
2105                                                         <title>Commands to manually specify AUTOUPDATE_HOST</title>
2106                                                         <screen>
2107                                                         $ su - opensrf
2108                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2109                                                         $ make AUTOUPDATE_HOST=localhost build
2110                                                         ...
2111                                                         </screen>
2112                                                 </figure>
2113                                                 <para>For more information on Automatic Updates, see <xref linkend="serversideinstallation-staffclient-autoupdate"/>.</para>
2114                                         </listitem>
2115                                 </itemizedlist>
2116                         </section>
2117                         <section>
2118                                 <title>Installing and Activating a Manually Built Staff Client</title>
2119                                 <para>The Staff Client is automatically built, installed and activated as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side software. However, if you manually build the Staff Client, then you need to take additional steps to properly install and activate it. You also have the option of installing the Staff Client on the same machine it was built on, or on a different machine.</para>
2120                                 <para>Assuming you have already built the Staff Client, and that your installation is in the directory <filename class="directory">/openils/var/web/xul</filename>, as the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2121                                 <figure>
2122                                         <title>Commands to install the Staff Client on the same machine</title>
2123                                         <screen>
2124                                         $ su - opensrf
2125                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2126                                         $ mkdir -p "/openils/var/web/xul/$(cat build/BUILD_ID)"
2127                                         $ cp -R build/server "/openils/var/web/xul/$(cat build/BUILD_ID)"
2128                                         </screen>
2129                                 </figure>
2130                         </section>
2131                         <section>
2132                                 <title>Packaging the Staff Client</title>
2133                                 <para>Once the Staff Client has been built, you can create several forms of client packages by using some targetted <command>make</command> commands in the Staff Client source directory.</para>
2134                                 <itemizedlist>
2135                                         <listitem>
2136                                                 <para>Packaging a Generic Client</para>
2137                                                 <para>This build creates a Staff Client packaged as an XPI file to use with <emphasis>XULRunner</emphasis>. It requires that you already have the <application>zip</application> utility installed on your system. It will create the output file <filename>evergreen_staff_client.xpi</filename>, suitable for use with the <emphasis>XULRunner</emphasis> option <option>--install-app</option>.</para>
2138                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2139                                                 <figure>
2140                                                         <title>Commands to package a "generic" client</title>
2141                                                         <screen>
2142                                                         $ su - opensrf
2143                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2144                                                         $ make generic-client
2145                                                         ...
2146                                                         </screen>
2147                                                 </figure>
2148                                         </listitem>
2149                                         <listitem>
2150                                                 <para>Packaging a <systemitem class="osname">Windows</systemitem> Client</para>
2151                                                 <para>This build creates a Staff Client packaged as a <systemitem class="osname">Windows</systemitem> executable. It requires that you already have the <application>unzip</application> utility installed on your system. It also requires that you install <ulink url="http://nsis.sourceforge.net/">NSIS (Nullsoft Scriptable Install System)</ulink>, a professional open source utility package used to create <systemitem class="osname">Windows</systemitem> installers (the <application>makensis</application> utility is installed as part of the <application>nsis</application> package). We recommend using Version 2.45 or later. This build will create the output file <filename>evergreen_staff_client_setup.exe</filename>.</para>
2152                                                 <para>(OPTIONAL) If you wish for the Staff Client to have a link icon/tray icon by default, you may wish to provide a pre-modified <filename>xulrunner-stub.exe</filename>. Place it in the Staff Client source directory and <application>make</application> will automatically use it instead of the one that comes with the downloaded <emphasis>XULRunner</emphasis> release. The version of <filename>xulrunner-stub.exe</filename> need not match exactly.</para>
2153                                                 <para>(OPTIONAL) You can also use a tool such as <ulink url="http://www.angusj.com/resourcehacker/">Resource Hacker</ulink> to embed icons. <application>Resource Hacker</application> is an open-source utility used to view, modify, rename, add, delete and extract resources in 32bit <systemitem class="osname">Windows</systemitem> executables. See the following table for some useful icon ID strings:</para>
2154                                                 <table>
2155                                                         <title>Useful icon ID strings</title>
2156                                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
2157                                                                 <colspec colnum="1" colwidth="1*"/>
2158                                                                 <colspec colnum="2" colwidth="1*"/>
2159                                                                 <tbody>
2160                                                                         <row>
2161                                                                                 <entry>IDI_APPICON</entry>
2162                                                                                 <entry>Tray icon</entry>
2163                                                                         </row>
2164                                                                         <row>
2165                                                                                 <entry>32512</entry>
2166                                                                                 <entry>Default window icon</entry>
2167                                                                         </row>
2168                                                                 </tbody>
2169                                                         </tgroup>
2170                                                 </table>
2171                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2172                                                 <figure>
2173                                                         <title>Commands to build a <systemitem class="osname">Windows</systemitem> client</title>
2174                                                         <screen>
2175                                                         $ su - opensrf
2176                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2177                                                         $ make win-client
2178                                                         ...
2179                                                         </screen>
2180                                                 </figure>
2181                                         </listitem>
2182                                         <listitem>
2183                                                 <para>Packaging a <systemitem class="osname">Linux</systemitem> Client</para>
2184                                                 <para>This build creates a Staff Client package for <systemitem class="osname">Linux</systemitem> as a "tar.bz2" file with <emphasis>XULRunner</emphasis> already bundled with it. It creates the output file <filename>evergreen_staff_client.tar.bz2</filename>.</para>
2185                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2186                                                 <figure>
2187                                                         <title>Commands to build a <systemitem class="osname">Linux</systemitem> client</title>
2188                                                         <screen>
2189                                                         $ su - opensrf
2190                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2191                                                         $ make linux-client
2192                                                         ...
2193                                                         </screen>
2194                                                 </figure>
2195                                         </listitem>
2196                                         <listitem>
2197                                                 <para>Packaging a Firefox Extension</para>
2198                                                 <para>This build requires that you already have the <application>zip</application> utility installed on your system. It creates a Staff Client packaged as a Firefox extension and creates the output file <filename>evergreen.xpi</filename>.</para>
2199                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2200                                                 <figure>
2201                                                         <title>Commands to build a Firefox extension</title>
2202                                                         <screen>
2203                                                         $ su - opensrf
2204                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2205                                                         $ make extension
2206                                                         ...
2207                                                         </screen>
2208                                                 </figure>
2209                                         </listitem>
2210                                 </itemizedlist>
2211                         </section>
2212                         <section xml:id="serversideinstallation-staffclient-autoupdate">
2213                                 <title>Staff Client Automatic Updates</title>
2214                                 <para>It is possible to set up support for automatic Staff Client updates, either during the normal Evergreen server-side build process, or by manually building the Staff Client with certain special options.</para>
2215                                 <section>
2216                                         <title>WARNINGS</title>
2217                                         <para>Automatic update server certificate requirements are more strict than normal server requirements. Firefox and <emphasis>XULRunner</emphasis> will both ignore any automatic update server that is not validated by a trusted certificate authority. Servers with exceptions added to force the Staff Client to accept them <emphasis>WILL NOT WORK</emphasis>.</para>
2218                                         <para>In addition, automatic updates have special requirements for the file <filename>update.rdf</filename>:</para>
2219                                         <orderedlist>
2220                                                 <listitem>It must be served from an SSL server, or</listitem>
2221                                                 <listitem>It must be signed with the <ulink url="https://developer.mozilla.org/en/McCoy">McCoy</ulink> tool.</listitem>
2222                                         </orderedlist>
2223                                         <para>You can pre-install the signing key into the file <filename>install.rdf</filename> directly, or install it into a copy as <emphasis>install.mccoy.rdf</emphasis>. If the latter exists it will be copied into the build instead of the original file <filename>install.rdf</filename>.</para>
2224                                 </section>
2225                                 <section>
2226                                         <title>Autoupdate Host</title>
2227                                         <para>The name of the automatic update host can be provided in either of two ways:</para>
2228                                         <orderedlist>
2229                                                 <listitem>At configuration time for the normal build of the Evergreen server-side software, or</listitem>
2230                                                 <listitem>During a manual Staff Client build process.</listitem>
2231                                         </orderedlist>
2232                                         <para/>
2233                                         <itemizedlist>
2234                                                 <listitem>
2235                                                         <para>At configuration time for the normal build of Evergreen server-side software</para>
2236                                                         <para>This must be done when the Evergreen server-side software is first configured (see <xref linkend="serversideinstallation-configure"/>). As the <systemitem class="username">opensrf</systemitem> user, use the <command>configure</command> utility as shown:</para>
2237                                                         <figure>
2238                                                                 <title>Commands to configure Evergreen</title>
2239                                                                 <screen>
2240                                                                 $ su - opensrf
2241                                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
2242                                                                 $ ./configure --prefix=/openils --sysconfdir=/openils/conf --with-updateshost=hostname
2243                                                                 $ make
2244                                                                 ...
2245                                                                 </screen>
2246                                                         </figure>
2247                                                 </listitem>
2248                                                 <listitem>
2249                                                         <para>During a manual Staff Client build process</para>
2250                                                         <para>You will used the variable AUTOUPDATE_HOST=hostname (see above). If you specify just a hostname (such as <uri>example.com</uri>) then the URL will be a secure URL (such as <uri>https://example.com</uri>. If you wish to use a non-HTTPS URL then prefix the hostname with "http://" (such as <uri>http://example.com</uri>).</para>
2251                                                         <para>If neither option is used then, by default, the Staff Client will not include the automatic update preferences.</para>
2252                                                 </listitem>
2253                                         </itemizedlist>
2254                                 </section>
2255                                 <section>
2256                                         <title>Building Updates</title>
2257                                         <para>Similar to building clients, the targets <literal>generic-updates</literal>, <literal>win-updates</literal>, <literal>linux-updates</literal>, and <literal>extension-updates</literal> can be used individually with <command>make</command> to build the update files for the Staff Client. To build all the targets at once, simply use the target <literal>updates</literal>.</para>
2258                                         <para>A "full" update will be built for each specified target (or for all if you use the target <literal>updates</literal>). For all but extensions any previous "full" updates (archived by default in the directory <filename class="directory">/openils/var/updates/archives</filename>) will be used to make "partial" updates. Partial updates tend to be much smaller and will thus download more quickly, but if something goes wrong with a partial update the full update will be used as a fallback. Extensions do not currently support partial updates.</para>
2259                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2260                                         <figure>
2261                                                 <title>Commands for building updates</title>
2262                                                 <screen>
2263                                                 $ su - opensrf
2264                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2265         
2266                                                 # command to build all updates at once:
2267                                                 $ make updates
2268                                                 ...
2269         
2270                                                 # commands to build updates individually:
2271                                                 $ make generic-updates
2272                                                 ...
2273                                                 $ make win-updates
2274                                                 ...
2275                                                 $ make linux-updates
2276                                                 ...
2277                                                 $ make extension-updates
2278                                                 ...
2279                                                 </screen>
2280                                         </figure>
2281                                 </section>
2282                                 <section>
2283                                         <title>Building updates with clients</title>
2284                                         <para>To save time and effort you can build updates and manual download clients at the same time by adding the string "-client" to each target name. For instance, you can specify <literal>win-updates-client</literal>. You can also specify <literal>updates-client</literal> to build all the targets at once. This does not work for extension-updates.</para>
2285                                         <para>The clients will be installed alongside the updates and listed on the web page <uri>manualupdate.html</uri>, rather than left in the Staff Client directory.</para>
2286                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2287                                         <figure>
2288                                                 <title>Commands for building updates</title>
2289                                                 <screen>
2290                                                 $ su - opensrf
2291                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2292         
2293                                                 # command to build all updates at once:
2294                                                 $ make updates-client
2295                                                 ...
2296         
2297                                                 # commands to build updates individually:
2298                                                 $ make generic-updates-client
2299                                                 ...
2300                                                 $ make win-updates-client
2301                                                 ...
2302                                                 $ make linux-updates-client
2303                                                 ...
2304                                                 </screen>
2305                                         </figure>
2306                                 </section>
2307                                 <section>
2308                                         <title>Activating the Update Server</title>
2309                                         <para>This section reviews scripts associated with the update server, and requires some final adjustments to file permissions.</para>
2310                                         <para>The Apache example configuration creates a directory <filename class="directory">updates</filename> that, by default, points to the directory <filename class="directory">/openils/var/updates/pub</filename>. This directory contains one HTML file and several specially-named script files.</para>
2311                                         <para>The file <filename>updatedetails.html</filename> is the fallback web page for the update details. The <application>check</application> script is used for <emphasis>XULRunner</emphasis> updates. The <application>update.rdf</application> script is used for extension updates. The <application>manualupdate.html</application> script checks for clients to provide download links when automatic updates have failed and uses the download script to force a download of the generic client XPI (compared to Firefox trying to install it as an extension).</para>
2312                                         <para>The following scripts should be marked as executable: <emphasis>check, download, manualupdate.html, update.rdf</emphasis>. As the <systemitem class="username">root</systemitem> user, change directory to the updates directory, then execute the following commands:</para>
2313                                         <figure>
2314                                                 <title>Changing file permissions of scripts</title>
2315                                                 <screen>
2316                                                 $ su - root
2317                                                 $ cd /openils/var/updates/pub
2318                                                 $ chmod +x  check  download  manualupdate.html  update.rdf
2319                                                 </screen>
2320                                         </figure>
2321                                 </section>
2322                         </section>
2323                         <section>
2324                                 <title>Other tips</title>
2325                                 <section>
2326                                         <title>Multiple workstations on one install</title>
2327                                         <para>Multiple workstation registrations for the same server can be accomplished with a single Staff Client install by using multiple profiles. When running <emphasis>XULRunner</emphasis> you can specify the option <option>-profilemanager</option> or <option>-P</option> (uppercase "P") to force the Profile Manager to start. Unchecking the option <option>Don't ask at startup</option> will make this the default.</para>
2328                                         <para>Once you have opened the Profile Manager you can create additional profiles, one for each workstation you wish to register. You may need to install SSL exceptions for each profile.</para>
2329                                         <para>When building targets <literal>win-client</literal>, <literal>win-updates-client</literal>, or <literal>updates-client</literal>, you can specify <literal>NSIS_EXTRAOPTS=-DPROFILES</literal> to add an "Evergreen Staff Client Profile Manager" option to the start menu.</para>
2330                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2331                                         <figure>
2332                                                 <title>Command to add start menu option</title>
2333                                                 <screen>
2334                                                 $ su - opensrf
2335                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2336                                                 $ make NSIS_EXTRAOPTS=-DPROFILES win-client
2337                                                 ...
2338                                                 </screen>
2339                                         </figure>
2340                                 </section>
2341                                 <section>
2342                                         <title> Multiple Staff Clients</title>
2343                                         <para>This may be confusing if you are not careful, but you can log in to multiple Evergreen servers at the same time, or a single Evergreen server multiple times. In either case you will need to create an additional profile for each additional server or workstation you want to log in as (see previous tip).</para>
2344                                         <para>Once you have created the profiles, run <emphasis>XULRunner</emphasis> with the option <option>-no-remote</option> (in addition to <option>-profilemanger</option> or <option>-P</option> if neeeded). Instead of <emphasis>XULRunner</emphasis> opening a new login window on your existing session it will start a new session instead, which can then be logged in to a different server or workstation ID.</para>
2345                                 </section>
2346                         </section>
2347                 </section>
2348                 <section xml:id="serversideinstallation-running-staffclient">
2349                         <title>Running the Staff Client</title>
2350                         <para>Run the Staff Client on a <systemitem class="osname">Linux</systemitem> system by using the application <emphasis>XULRunner</emphasis> (installed automatically and by default with Firefox version 3.0 and later on <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem> distributions).</para>
2351                         <para>For example, if the source files for the Evergreen installation are in the directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7/</filename>, start the Staff Client as shown in the following command example:</para>
2352                         <figure>
2353                                 <title>Commands to run the Staff Client</title>
2354                                 <screen>
2355                                 $ su - opensrf
2356                                 $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
2357                                 </screen>
2358                         </figure>
2359                 </section>
2360                 <section xml:id="serversideinstallation-proxy">
2361                         <title>Configuring a Proxy for the Staff Client</title>
2362                         <section>
2363                                 <title>Why Use a Proxy for the Staff Client?</title>
2364                                 <para>There are several reasons for sending network traffic for the Staff Client through an SSH proxy:</para>
2365                                 <itemizedlist>
2366                                         <listitem>
2367                                                 <para><emphasis role="bold">Firewalls</emphasis> may prevent you from reaching the server. This may happen when you are connecting the Staff Client to a test server that should not be available generally, or it may be the result of network design priorities other than ease of use.</para>
2368                                         </listitem>
2369                                         <listitem>
2370                                                 <para>You may wish to <emphasis role="bold">improve security</emphasis> where Staff Client traffic may be susceptible to network eavesdropping. This is especially true when wireless is otherwise the best option for connecting a staff machine to the network.</para>
2371                                         </listitem>
2372                                 </itemizedlist>
2373                         </section>
2374                         <section>
2375                                 <title>Setting Up an SSH Tunnel</title>
2376                                 <para>You will need a server that has network access to the Evergreen server you want to reach, and allows you to log in there via SSH. Use your username and password for that SSH server to set up a tunnel.</para>
2377                                 <para>For <systemitem class="osname">Windows</systemitem> users, one good solution is the open-source utility <ulink url="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</ulink>, a free telnet/SSH client. An example of setting up a <application>PuTTY</application> session follows:</para>
2378                                 <figure>
2379                                         <title>Setting up an SSH tunnel in PuTTY</title>
2380                                         <mediaobject>
2381                                                 <imageobject>
2382                                                         <imagedata fileref="../media/serversideinstallation-proxy-putty.png" scalefit="1" width="70%"/>
2383                                                 </imageobject>
2384                                         </mediaobject>
2385                                 </figure>
2386                                 <procedure>
2387                                         <step>Use the menu on the left to go to <emphasis><menuchoice><guimenu>Connection</guimenu><guimenuitem>SSH</guimenuitem><guimenuitem>Tunnels</guimenuitem></menuchoice></emphasis>.</step>
2388                                         <step>Enter <literal>9999</literal> in the "Source port".</step>
2389                                         <step>Choose <guibutton>Dynamic</guibutton>. Do not enter anything in the Destination text entry box.</step>
2390                                         <step>Click <guibutton>Add</guibutton>. "D9999" will now appear in the "Forwarded ports" list.</step>
2391                                         <step>Use the menu on the left to go back to "Session", and enter the host name of the SSH server.</step>
2392                                         <step>A window will open up so that you can enter your username and password. Once you are logged in, the tunnel is open.</step>
2393                                 </procedure>
2394                         </section>
2395                         <section>
2396                                 <title>Configuring the Staff Client to Use the SSH Tunnel</title>
2397                                 <para>In order to tell the Staff Client that all traffic should be sent through the SSH tunnel just configured, you must edit the file <filename>C:\Program Files\Evergreen Staff Client\greprefs\all.js</filename>. Search this file for the word <emphasis role="bold">socks</emphasis> to find the appropriate section for the following changes.</para>
2398                                 <figure>
2399                                         <title>The SOCKS section of <filename>all.js</filename> before changes</title>
2400                                         <mediaobject>
2401                                                 <imageobject>
2402                                                         <imagedata fileref="../media/serversideinstallation-proxy-socks-1.png" scalefit="1" width="70%"/>
2403                                                 </imageobject>
2404                                         </mediaobject>
2405                                 </figure>
2406                                 <para>Make the following changes:</para>
2407                                 <itemizedlist>
2408                                         <listitem>Change the value of <emphasis>network.proxy.socks</emphasis> from <emphasis role="bold">""</emphasis> to <emphasis role="bold">"localhost"</emphasis>.</listitem>
2409                                         <listitem>Change the value of <emphasis>network.proxy.socks_port</emphasis> from <emphasis role="bold">"0"</emphasis> to <emphasis role="bold">9999</emphasis>.</listitem>
2410                                 </itemizedlist>
2411                                 <figure xml:id="serversideinstallation-socks-figure">
2412                                         <title>The SOCKS section of <filename>all.js</filename> after changes</title>
2413                                         <mediaobject>
2414                                                 <imageobject>
2415                                                         <imagedata fileref="../media/serversideinstallation-proxy-socks-2.png" scalefit="1" width="70%"/>
2416                                                 </imageobject>
2417                                         </mediaobject>
2418                                 </figure>
2419                                 <para>If everything is working correctly, you should now be able to run the Staff Client and all its data will be sent encrypted through the SSH tunnel you have just configured.</para>
2420                         </section>
2421                 </section>
2422         </section>
2423         <index/>
2424 </chapter>