]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
c3e001ab9c0ba8089732e02c2fbf31c35f8c66aa
[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-evergreen-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>Change <literal>{max_user_sessions, 10}.</literal> to <literal>{max_user_sessions, 10000}.</literal> 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></listitem>
250                                         <listitem>Change all three occurrences of <literal>max_stanza_size</literal> to <literal>2000000</literal>.</listitem>
251                                         <listitem>Change both occurrences of <literal>maxrate</literal> to <literal>500000</literal>.</listitem>
252                                         <listitem>Comment out the line <literal>{mod_offline, []}</literal> by placing two <literal>%</literal> comment signs in front.</listitem>
253                                 </itemizedlist>
254                         </section>
255                         <section>
256                                 <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>
257                                 <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>
258                                 <figure>
259                                         <title>Commands to restart the <systemitem class="service">ejabberd</systemitem> service</title>
260                                         <screen>
261                                         $ /etc/init.d/ejabberd start
262                                         </screen>
263                                 </figure>
264                         </section>
265                         <section>
266                                 <title>Register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>
267                                 <para>On each domain, you need two <systemitem class="service">ejabberd</systemitem> users to manage the OpenSRF communications:</para>
268                                 <itemizedlist>
269                                         <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>
270                                         <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>
271                                 </itemizedlist>
272                                 <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>
273                                 <figure>
274                                         <title>Commands to register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>
275                                         <programlisting language="xml"><![CDATA[
276                                         # Syntax for registering a user with ejabberdctl:
277                                         #    ejabberdctl register <user> <domain> <password>
278                                         #
279                                         $ ejabberdctl register router private.localhost  <password>
280                                         $ ejabberdctl register opensrf private.localhost <password>
281                                         $ ejabberdctl register router public.localhost   <password>
282                                         $ ejabberdctl register opensrf public.localhost  <password>
283                                         ]]></programlisting>
284                                 </figure>
285                         </section>
286                         <section>
287                                 <title>Create configuration files</title>
288                                 <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>
289                                 <figure>
290                                         <title>Commands to create configuration files</title>
291                                         <screen>
292                                         $ su - root
293                                         $ cd /openils/conf
294                                         $ cp opensrf.xml.example      opensrf.xml
295                                         $ cp opensrf_core.xml.example opensrf_core.xml
296                                         </screen>
297                                 </figure>
298                         </section>
299                         <section>
300                                 <title>Edit opensrf_core.xml</title>
301                                 <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>
302                                 <note>
303                                         <para>
304                                                 <emphasis>The following example uses common XPath syntax on the left-hand side to indicate the approximage position needing changes within the XML file.</emphasis>
305                                         </para>
306                                 </note>
307                                 <figure>
308                                         <title>Updates needed in the file <filename>/openils/conf/opensrf_core.xml</filename></title>
309                                         <screen>
310                                         /config/opensrf/username = opensrf
311
312                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
313
314                                         /config/gateway/username = opensrf
315
316                                         /config/gateway/passwd = password for "public.localhost" opensrf user
317
318                                         # first entry, where "transport/server" == "public.localhost" :
319                                         /config/routers/router/transport 
320                                             username = router
321                                             password = password for "public.localhost" router user
322
323                                         # second entry, where "transport/server" == "private.localhost" :
324                                         /config/routers/router/transport
325                                             username = router
326                                             password = password for "private.localhost" router user
327                                         </screen>
328                                 </figure>
329                                 <para>You also need to specify the domains from which OpenSRF will accept and to which OpenSRF 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>
330                         </section>
331                         <section>
332                                 <title>Modify the file <filename>opensrf.xml</filename></title>
333                                 <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>
334                                 <figure>
335                                         <title>Example of the file <filename>opensrf.xml</filename></title>
336                                         <programlisting language="xml"><![CDATA[
337                                         <!-- Example of an app-specific setting override -->
338                                         <opensrf.persist>
339                                           <app_settings>
340                                             <dbfile>/tmp/persist.db</dbfile>
341                                           </app_settings>
342                                         </opensrf.persist>
343                                         ]]></programlisting>
344                                 </figure>
345                         </section>
346                         <section>
347                                 <title>Create Configuration Files for Users Needing <application>srfsh</application></title>
348                                 <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>
349                                 <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>
350                                 <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 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>
351                                 <itemizedlist>
352                                         <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>
353                                         <listitem>Modify <literal>username</literal> and <literal>password</literal> to match the <literal>opensrf</literal> Jabber user for the chosen domain</listitem>
354                                         <listitem>Modify <literal>logfile</literal> to be the full path for a log file to which the user has write access</listitem>
355                                         <listitem>Modify <literal>loglevel</literal> as needed for testing</listitem>
356                                 </itemizedlist>
357                                 <figure>
358                                         <title>Example of the file <filename>/openils/conf/srfsh.xml.example</filename></title>
359                                         <programlisting language="xml"><![CDATA[
360                                         <?xml version="1.0"?>
361                                         <!-- This file follows the standard bootstrap config file layout -->
362                                         <!-- found in opensrf_core.xml -->
363                                         <srfsh>
364                                         <router_name>router</router_name>
365                                         <domain>private.localhost</domain>
366                                         <username>opensrf</username>
367                                         <passwd>privsrf</passwd>
368                                         <port>5222</port>
369                                         <logfile>/tmp/srfsh.log</logfile>
370                                         <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
371                                         <loglevel>4</loglevel>
372                                         </srfsh>
373                                         ]]></programlisting>
374                                 </figure>
375                         </section>
376                         <section>
377                                 <title>Modify Environmental Variable PATH for <systemitem class="username">opensrf</systemitem> User</title>
378                                 <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>
379                                 <figure>
380                                         <title>Commands to add path to <filename>.bashrc</filename> configuration file</title>
381                                         <screen>
382                                         $ su - opensrf
383                                         $ echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc
384                                         </screen>
385                                 </figure>
386                         </section>
387                         <section>
388                                 <title>Starting OpenSRF</title>
389                                 <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services:</para>
390                                 <figure>
391                                         <title>Commands to start <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services</title>
392                                         <screen>
393                                         $ su - root
394                                         $ /etc/init.d/ejabberd start
395                                         $ /etc/init.d/memcached start
396                                         </screen>
397                                 </figure>
398                                 <para/>
399                                 <para>Finally, as the <systemitem class="username">opensrf</systemitem> user, start OpenSRF:</para>
400                                 <figure>
401                                         <title>Commands to start OpenSRF</title>
402                                         <screen>
403                                         $ su - opensrf
404
405                                         # ensure you have the needed path
406                                         $ export PATH=$PATH:/openils/bin
407
408                                         # start the OpenSRF service:
409                                         # use "-l" to force hostname to be "localhost"
410                                         $ osrf_ctl.sh -l -a start_all     
411                                         </screen>
412                                 </figure>
413                                 <note>
414                                         <para>
415                                                 <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>
416                                         </para>
417                                 </note>
418                         </section>
419                         <section>
420                                 <title>Testing connections to OpenSRF</title>
421                                 <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>
422                                 <figure>
423                                         <title>Commands to test OpenSRF with <application>srfsh</application></title>
424                                         <screen>
425                                         $ su - opensrf
426                                         $ /openils/bin/srfsh
427                                         srfsh#  request opensrf.math add 2 2
428                                         Received Data: 4
429                                         ------------------------------------
430                                         Request Completed Successfully
431                                         Request Time in seconds: 0.007519
432                                         ------------------------------------
433                                         srfsh#
434                                         </screen>
435                                 </figure>
436                                 <indexterm>
437                                         <primary>ZZZ-REVIEW</primary>
438                                         <secondary>VERIFY THIS TEST </secondary>
439                                 </indexterm>
440                                 <caution>VERIFY THIS TEST </caution>
441                                 <para>For other <application>srfsh</application> commands, type <userinput>help</userinput> in at the prompt.</para>
442                         </section>
443                         <section>
444                                 <title>Stopping OpenSRF</title>
445                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop OpenSRF:</para>
446                                 <figure>
447                                         <title>Commands to stop OpenSRF</title>
448                                         <screen>
449                                         $ su - opensrf
450                                         $ osrf_ctl.sh -l -a stop_all
451                                         </screen>
452                                 </figure>
453                         </section>
454                 </section>
455                 <section xml:id="serversideinstallation-ubuntudebian">
456                         <title>Installing Evergreen 1.6.x.x On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>
457                         <para>This section outlines the installation process for the latest stable version of Evergreen.</para>
458                         <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>
459                         <note>
460                                 <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 <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server edition.</para>
461                                 <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>
462                                 <itemizedlist>
463                                         <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>
464                                         <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>
465                                 </itemizedlist>
466                                 <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>
467                         </note>
468                         <section>
469                                 <title>Installing OpenSRF</title>
470                                 <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>
471                                 <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>
472                         </section>
473                         <section>
474                                 <title>Download and Unpack Latest Evergreen Version</title>
475                                 <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>
476                                 <figure>
477                                         <title>Commands to download and unpack Evergreen</title>
478                                         <screen>
479                                         $ su - opensrf
480                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz
481                                         $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz
482                                         </screen>
483                                 </figure>
484                                 <para>The new directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7</filename> will be created.</para>
485                         </section>
486                         <section>
487                                 <title>Install Prerequisites to Build Evergreen</title>
488                                 <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>
489                                 <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>
490                                 <figure>
491                                         <title>Commands to install prerequisites for Evergreen</title>
492                                         <screen>
493                                         $ su - root
494                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
495                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]
496                                         ...
497                                         </screen>
498                                 </figure>
499                                 <table xml:id="serversideinstallation-keywords-figure-2">
500                                         <title>Keywords Targets for <application>make</application></title>
501                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
502                                                 <colspec colnum="1" colwidth="1*"/>
503                                                 <colspec colnum="2" colwidth="3*"/>
504                                                 <thead>
505                                                         <row>
506                                                                 <entry>Keyword</entry>
507                                                                 <entry>Description</entry>
508                                                         </row>
509                                                 </thead>
510                                                 <tbody>
511                                                         <row>
512                                                                 <entry>debian-lenny</entry>
513                                                                 <entry>for Debian Lenny (5.0), the most recent version</entry>
514                                                         </row>
515                                                         <row>
516                                                                 <entry>debian-etch</entry>
517                                                                 <entry>for Debian Etch (4.0)</entry>
518                                                         </row>
519                                                         <row>
520                                                                 <entry>ubuntu-karmic</entry>
521                                                                 <entry>for Ubuntu Lucid (10.04) [same as for Karmic]</entry>
522                                                         </row>
523                                                         <row>
524                                                                 <entry>ubuntu-karmic</entry>
525                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
526                                                         </row>
527                                                         <row>
528                                                                 <entry>ubuntu-intrepid</entry>
529                                                                 <entry>for Ubuntu Intrepid (8.10)</entry>
530                                                         </row>
531                                                         <row>
532                                                                 <entry>ubuntu-hardy</entry>
533                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
534                                                         </row>
535                                                         <row>
536                                                                 <entry>ubuntu-gutsy</entry>
537                                                                 <entry>for Ubuntu Gutsy (7.10)</entry>
538                                                         </row>
539                                                         <row>
540                                                                 <entry>gentoo</entry>
541                                                                 <entry>generic for Gentoo versions</entry>
542                                                         </row>
543                                                         <row>
544                                                                 <entry>centos</entry>
545                                                                 <entry>generic for Centos versions</entry>
546                                                         </row>
547                                                 </tbody>
548                                         </tgroup>
549                                 </table>
550                                 <indexterm>
551                                         <primary>ZZZ-REVIEW</primary>
552                                         <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>
553                                 </indexterm>
554                                 <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
555                         </section>
556                         <section>
557                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>
558                                 <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>
559                                 <para>For further information on installing PostgreSQL, see <xref linkend="serversideinstallation-postgresql"/>.</para>
560                                 <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>
561                                 <figure>
562                                         <title>Commands to install the PostgreSQL server</title>
563                                         <screen>
564                                         $ su - root
565         
566                                         # Debian Lenny and Ubuntu Hardy (8.04)
567                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
568                                         ...
569
570                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
571                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
572                                         ...
573                                         </screen>
574                                 </figure>
575                                 <note>
576                                         <para>
577                                                 <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>
578                                         </para>
579                                 </note>
580                                 <indexterm>
581                                         <primary>ZZZ-REVIEW</primary>
582                                         <secondary>VERIFY: IS THIS STILL TRUE? </secondary>
583                                 </indexterm>
584                                 <caution>VERIFY: IS THIS STILL TRUE? </caution>
585                                 <indexterm>
586                                         <primary>ZZZ-REVIEW</primary>
587                                         <secondary>ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE </secondary>
588                                 </indexterm>
589                                 <caution>ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE </caution>
590                         </section>
591                         <section>
592                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
593                                 <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>
594                                 <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>
595                                 <figure>
596                                         <title>Commands to install Perl modules</title>
597                                         <screen>
598                                         # ensure the gcc compiler is installed
599                                         $ su - root
600                                         $ aptitude install gcc
601         
602                                         # install the Perl modules
603                                         $ perl -MCPAN -e shell
604                                         cpan> install JSON::XS
605                                         cpan> install MARC::Record
606                                         cpan> install MARC::File::XML
607                                         </screen>
608                                 </figure>
609                                 <indexterm>
610                                         <primary>ZZZ-REVIEW</primary>
611                                         <secondary>ADD INFO ON HOW TO INSTALL THE PERL MODULES </secondary>
612                                 </indexterm>
613                                 <caution>ADD INFO ON HOW TO INSTALL THE PERL MODULES </caution>
614                                 <indexterm>
615                                         <primary>ZZZ-REVIEW</primary>
616                                         <secondary>ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </secondary>
617                                 </indexterm>
618                                 <caution>ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </caution>
619                         </section>
620                         <section>
621                                 <title>Update the System Dynamic Library Path</title>
622                                 <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>
623                                 <figure>
624                                         <title>Commands to modify system dynamic library path</title>
625                                         <screen>
626                                         $ su - root
627                                         $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
628                                         /usr/local/lib
629                                         /usr/local/lib/dbd
630                                         ENDOFFILE
631                                         $ ldconfig
632                                         </screen>
633                                 </figure>
634                         </section>
635                         <section>
636                                 <title>(OPTIONAL) Restart the PostgreSQL Server</title>
637                                 <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>
638                                 <indexterm>
639                                         <primary>ZZZ-REVIEW</primary>
640                                         <secondary>ADD INFO ON OTHER VERSIONS OF POSTGRESQL </secondary>
641                                 </indexterm>
642                                 <caution>ADD INFO ON OTHER VERSIONS OF POSTGRESQL </caution>
643                                 <figure>
644                                         <title>Commands to restart PostgreSQL server</title>
645                                         <screen>
646                                         $ su - root
647                                         $ /etc/init.d/postgresql-PGSQL_VERSION restart
648                                         </screen>
649                                 </figure>
650                                 <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</emphasis>
651                         </section>
652                         <section xml:id="serversideinstallation-configure">
653                                 <title>Configure Evergreen</title>
654                                 <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>
655                                 <figure>
656                                         <title>Commands to configure Evergreen</title>
657                                         <screen>
658                                         $ su - opensrf
659                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
660                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
661                                         $ make
662                                         ...
663                                         </screen>
664                                 </figure>
665                         </section>
666                         <section xml:id="serversideinstallation-compilingevergreen">
667                                 <title>Compile, Link and Install Evergreen</title>
668                                 <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>
669                                 <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>
670                                 <para>For further information on manually building the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>
671                                 <figure>
672                                         <title>Commands to build, link and install Evergreen</title>
673                                         <screen>
674                                         $ su - root
675                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
676                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
677                                         ...
678                                         </screen>
679                                         <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>
680                                 </figure>
681                                 <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>
682                                 <figure>
683                                         <title>Commands to create symbolic link</title>
684                                         <screen>
685                                         $ su - root
686                                         $ cd /openils/var/web/xul
687                                         $ ln -sf rel_1_6_0_7/server server
688                                         </screen>
689                                 </figure>
690                         </section>
691                         <section>
692                                 <title>Copy the OpenSRF Configuration Files</title>
693                                 <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>
694                                 <figure>
695                                         <title>Commands to copy OpenSRF configuration files</title>
696                                         <screen>
697                                         $ su - root
698                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
699                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
700                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
701                                         $ chown -R opensrf:opensrf /openils/
702                                         </screen>
703                                 </figure>
704                         </section>
705                         <section>
706                                 <title>Create and Configure PostgreSQL Database</title>
707                                 <para>As the <systemitem class="username">postgres</systemitem> user on your PostgreSQL server, create the Evergreen database.</para>
708                                 <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 <systemitem class="osname">Ubuntu 8.04</systemitem>, the path would be <filename class="directory">/usr/share/postgresql/8.3/contrib/</filename>.</para>
709                                 <procedure>
710                                         <step>
711                                                 <para>
712                                                         <emphasis role="bold">Create and configure the database</emphasis>
713                                                 </para>
714                                                 <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
715                                                 <figure>
716                                                         <title>Commands to create database and adjust the path</title>
717                                                         <screen>
718                                                         # create the database
719                                                         $ su - postgres
720                                                         $ createdb -E UNICODE evergreen
721                                                         $ createlang plperl   evergreen
722                                                         $ createlang plperlu  evergreen
723                                                         $ createlang plpgsql  evergreen
724                 
725                                                         # adjust the paths
726                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen
727                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen
728                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen
729                                                         </screen>
730                                                 </figure>
731                                                 <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</emphasis>
732                                         </step>
733                                         <step>
734                                                 <para>
735                                                         <emphasis role="bold">Create new Evergreen superuser</emphasis>
736                                                 </para>
737                                                 <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>
738                                                 <figure>
739                                                         <title>Commands to create the <systemitem class="username">evergreen</systemitem> user</title>
740                                                         <screen>
741                                                         # create superuser 'evergreen' and set the password
742                                                         $ su - postgres
743                                                         $ createuser -P -s evergreen
744                                                         Enter password for new role: MYNEWPASSWORD
745                                                         Enter it again: MYNEWPASSWORD
746                                                         </screen>
747                                                 </figure>
748                                                 <emphasis>Where <literal>MYNEWPASSWORD</literal> is the password chosen.</emphasis>
749                                         </step>
750                                 </procedure>
751                         </section>
752                         <section>
753                                 <title>Create Database Schema</title>
754                                 <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>
755                                 <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>
756                                 <figure>
757                                         <title>Commands to create Evergreen database schema</title>
758                                         <screen>
759                                         $ su - root
760                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
761                                         $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
762                                                 --service all --create-schema --create-bootstrap --create-offline \
763                                                 --hostname HOSTNAME --port PORT \
764                                                 --user evergreen --password PASSWORD --database DATABASENAME
765                                         </screen>
766                                 </figure>
767                                 <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>
768                                 <note>
769                                         <para>
770                                                 <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>
771                                         </para>
772                                 </note>
773                         </section>
774                         <section xml:id="serversideinstallation-modify-apache">
775                                 <title>Modify the Apache Configuration</title>
776                                 <para>The Apache configuration must be updated in several ways to support Evergreen.</para>
777                                 <section>
778                                         <title>Configure the Apache Server</title>
779                                         <para>Enable some built-in Apache modules with the utility <command>a2enmod</command>, and install some additional Apache configuration files. As the <systemitem class="username">root</systemitem> user, enable some modules in the Apache server, then copy the new configuration files to the Apache server directories:</para>
780                                         <figure>
781                                                 <title>Commands to configure the Apache server</title>
782                                                 <screen>
783                                                 # configure the Apache server
784                                                 $ su - root
785                                                 $ a2enmod ssl        # enable mod_ssl
786                                                 $ a2enmod rewrite    # enable mod_rewrite
787                                                 $ a2enmod expires    # enable mod_expires
788                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
789                 
790                                                 # copy files
791                                                 $ cp Open-ILS/examples/apache/eg.conf    /etc/apache2/sites-available/
792                                                 $ cp Open-ILS/examples/apache/eg_vhost.conf   /etc/apache2/
793                                                 $ cp Open-ILS/examples/apache/startup.pl      /etc/apache2/
794                                                 </screen>
795                                         </figure>
796                                 </section>
797                                 <section xml:id="serversideinstallation-createsslkey">
798                                         <title>Create a Security Certificate (SSL Key)</title>
799                                         <para>Create a new SSL key for the Apache server with the command <command>openssl</command>. 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>
800                                         <figure>
801                                                 <title>Commands to create an SSL key</title>
802                                                 <screen>
803                                                 $ mkdir /etc/apache2/ssl
804                                                 $ cd /etc/apache2/ssl
805                                                 $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
806                                                 </screen>
807                                         </figure>
808                                         <warning>
809                                                 <para>
810                                                         <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>
811                                                 </para>
812                                                 <para>For further information on getting a proper SSL certificate, see <xref linkend="serversideinstallation-ssl"/>.</para>
813                                         </warning>
814                                 </section>
815                                 <section>
816                                         <title>Modify the Apache Configuration File</title>
817                                         <para>Several changes are needed in the new Apache configuration file <filename>/etc/apache2/sites-available/eg.conf</filename>. As the <systemitem class="username">root</systemitem> user, edit the file and make the following changes:</para>
818                                         <procedure>
819                                                 <step>
820                                                         <para>Comment out the line <literal>Allow from 10.0.0.0/8</literal>, then uncomment the line <literal>Allow from all</literal>.</para>
821                                                         <para>
822                                                                 <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>
823                                                         </para>
824                                                         <warning>
825                                                                 <para>
826                                                                         <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>
827                                                                 </para>
828                                                         </warning>
829                                                 </step>
830                                                 <step>
831                                                         <para>Comment out the line <literal>Listen 443</literal>, since 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>
832                                                         <indexterm>
833                                                                 <primary>ZZZ-REVIEW</primary>
834                                                                 <secondary>ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </secondary>
835                                                         </indexterm>
836                                                         <caution>ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </caution>
837                                                 </step>
838                                                 <step>
839                                                         <warning>
840                                                                 <para>The following updates are needed to allow the logs to function properly, but it may break other Apache applications on your server.</para>
841                                                         </warning>
842                                                         <itemizedlist>
843                                                                 <listitem>
844                                                                         <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 phrase: <literal>User www-data</literal> to the phrase: <literal>User opensrf</literal>.</para>
845                                                                 </listitem>
846                                                                 <listitem>
847                                                                         <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: <literal>export APACHE_RUN_USER=www-data</literal> to the phrase: <literal>export APACHE_RUN_USER=opensrf</literal>.</para>
848                                                                 </listitem>
849                                                         </itemizedlist>
850                                                 </step>
851                                                 <step>
852                                                         <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and add the lines <literal>KeepAliveTimeout 1</literal> and <literal>MaxKeepAliveRequests 100</literal>, or modify any existing lines.</para>
853                                                 </step>
854                                         </procedure>
855                                 </section>
856                                 <section>
857                                         <title>(OPTIONAL) Performance Modifications for Apache</title>
858                                         <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>
859                                         <procedure>
860                                                 <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>
861                                                 <figure>
862                                                         <title>(OPTIONAL) Example of updates to Apache configuration</title>
863                                                         <programlisting language="xml"><![CDATA[
864                                                         <IfModule mpm_prefork_module>
865                                                            StartServers           20
866                                                            MinSpareServers         5
867                                                            MaxSpareServers        15
868                                                            MaxClients            150
869                                                            MaxRequestsPerChild 10000
870                                                         </IfModule>
871                                                         ]]></programlisting>
872                                                 </figure>
873                                         </procedure>
874                                 </section>
875                                 <section>
876                                         <title>Enable the Evergreen Web Site</title>
877                                         <para>Finally, 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                         <section xml:id="serversideinstallation-opensrf-config">
893                                 <title>Modify the OpenSRF Configuration File</title>
894                                 <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>
895                                 <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>
896                                 <note>
897                                         <para>
898                                                 <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>
899                                         </para>
900                                 </note>
901                                 <indexterm>
902                                         <primary>ZZZ-REVIEW</primary>
903                                         <secondary>ADD A BETTER DIAGRAM HERE </secondary>
904                                 </indexterm>
905                                 <caution>ADD A BETTER DIAGRAM HERE </caution>
906                                 <figure>
907                                         <title>Updates needed in the file <filename>/openils/conf/opensrf_core.xml</filename></title>
908                                         <screen>
909                                         /config/opensrf/username = opensrf
910         
911                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
912         
913                                         /config/gateway/username = opensrf
914         
915                                         /config/gateway/passwd = password for "public.localhost" opensrf user
916         
917                                         # first entry, where "transport/server" == "public.localhost" :
918                                         /config/routers/router/transport 
919                                             username = router
920                                             password = password for "public.localhost" router user
921
922                                         # second entry, where "transport/server" == "private.localhost" :
923                                         /config/routers/router/transport
924                                             username = router
925                                             password = password for "private.localhost" router user
926                                         </screen>
927                                 </figure>
928                         </section>
929                         <section xml:id="serversideinstallation-srfsh">
930                                 <title>Create Configuration Files for Users Needing <application>srfsh</application></title>
931                                 <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>
932                                 <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>
933                                 <procedure>
934                                         <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>
935                                         <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>
936                                         <step>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</step>
937                                         <step>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</step>
938                                 </procedure>
939                                 <figure>
940                                         <title>Example of user's file <filename>.srfsh.xml</filename></title>
941                                         <programlisting language="xml"><![CDATA[
942                                         <?xml version="1.0"?>
943                                         <!-- This file follows the standard bootstrap config file layout -->
944                                         <!-- found in opensrf_core.xml -->
945                                         <srfsh>
946                                         <router_name>router</router_name>
947                                         <domain>private.localhost</domain>
948                                         <username>opensrf</username>
949                                         <passwd>evergreen</passwd>
950                                         <port>5222</port>
951                                         <logfile>/tmp/srfsh.log</logfile>
952                                         <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
953                                         <loglevel>4</loglevel>
954                                         </srfsh>
955                                         ]]></programlisting>
956                                 </figure>
957                         </section>
958                         <section xml:id="serversideinstallation-opensrf-env">
959                                 <title>Modify the OpenSRF Environment</title>
960                                 <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>
961                                 <note>
962                                         <para>
963                                                 <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>
964                                         </para>
965                                 </note>
966                                 <figure>
967                                         <title>Commands to modify the OpenSRF environment</title>
968                                         <screen>
969                                         # change permissions
970                                         $ su - opensrf
971                                         $ chmod 755 /openils/var/cgi-bin/*.cgi
972         
973                                         # add environmental variable
974                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
975         
976                                         # inherit the new environment
977                                         $ . ~/.bashrc
978                                         </screen>
979                                 </figure>
980                         </section>
981                         <section xml:id="serversideinstallation-localization">
982                                 <title>(OPTIONAL) Enabling and Disabling Language Localizations</title>
983                                 <para>Current versions of Evergreen (after version 1.4) are bundled with support for a number of languages beyond American English (<emphasis role="bold">en-US</emphasis>). The translated interfaces are split between static files that are automatically installed with Evergreen, and dynamic labels that can be stored in the Evergreen database. Evergreen is installed with additional SQL files that contain translated dynamic labels for a number of languages, and to make the set of translated labels available in all interfaces. Only a few steps are required to enable or disable one or more languages.</para>
984                                 <section>
985                                         <title>Enabling a Localization</title>
986                                         <para>To enable the translated labels for a given language to display in Evergreen, just populate the database with the translated labels and enable the localization. The following example illustrates how to enable Canadian French (<emphasis role="bold">fr-CA</emphasis>) support in the database. These same steps can be used with any of the languages bundled with Evergreen, or you can create and add your own localization.</para>
987                                         <orderedlist>
988                                                 <listitem>
989                                                         <para>The translated labels for each locale are stored in SQL files named "950.data.seed-values-xx-YY.sql" where "xx-YY" represents the locale code for the translation. Load the translated labels into the Evergreen database using the command <command>psql</command>, substituting your user, host and database connection information accordingly:</para>
990                                                         <figure>
991                                                                 <title>Commands to load localizations into database</title>
992                                                                 <programlisting language="xml"><![CDATA[
993                                                                 $ psql -U <username> -h <hostname> -d <database> -f /path/to/Evergreen-source/Open-ILS/src/sql/Pg/950.data.seed-values-fr-CA.sql
994                                                                 ]]></programlisting>
995                                                         </figure>
996                                                 </listitem>
997                                                 <listitem>
998                                                         <para>Ensure the locale is enabled in the Evergreen database by using the utility <command>psql</command> to check for the existence of the locale in the table <literal>config.i18n_locale</literal>:</para>
999                                                         <figure>
1000                                                                 <title>Commands to check for localization</title>
1001                                                                 <screen>
1002                                                                 SELECT code, marc_code, name, description
1003                                                                 FROM config.i18n_locale
1004                                                                 WHERE code = 'fr-CA';
1005                                                                 </screen>
1006                                                         </figure>
1007                                                         <para>As shown in the following example, if one row of output is returned, then the locale is already enabled:</para>
1008                                                         <figure>
1009                                                                 <title>Results of an installed localization</title>
1010                                                                 <screen>
1011                                                                 code  | marc_code |      name       |   description   
1012                                                                 ------+-----------+-----------------+-----------------
1013                                                                 fr-CA | fre       | French (Canada) | Canadian French
1014                                                                 (1 row)
1015                                                                 </screen>
1016                                                         </figure>
1017                                                         <para>If zero rows of output are returned, then the locale is not enabled:</para>
1018                                                         <figure>
1019                                                                 <title>Results of no installed localizations</title>
1020                                                                 <screen>
1021                                                                 code | marc_code | name | description 
1022                                                                 ------+-----------+------+-------------
1023                                                                 (0 rows)
1024                                                                 </screen>
1025                                                         </figure>
1026                                                         <para>To enable a locale, use <command>psql</command> to insert a row into the table <literal>config.i18n_locale</literal> as follows:</para>
1027                                                         <figure>
1028                                                                 <title>Commands to enable a locale in the database</title>
1029                                                                 <screen>
1030                                                                 INSERT INTO config.i18n_locale (code, marc_code, name, description)
1031                                                                 VALUES ('fr-CA', 'fre', 'French (Canada)', 'Canadian French');
1032                                                                 </screen>
1033                                                         </figure>
1034                                                 </listitem>
1035                                         </orderedlist>
1036                                 </section>
1037                                 <section>
1038                                         <title>Disabling a Localization</title>
1039                                         <para>You might not want to offer all of the localizations that are preconfigured in Evergreen. If you choose to disable the dynamic labels for a locale, just delete those entries from the table <literal>config.i18n_locale</literal> using the <command>psql</command> utility:</para>
1040                                         <figure>
1041                                                 <title>Commands to delete localization from table</title>
1042                                                 <screen>
1043                                                 DELETE FROM config.i18n_locale
1044                                                 WHERE code = 'fr-CA';
1045                                                 </screen>
1046                                         </figure>
1047                                 </section>
1048                         </section>
1049                         <section xml:id="serversideinstallation-starting">
1050                                 <title>Starting Evergreen</title>
1051                                 <procedure>
1052                                         <step>
1053                                                 <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>
1054                                                 <figure>
1055                                                         <title>Commands to start <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services</title>
1056                                                         <screen>
1057                                                         $ su - root
1058                                                         $ /etc/init.d/ejabberd start
1059                                                         $ /etc/init.d/memcached start
1060                                                         </screen>
1061                                                 </figure>
1062                                         </step>
1063                                         <step>
1064                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, start Evergreen.</para>
1065                                                 <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>
1066                                                 <figure>
1067                                                         <title>Commands to start Evergreen</title>
1068                                                         <screen>
1069                                                         $ su - opensrf
1070
1071                                                         # ensure you have the needed path
1072                                                         $ export PATH=$PATH:/openils/bin
1073
1074                                                         # start the OpenSRF service:
1075                                                         # use "-l" to force hostname to be "localhost"
1076                                                         $ osrf_ctl.sh -l -a start_all     
1077                                                         </screen>
1078                                                 </figure>
1079                                                 <note>
1080                                                         <para>
1081                                                                 <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>
1082                                                         </para>
1083                                                         <para>Execute the following command to determine the fully qualified domain name of your system:</para>
1084                                                         <figure>
1085                                                                 <title>(OPTIONAL) Commands to determine the fully qualified domain name</title>
1086                                                                 <screen>
1087                                                                 $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
1088                                                                 </screen>
1089                                                         </figure>
1090                                                 </note>
1091                                                 <indexterm>
1092                                                         <primary>ZZZ-REVIEW</primary>
1093                                                         <secondary>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </secondary>
1094                                                 </indexterm>
1095                                                 <caution>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1096                                                 <itemizedlist>
1097                                                         <listitem>
1098                                                                 <para>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>
1099                                                         </listitem>
1100                                                         <listitem>
1101                                                                 <para>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>
1102                                                         </listitem>
1103                                                 </itemizedlist>
1104                                         </step>
1105                                         <step>
1106                                                 <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>
1107                                                 <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>
1108                                                 <figure>
1109                                                         <title>Commands to generate web files</title>
1110                                                         <screen>
1111                                                         $ su - opensrf
1112                                                         $ cd /openils/bin
1113                                                         $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u
1114                                                         Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
1115                                                         Updating fieldmapper
1116                                                         ...
1117                                                         </screen>
1118                                                 </figure>
1119                                                 <indexterm>
1120                                                         <primary>ZZZ-REVIEW</primary>
1121                                                         <secondary>ADD RESULTS OF TESTS FROM "autogen.sh" </secondary>
1122                                                 </indexterm>
1123                                                 <caution>ADD RESULTS OF TESTS FROM <filename>autogen.sh</filename> </caution>
1124                                         </step>
1125                                         <step>
1126                                                 <para>As the <systemitem class="username">root</systemitem> user, restart the Apache Web server:</para>
1127                                                 <figure>
1128                                                         <title>Commands to restart Apache web server</title>
1129                                                         <screen>
1130                                                         $ su - root
1131                                                         $ /etc/init.d/apache2 restart
1132                                                         </screen>
1133                                                 </figure>
1134                                                 <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>
1135                                         </step>
1136                                 </procedure>
1137                         </section>
1138                         <section xml:id="serversideinstallation-testing">
1139                                 <title>Testing the Installation</title>
1140                                 <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>
1141                                 <section xml:id="serversideinstallation-testing-connections">
1142                                         <title>Testing Connections to Evergreen</title>
1143                                         <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>
1144                                         <figure>
1145                                                 <title>Commands to test Evergreen with <application>srfsh</application></title>
1146                                                 <screen>
1147                                                 $ su - opensrf
1148                                                 $ /openils/bin/srfsh
1149                                                 srfsh% login admin open-ils
1150                                                 Received Data: "250bf1518c7527a03249858687714376"
1151                                                 ------------------------------------
1152                                                 Request Completed Successfully
1153                                                 Request Time in seconds: 0.045286
1154                                                 ------------------------------------
1155                                                 Received Data: {
1156                                                    "ilsevent":0,
1157                                                    "textcode":"SUCCESS",
1158                                                    "desc":" ",
1159                                                    "pid":21616,
1160                                                    "stacktrace":"oils_auth.c:304",
1161                                                    "payload":{
1162                                                       "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
1163                                                       "authtime":420
1164                                                    }
1165                                                 }
1166                                                 ------------------------------------
1167                                                 Request Completed Successfully
1168                                                 Request Time in seconds: 1.336568
1169                                                 ------------------------------------
1170                                                 </screen>
1171                                         </figure>
1172                                 </section>
1173                                 <section>
1174                                         <title>Other Connection Tests with <application>srfsh</application></title>
1175                                         <para></para>
1176                                         <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>
1177                                         <figure>
1178                                                 <title>Example of math_bench usage</title>
1179                                                 <screen>
1180                                                 srfsh# math_bench 10
1181                                                 |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
1182                                                 ++++++++++++++++++++++++++++++++++++++++
1183                                                 Average round trip time: 0.033425
1184                                                 srfsh#
1185                                                 </screen>
1186                                         </figure>
1187                                         <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>
1188                                         <para>For other <application>srfsh</application> commands, type <userinput>help</userinput> in at the prompt.</para>
1189                                         <para/>
1190                                         <para>If this does not work, try the troubleshooting steps in the following section.</para>
1191                                 </section>
1192                                 <section>
1193                                         <title>Testing with <application>settings-tester.pl</application></title>
1194                                         <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>
1195                                         <section>
1196                                                 <title>Example of execution of <command>settings-tester.pl</command></title>
1197                                                 <programlisting language="xml"><![CDATA[
1198                                                 $ su - root
1199                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.0
1200                                                 $ perl Open-ILS/src/support-scripts/settings-tester.pl
1201                                                 LWP::UserAgent version 5.810
1202                                                 XML::LibXML version 1.70
1203                                                 XML::LibXML::XPathContext version 1.70
1204                                                 XML::LibXSLT version 1.70
1205                                                 Net::Server::PreFork version 0.97
1206                                                 Cache::Memcached version 1.24
1207                                                 Class::DBI version 0.96
1208                                                 Class::DBI::AbstractSearch version 0.07
1209                                                 Template version 2.19
1210                                                 DBD::Pg version 2.8.2
1211                                                 Net::Z3950::ZOOM version 1.24
1212                                                 MARC::Record version 2.0.0
1213                                                 MARC::Charset version 1.1
1214                                                 MARC::File::XML version 0.92
1215                                                 Text::Aspell version 0.04
1216                                                 CGI version 3.29
1217                                                 DateTime::TimeZone version 0.7701
1218                                                 DateTime version 0.42
1219                                                 DateTime::Format::ISO8601 version 0.06
1220                                                 DateTime::Format::Mail version 0.3001
1221                                                 Unix::Syslog version 1.1
1222                                                 GD::Graph3d version 0.63
1223                                                 JavaScript::SpiderMonkey version 0.19
1224                                                 Log::Log4perl version 1.16
1225                                                 Email::Send version 2.192
1226                                                 Text::CSV version 1.06
1227                                                 Text::CSV_XS version 0.52
1228                                                 Spreadsheet::WriteExcel::Big version 2.20
1229                                                 Tie::IxHash version 1.21
1230                                                 Parse::RecDescent version 1.95.1
1231                                                 SRU version 0.99
1232                                                 JSON::XS version 2.27
1233
1234                                                 Checking Jabber connection for user opensrf, domain private.localhost
1235                                                 * Jabber successfully connected
1236                                                 
1237                                                 Checking Jabber connection for user opensrf, domain public.localhost
1238                                                 * Jabber successfully connected
1239                                                 
1240                                                 Checking Jabber connection for user router, domain public.localhost
1241                                                 * Jabber successfully connected
1242                                                 
1243                                                 Checking Jabber connection for user router, domain private.localhost
1244                                                 * Jabber successfully connected
1245                                                 ]]></programlisting>
1246                                                 <programlisting language="xml"><![CDATA[
1247                                                 Checking database connections
1248                                                 * /opensrf/default/reporter/setup :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1249                                                   * Database has the expected server encoding UTF8.
1250                                                 * /opensrf/default/apps/open-ils.storage/app_settings/databases :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1251                                                   * Database has the expected server encoding UTF8.
1252                                                 * /opensrf/default/apps/open-ils.cstore/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1253                                                   * Database has the expected server encoding UTF8.
1254                                                 * /opensrf/default/apps/open-ils.pcrud/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1255                                                   * Database has the expected server encoding UTF8.
1256                                                 * /opensrf/default/apps/open-ils.reporter-store/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1257                                                   * Database has the expected server encoding UTF8.
1258                                                 
1259                                                 Checking database drivers to ensure <driver> matches <language>
1260                                                 * OK: Pg language is undefined for reporter base configuration
1261                                                 * OK: Pg language is undefined for reporter base configuration
1262                                                 * OK: Pg language is perl in /opensrf/default/apps/open-ils.storage/language
1263                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.cstore/language
1264                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.pcrud/language
1265                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.reporter-store/language
1266                                                 
1267                                                 Checking libdbi and libdbi-drivers
1268                                                   * OK - found locally installed libdbi.so and libdbdpgsql.so in shared library path
1269                                                 
1270                                                 Checking hostname
1271                                                  * OK: found hostname 'localhost' in <hosts> section of opensrf.xml
1272                                                 $
1273                                                 ]]></programlisting>
1274                                         </section>
1275                                         <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>
1276                                         <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>
1277                                 </section>
1278                                 <section xml:id="serversideinstallation-testing-opac">
1279                                         <title>Testing the Catalog</title>
1280                                         <para>By default, the OPAC will live at the URL <uri>http://my.domain.com/opac/</uri>.</para>
1281                                         <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>
1282                                         <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>
1283                                         <indexterm>
1284                                                 <primary>ZZZ-REVIEW</primary>
1285                                                 <secondary>ADD OTHER SIMPLE FUNCTIONAL TESTS </secondary>
1286                                         </indexterm>
1287                                         <caution>ADD OTHER SIMPLE FUNCTIONAL TESTS </caution>
1288                                 </section>
1289                                 <section>
1290                                         <title>Running the Evergreen Staff Client</title>
1291                                         <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>
1292                                         <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>
1293                                         <figure>
1294                                                 <title>Commands to run the Staff Client</title>
1295                                                 <screen>
1296                                                 $ su - opensrf
1297                                                 $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
1298                                                 </screen>
1299                                         </figure>
1300                                 </section>
1301                                 <section xml:id="serversideinstallation-starting-apache-server">
1302                                         <title>Testing the Apache Web Server</title>
1303                                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>
1304                                         <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>
1305                                         <figure>
1306                                                 <title>Commands to test the Apache Web Server</title>
1307                                                 <screen>
1308                                                 $ su - root
1309                                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart
1310                                                 </screen>
1311                                         </figure>
1312                                 </section>
1313                         </section>
1314                         <section xml:id="serversideinstallation-stopping">
1315                                 <title>Stopping Evergreen</title>
1316                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all Evergreen services by using the following command:</para>
1317                                 <figure>
1318                                         <title>Commands to stop Evergreen</title>
1319                                         <screen>
1320                                         $ su - opensrf
1321
1322                                         # stop the server:
1323                                         # use "-l" to force hostname to be "localhost"
1324                                         $ osrf_ctl.sh -l -a stop_all
1325                                         </screen>
1326                                 </figure>
1327                                 <note>
1328                                         <para>
1329                                                 <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>
1330                                         </para>
1331                                 </note>
1332                                 <indexterm>
1333                                         <primary>ZZZ-REVIEW</primary>
1334                                         <secondary>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </secondary>
1335                                 </indexterm>
1336                                 <caution>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1337                         </section>
1338                         <section xml:id="serversideinstallation-postinstallation">
1339                                 <title>Post-Installation Chores</title>
1340                                 <para>There are a few additional steps to complete after Evergreen has been successfully installed and tested.</para>
1341                                 <section>
1342                                         <title>Remove temporary changes from Apache configuration file</title>
1343                                         <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>
1344                                         <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>
1345                                 </section>
1346                                 <section>
1347                                         <title>Configure a permanent SSL key</title>
1348                                         <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. For further information on getting a proper SSL certificate, see <xref linkend="serversideinstallation-ssl"/>.</para>
1349                                         <warning>
1350                                                 <para>
1351                                                         <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>
1352                                                 </para>
1353                                         </warning>
1354                                 </section>
1355                                 <section>
1356                                         <title>Set Up Support For Reports</title>
1357                                         <para>Evergreen reports are extremely powerful, but some configuration is required. See <xref linkend="report-introduction"/> for details.</para>
1358                                         <itemizedlist>
1359                                                 <listitem>
1360                                                         <para>Starting the Reporter Daemon</para>
1361                                                         <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>
1362                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, start the reporter daemon using the following command:</para>
1363                                                         <figure>
1364                                                                 <title>Commands to start the Reporter daemon</title>
1365                                                                 <screen>
1366                                                                 $ su - opensrf
1367                                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/src/reporter
1368                                                                 $ ./clark-kent.pl --daemon
1369                                                                 </screen>
1370                                                         </figure>
1371                                                         <para>You can also specify other options with this utility:</para>
1372                                                         <itemizedlist>
1373                                                                 <listitem><option>--sleep=interval</option> : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>
1374                                                                 <listitem><option>--lockfile=filename</option> : where to place the lockfile for the process; defaults to <filename>/tmp/reporter-LOCK</filename></listitem>
1375                                                                 <listitem><option>--concurrency=integer</option> : number of reporter daemon processes to run; defaults to <literal>1</literal></listitem>
1376                                                                 <listitem><option>--bootstrap=filename</option> : OpenSRF bootstrap configuration file; defaults to <filename>/openils/conf/opensrf_core.xml</filename></listitem>
1377                                                         </itemizedlist>
1378                                                 </listitem>
1379                                                 <listitem>
1380                                                         <para>Stopping the Reporter Daemon</para>
1381                                                         <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>
1382                                                         <note>
1383                                                                 <para>
1384                                                                         <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>
1385                                                                 </para>
1386                                                         </note>
1387                                                         <figure>
1388                                                                 <title>Commands to stop the Reporter daemon</title>
1389                                                                 <screen>
1390                                                                 $ su - opensrf
1391                                                                 # find and kill the process ID number(s)
1392                                                                 $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
1393                                                                 # remove the lock file
1394                                                                 $ rm /tmp/reporter-LOCK
1395                                                                 </screen>
1396                                                         </figure>
1397                                                 </listitem>
1398                                         </itemizedlist>
1399                                 </section>
1400                                 <section xml:id="serversideinstallation-organizationandpolicy">
1401                                         <title>Organization and Policy Editing</title>
1402                                         <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>
1403                                         <itemizedlist>
1404                                                 <listitem>Adding a branch library</listitem>
1405                                                 <listitem>Changing circulation rules for an existing library</listitem>
1406                                                 <listitem>Adding a new staff position or user group</listitem>
1407                                         </itemizedlist>
1408                                         <indexterm>
1409                                                 <primary>ZZZ-REVIEW</primary>
1410                                                 <secondary>ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </secondary>
1411                                         </indexterm>
1412                                         <caution>ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </caution>
1413                                 </section>
1414                         </section>
1415                 </section>
1416                 <section xml:id="serversideinstallation-virtual">
1417                         <title>Installing In Virtualized Unix Environments</title>
1418                         <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>
1419                         <indexterm>
1420                                 <primary>ZZZ-REVIEW</primary>
1421                                 <secondary>ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </secondary>
1422                         </indexterm>
1423                         <caution>ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </caution>
1424                         <section xml:id="serversideinstallation-virtualized-virtualbox">
1425                                 <title>VirtualBox</title>
1426                                 <indexterm>
1427                                         <primary>ZZZ-REVIEW</primary>
1428                                         <secondary>ADD CONTENT FOR VirtualBox </secondary>
1429                                 </indexterm>
1430                                 <caution>ADD CONTENT FOR VirtualBox </caution>
1431                         </section>
1432                         <section xml:id="serversideinstallation-virtualized-vmware">
1433                                 <title>VMware</title>
1434                                 <indexterm>
1435                                         <primary>ZZZ-REVIEW</primary>
1436                                         <secondary>ADD CONTENT FOR VMware </secondary>
1437                                 </indexterm>
1438                                 <caution>ADD CONTENT FOR VMware </caution>
1439                         </section>
1440                         <section xml:id="serversideinstallation-virtualized-virtualpc">
1441                                 <title>VirtualPC</title>
1442                                 <indexterm>
1443                                         <primary>ZZZ-REVIEW</primary>
1444                                         <secondary>ADD CONTENT FOR VirtualPC </secondary>
1445                                 </indexterm>
1446                                 <caution>ADD CONTENT FOR VirtualPC </caution>
1447                         </section>
1448                 </section>
1449                 <section xml:id="serversideinstallation-previousversions">
1450                         <title>Installing Previous Versions of Evergreen</title>
1451                         <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>
1452                         <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>
1453                         <section xml:id="serversideinstallation-evergreen-previous">
1454                                 <title>Installing Evergreen 1.4.x.x On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>
1455                                 <para>This section outlines the installation process for the previous version 1.4.0.6 of Evergreen.</para>
1456                                 <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>
1457                                 <note>
1458                                         <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 <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server edition.</para>
1459                                         <para>If you are starting with a clean install of <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem>, you are strongly recommended <emphasis role="bold">not</emphasis> to install the packaged PostgreSQL server. This can confuse port numbers and system configuration. Evergreen 1.4 requires PostgreSQL 8.2.</para>
1460                                 </note>
1461                                 <section>
1462                                         <title>Installing OpenSRF</title>
1463                                         <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-previous"/>.</para>
1464                                         <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>
1465                                 </section>
1466                                 <section>
1467                                         <title>Download and Unpack Evergreen Version 1.4.0.6</title>
1468                                         <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.4.0.6.tar.gz"></ulink></para>
1469                                         <figure>
1470                                                 <title>Commands to download and unpack Evergreen</title>
1471                                                 <screen>
1472                                                 $ su - opensrf
1473                                                 $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.4.0.6.tar.gz
1474                                                 $ tar zxf Evergreen-ILS-1.4.0.6.tar.gz
1475                                                 </screen>
1476                                         </figure>
1477                                         <para>The new directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.4.0.6</filename> will be created.</para>
1478                                 </section>
1479                                 <section>
1480                                         <title>Install Prerequisites to Build Evergreen</title>
1481                                         <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>
1482                                         <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-a">"Keywords"</link> figure below.</para>
1483                                         <figure>
1484                                                 <title>Commands to install prerequisites for Evergreen</title>
1485                                                 <screen>
1486                                                 $ su - root
1487                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6
1488                                                 $ make -f Open-ILS/src/extras/Makefile.install [distribution]
1489                                                 ...
1490                                                 </screen>
1491                                         </figure>
1492                                         <table xml:id="serversideinstallation-keywords-figure-2-a">
1493                                                 <title>Keywords Targets for <application>make</application></title>
1494                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1495                                                         <colspec colnum="1" colwidth="1*"/>
1496                                                         <colspec colnum="2" colwidth="3*"/>
1497                                                         <thead>
1498                                                                 <row>
1499                                                                         <entry>Keyword</entry>
1500                                                                         <entry>Description</entry>
1501                                                                 </row>
1502                                                         </thead>
1503                                                         <tbody>
1504                                                                 <row>
1505                                                                         <entry>debian-lenny</entry>
1506                                                                         <entry>for Debian Lenny (5.0)</entry>
1507                                                                 </row>
1508                                                                 <row>
1509                                                                         <entry>debian-etch</entry>
1510                                                                         <entry>for Debian Etch (4.0)</entry>
1511                                                                 </row>
1512                                                                 <row>
1513                                                                         <entry>ubuntu-intrepid</entry>
1514                                                                         <entry>for Ubuntu Intrepid (8.10)</entry>
1515                                                                 </row>
1516                                                                 <row>
1517                                                                         <entry>ubuntu-hardy</entry>
1518                                                                         <entry>for Ubuntu Hardy (8.04)</entry>
1519                                                                 </row>
1520                                                         </tbody>
1521                                                 </tgroup>
1522                                         </table>
1523                                 </section>
1524                                 <section>
1525                                         <title>Update the System Dynamic Library Path</title>
1526                                         <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>
1527                                         <figure>
1528                                                 <title>Commands to modify system dynamic library path</title>
1529                                                 <screen>
1530                                                 $ su - root
1531                                                 $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
1532                                                 /usr/local/lib
1533                                                 /usr/local/lib/dbd
1534                                                 ENDOFFILE
1535                                                 $ ldconfig
1536                                                 </screen>
1537                                         </figure>
1538                                 </section>
1539                                 <section>
1540                                         <title>Restart the PostgreSQL Server</title>
1541                                         <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>
1542                                         <figure>
1543                                                 <title>Commands to restart PostgreSQL server</title>
1544                                                 <screen>
1545                                                 $ su - root
1546                                                 $ /etc/init.d/postgresql-8.2 restart
1547                                                 </screen>
1548                                         </figure>
1549                                 </section>
1550                                 <section>
1551                                         <title>Configure Evergreen</title>
1552                                         <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>
1553                                         <figure>
1554                                                 <title>Commands to configure Evergreen</title>
1555                                                 <screen>
1556                                                 $ su - opensrf
1557                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6
1558                                                 $ ./configure --prefix=/openils --sysconfdir=/openils/conf
1559                                                 $ make
1560                                                 ...
1561                                                 </screen>
1562                                         </figure>
1563                                 </section>
1564                                 <section>
1565                                         <title>Compile, Link and Install Evergreen</title>
1566                                         <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>
1567                                         <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>
1568                                         <para>For further information on manually building the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>
1569                                         <figure>
1570                                                 <title>Commands to build, link and install Evergreen</title>
1571                                                 <screen>
1572                                                 $ su - root
1573                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6
1574                                                 $ make STAFF_CLIENT_BUILD_ID=rel_1_4_0_6 install
1575                                                 ...
1576                                                 </screen>
1577                                                 <para>The above commands will create a new subdirectory <filename class="directory">/openils/var/web/xul/rel_1_4_0_6</filename> containing the Staff Client.</para>
1578                                         </figure>
1579                                 </section>
1580                                 <section>
1581                                         <title>Copy the OpenSRF Configuration Files</title>
1582                                         <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>
1583                                         <figure>
1584                                                 <title>Commands to copy OpenSRF configuration files</title>
1585                                                 <screen>
1586                                                 $ su - root
1587                                                 $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
1588                                                 $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
1589                                                 $ chown -R opensrf:opensrf /openils/
1590                                                 </screen>
1591                                         </figure>
1592                                 </section>
1593                                 <section>
1594                                         <title>Create and Configure PostgreSQL Database</title>
1595                                         <para>As the <systemitem class="username">postgres</systemitem> user on your PostgreSQL server, create the Evergreen database.</para>
1596                                         <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.2 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>, the path would be <filename class="directory">/usr/share/postgresql/8.2/contrib/</filename>.</para>
1597                                         <procedure>
1598                                                 <step>
1599                                                         <para>
1600                                                                 <emphasis role="bold">Create and configure the database</emphasis>
1601                                                         </para>
1602                                                         <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
1603                                                         <figure>
1604                                                                 <title>Commands to create database and adjust the path</title>
1605                                                                 <screen>
1606                                                                 # create the database
1607                                                                 $ su - postgres
1608                                                                 $ createdb -E UNICODE evergreen
1609                                                                 $ createlang plperl   evergreen
1610                                                                 $ createlang plperlu  evergreen
1611                                                                 $ createlang plpgsql  evergreen
1612                         
1613                                                                 # adjust the paths
1614                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen
1615                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen
1616                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen
1617                                                                 </screen>
1618                                                         </figure>
1619                                                         <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.2</literal>).</emphasis>
1620                                                 </step>
1621                                                 <step>
1622                                                         <para>
1623                                                                 <emphasis role="bold">Create new Evergreen superuser</emphasis>
1624                                                         </para>
1625                                                         <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>
1626                                                         <figure>
1627                                                                 <title>Commands to create the <systemitem class="username">evergreen</systemitem> user</title>
1628                                                                 <screen>
1629                                                                 # create superuser 'evergreen' and set the password
1630                                                                 $ su - postgres
1631                                                                 $ createuser -P -s evergreen
1632                                                                 Enter password for new role: MYNEWPASSWORD
1633                                                                 Enter it again: MYNEWPASSWORD
1634                                                                 </screen>
1635                                                         </figure>
1636                                                         <emphasis>Where <literal>MYNEWPASSWORD</literal> is the password chosen.</emphasis>
1637                                                 </step>
1638                                         </procedure>
1639                                 </section>
1640                                 <section>
1641                                         <title>Create Database Schema</title>
1642                                         <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>
1643                                         <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>
1644                                         <figure>
1645                                                 <title>Commands to create Evergreen database schema</title>
1646                                                 <screen>
1647                                                 $ su - root
1648                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6
1649                                                 $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
1650                                                         --service all --create-schema --create-bootstrap --create-offline \
1651                                                         --hostname HOSTNAME --port PORT \
1652                                                         --user evergreen --password PASSWORD --database DATABASENAME
1653                                                 </screen>
1654                                         </figure>
1655                                         <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>
1656                                         <note>
1657                                                 <para>
1658                                                         <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>
1659                                                 </para>
1660                                         </note>
1661                                 </section>
1662                                 <section>
1663                                         <title>Modify the Apache Configuration</title>
1664                                         <para>The Apache configuration must be updated. See <xref linkend="serversideinstallation-modify-apache"/> for further information.</para>
1665                                 </section>
1666                                 <section>
1667                                         <title>Modify the OpenSRF Configuration File</title>
1668                                         <para>The OpenSRF configuration must be modified. See <xref linkend="serversideinstallation-opensrf-config"/> for further information.</para>
1669                                 </section>
1670                                 <section>
1671                                         <title>Create Configuration Files for Users Needing <application>srfsh</application></title>
1672                                         <para>Special configuration files are needed for all users who need to use the application <application>srfsh</application> for testing. See <xref linkend="serversideinstallation-srfsh"/> for further information.</para>
1673                                 </section>
1674                                 <section>
1675                                         <title>Modify the OpenSRF Environment</title>
1676                                         <para>Several simple changes to the OpenSRF environment are required. See <xref linkend="serversideinstallation-opensrf-env"/> for further information.</para>
1677                                 </section>
1678                                 <section>
1679                                         <title>(OPTIONAL) Enabling and Disabling Language Localizations</title>
1680                                         <para>Before starting Evergreen, you can add language localization for a number of languages beyond American English (<emphasis role="bold">en-US</emphasis>). For further information on language localization, see <xref linkend="serversideinstallation-localization"/>.</para>
1681                                 </section>
1682                                 <section>
1683                                         <title>Starting Evergreen</title>
1684                                         <para>Start Evergreen according to the instructions in <xref linkend="serversideinstallation-starting"/>.</para>
1685                                 </section>
1686                                 <section>
1687                                         <title>Testing the Installation</title>
1688                                         <para>Simple tests can be used to verify that Evergreen server-side software has been installed and configured properly and is running as expected. See <xref linkend="serversideinstallation-testing"/> for further information on testing the latest version of Evergreen. Earlier versions can be tested similarly.</para>
1689                                 </section>
1690                                 <section>
1691                                         <title>Stopping Evergreen</title>
1692                                         <para>Stop Evergreen according to the instructions in <xref linkend="serversideinstallation-stopping"/>.</para>
1693                                 </section>
1694                                 <section>
1695                                         <title>Post-Installation Chores</title>
1696                                         <para>A few additional steps must be performed after Evergreen has been successfully installed and tested. See <xref linkend="serversideinstallation-postinstallation"/> for the list of final steps.</para>
1697                                 </section>
1698                         </section>
1699                         <section xml:id="serversideinstallation-opensrf-previous">
1700                                 <title>Installing OpenSRF 1.0.x</title>
1701                                 <indexterm>
1702                                         <primary>ZZZ-REVIEW</primary>
1703                                         <secondary>ADD CONTENT FOR INSTALLING OPENSRF 1.0.x </secondary>
1704                                 </indexterm>
1705                                 <caution>ADD CONTENT FOR INSTALLING OPENSRF 1.0.x </caution>
1706                         </section>
1707                 </section>
1708                 <section xml:id="serversideinstallation-postgresql">
1709                         <title>Installing PostgreSQL</title>
1710                         <indexterm>
1711                                 <primary>ZZZ-REVIEW</primary>
1712                                 <secondary>ADD CONTENT FOR POSTGRESQL </secondary>
1713                         </indexterm>
1714                         <caution>ADD CONTENT FOR POSTGRESQL </caution>
1715                 </section>
1716                 <section xml:id="serversideinstallation-apache">
1717                         <title>Installing Apache</title>
1718                         <section>
1719                                 <title>Securing Apache (httpd)</title>
1720                                 <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>
1721                                 <indexterm>
1722                                         <primary>ZZZ-REVIEW</primary>
1723                                         <secondary>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </secondary>
1724                                 </indexterm>
1725                                 <caution>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </caution>
1726                                 <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>
1727                         </section>
1728                         <indexterm>
1729                                 <primary>ZZZ-REVIEW</primary>
1730                                 <secondary>ADD MORE CONTENT FOR APACHE </secondary>
1731                         </indexterm>
1732                         <caution>ADD MORE CONTENT FOR APACHE </caution>
1733                 </section>
1734         </section>
1735         <section>
1736                 <title>Installing the Staff Client</title>
1737                 <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>
1738                 <section xml:id="serversideinstallation-prebuilt-staffclient">
1739                         <title>Installing a Pre-Built Staff Client</title>
1740                         <para>This section reviews the process of installing pre-built versions of the Staff Client in various environments.</para>
1741                         <section>
1742                                 <title>Installing on <systemitem class="osname">Windows</systemitem></title>
1743                                 <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>
1744                                 <figure>
1745                                         <title>Running the Staff Client installer</title>
1746                                         <mediaobject>
1747                                                 <imageobject>
1748                                                         <imagedata fileref="../media/serversideinstallation-staffclient-1.png" scalefit="1" width="70%"/>
1749                                                 </imageobject>
1750                                         </mediaobject>
1751                                 </figure>
1752                                 <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>
1753                                 <para>When you run the staff client for the first time, a screen similar to this should appear:</para>
1754                                 <figure>
1755                                         <title>Running the Staff Client for the first time</title>
1756                                         <mediaobject>
1757                                                 <imageobject>
1758                                                         <imagedata fileref="../media/serversideinstallation-staffclient-2.png" scalefit="1" width="70%"/>
1759                                                 </imageobject>
1760                                         </mediaobject>
1761                                 </figure>
1762                                 <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>
1763                                 <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>
1764                         </section>
1765                         <section>
1766                                 <title>Installing on <systemitem class="osname">Mac OS X</systemitem></title>
1767                                 <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>
1768                                 <section>
1769                                         <title>Evergreen Indiana Pkg file [Evergreen v1.2.3.0]</title>
1770                                         <procedure>
1771                                                 <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>
1772                                                 <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>
1773                                                 <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>
1774                                                 <step>Drag the application's icon into your toolbar for easier access.</step>
1775                                         </procedure>
1776                                         <para/>
1777                                         <para>When you run the staff client installer, a screen will appear that looks similar to this:</para>
1778                                         <figure>
1779                                                 <title>Running the Staff Client installer</title>
1780                                                 <mediaobject>
1781                                                         <imageobject>
1782                                                                 <imagedata fileref="../media/serversideinstallation-staffclient-3.png" scalefit="1" width="20%"/>
1783                                                         </imageobject>
1784                                                 </mediaobject>
1785                                         </figure>
1786                                         <caution> FIX BAD LINK: http://es.zionsville.lib.in.us/atheos/eg_osx_a.gif </caution>
1787                                         <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>
1788                                         <figure>
1789                                                 <title>Finishing the installation</title>
1790                                                 <mediaobject>
1791                                                         <imageobject>
1792                                                                 <imagedata fileref="../media/serversideinstallation-staffclient-4.png" scalefit="1" width="20%"/>
1793                                                         </imageobject>
1794                                                 </mediaobject>
1795                                         </figure>
1796                                         <caution> FIX BAD LINK: http://es.zionsville.lib.in.us/atheos/eg_osx_a.gif </caution>
1797                                 </section>
1798                                 <section>
1799                                         <title>Running directly using <application>xulrunner</application></title>
1800                                         <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>
1801                                         <table>
1802                                                 <title>Evergreen / XULRunner Dependencies</title>
1803                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1804                                                         <colspec colnum="1" colwidth="1*"/>
1805                                                         <colspec colnum="2" colwidth="3*"/>
1806                                                         <tbody>
1807                                                                 <row>
1808                                                                         <entry>Evergreen 1.6.x.x</entry>
1809                                                                         <entry>XULrunner 1.9</entry>
1810                                                                 </row>
1811                                                                 <row>
1812                                                                         <entry>Evergreen 1.4.x.x</entry>
1813                                                                         <entry>XULrunner 1.8.0.4 or XULrunner 1.8.0.3</entry>
1814                                                                 </row>
1815                                                                 <row>
1816                                                                         <entry>Evergreen 1.2.x.x</entry>
1817                                                                         <entry>XULrunner 1.8.0.4 or XULrunner 1.8.0.3</entry>
1818                                                                 </row>
1819                                                         </tbody>
1820                                                 </tgroup>
1821                                         </table>
1822                                         <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>
1823                                         <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>
1824                                         <figure>
1825                                                 <title>Executing <application>xulrunner</application></title>
1826                                                 <screen>
1827                                                 /Library/Frameworks/XUL.framework/xulrunner-bin --install-app ~/Desktop/Evergreen_Staff_Client
1828                                                 </screen>
1829                                         </figure>
1830                                         <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>
1831                                 </section>
1832                                 <section xml:id="serversideinstallation-staffclient-remove-xulrunner">
1833                                         <title>Removing previously installed <application>xulrunner</application> versions</title>
1834                                         <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>
1835                                         <para>In addition, you may also need to remove the previous file <filename>/Library/Receipts/xulrunner-ver-mak.pkg</filename>.</para>
1836                                         <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>
1837                                         <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>
1838                                         <para>First, get the package identifier, then purge/forget the build that was initially installed:</para>
1839                                         <figure>
1840                                                 <title>Purging previous build</title>
1841                                                 <screen>
1842                                                 sudo pkgutil --pkgs > /tmp/pkgs.txt
1843                                                 sudo pkgutil --forget org.mozilla.xulrunner
1844                                                 </screen>
1845                                         </figure>
1846                                         <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>
1847                                 </section>
1848                                 <section>
1849                                         <title>Creating an APP file: Staff Client &amp; <application>xulrunner</application> Bundled</title>
1850                                         <para>An APP file is basically a folder. Start with a folder stucture like this:</para>
1851                                         <figure>
1852                                                 <title>Sample APP file folder structure</title>
1853                                                 <screen>
1854                                                 * Evergreen.app
1855                                                   * Contents
1856                                                     * Frameworks
1857                                                     * Resources
1858                                                     * MacOS
1859                                                 </screen>
1860                                         </figure>
1861                                         <para>Create an APP folder structure with the following commands:</para>
1862                                         <figure>
1863                                                 <title>Creating a folder structure</title>
1864                                                 <screen>
1865                                                 mkdir -p Evergreen.app/Contents/Frameworks
1866                                                 mkdir -p Evergreen.app/Contents/Resources
1867                                                 mkdir -p Evergreen.app/Contents/MacOS
1868                                                 </screen>
1869                                         </figure>
1870                                         <para/>
1871                                         <procedure>
1872                                                 <step>
1873                                                         <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>
1874                                                         <figure>
1875                                                                 <title>Creating a new file</title>
1876                                                                 <programlisting language="xml"><![CDATA[
1877                                                                 <?xml version="1.0" encoding="UTF-8"?>
1878                                                                 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
1879                                                                 <plist version="1.0">
1880                                                                 <dict>
1881                                                                         <key>CFBundleExecutable</key>
1882                                                                         <string>xulrunner</string>
1883                                                                         <key>CFBundleGetInfoString</key>
1884                                                                         <string>OpenILS open_ils_staff_client rel_1_6_0_7</string>
1885                                                                         <key>CFBundleInfoDictionaryVersion</key>
1886                                                                         <string>6.0</string>
1887                                                                         <key>CFBundleName</key>
1888                                                                         <string>Evergreen Staff Client</string>
1889                                                                         <key>CFBundlePackageType</key>
1890                                                                         <string>APPL</string>
1891                                                                         <key>CFBundleShortVersionString</key>
1892                                                                         <string>rel_1_6_0_7</string>
1893                                                                         <key>CFBundleVersion</key>
1894                                                                         <string>rel_1_6_0_7.rel_1_6_0_7</string>
1895                                                                         <key>NSAppleScriptEnabled</key>
1896                                                                         <true/>
1897                                                                         <key>CFBundleTypeIconFile</key>
1898                                                                         <string>Evergreen.icns</string>
1899                                                                 </dict>
1900                                                                 </plist>
1901                                                                 ]]></programlisting>
1902                                                         </figure>
1903                                                 </step>
1904                                                 <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>
1905                                                 <step>
1906                                                         <para>Make a copy of <emphasis>/Library/Frameworks/XUL.Framework</emphasis> inside your APP file. It should look something like this:</para>
1907                                                         <figure>
1908                                                                 <title>Example of APP file framework</title>
1909                                                                 <screen>
1910                                                                 * Evergreen.app/
1911                                                                 __* Contents/
1912                                                                 ____* Frameworks/
1913                                                                 ______* XUL.Framework/
1914                                                                 ______* Versions/
1915                                                                 ________* Current -> 1.9.1.3 (symlink)
1916                                                                 ________* 1.9.1.3/
1917                                                                 ______* XUL -> Versions/Current/XUL
1918                                                                 ______* libxpcom.dylib -> Versions/Current/libxpcom.dylib
1919                                                                 ______* xulrunner-bin -> Versions/Current/xulrunner-bin
1920                                                                 </screen>
1921                                                         </figure>
1922                                                 </step>
1923                                                 <step>Copy <emphasis>XUL.Framework/Versions/Current/xulrunner</emphasis> into <emphasis>Evergreen.app/MacOS</emphasis> (do not symlink; copy the file).</step>
1924                                                 <step>
1925                                                         <para>Make <emphasis>Evergreen.app/Resources</emphasis> the root of your Evergreen application files like this:</para>
1926                                                         <figure>
1927                                                                 <title>Example APP file</title>
1928                                                                 <screen>
1929                                                                 * Evergreen.app/
1930                                                                 __* Contents/
1931                                                                 ____* Resources/
1932                                                                 ______* BUILD_ID
1933                                                                 ______* application.ini
1934                                                                 ______* chrome/
1935                                                                 ______* components/
1936                                                                 ______* etc.
1937                                                                 </screen>
1938                                                         </figure>
1939                                                 </step>
1940                                                 <step>Put a <systemitem class="osname">Mac</systemitem> format icon file named <emphasis>Evergreen.icns</emphasis> in Resources.</step>
1941                                         </procedure>
1942                                 </section>
1943                         </section>
1944                         <section xml:id="serversideinstallation-staffclient">
1945                                 <title>Installing on <systemitem class="osname">Linux</systemitem></title>
1946                                 <section>
1947                                         <title>Quick Upgrade of the Staff Client</title>
1948                                         <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>
1949                                         <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>
1950                                         <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>
1951                                         <figure>
1952                                                 <title>Copying the Staff Client to a remote workstation</title>
1953                                                 <screen>
1954                                                 $ su - opensrf
1955                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1956                                                 $ scp -r build user@client.linux.machine:~/eg-client-x.x.x.x/
1957                                                 </screen>
1958                                         </figure>
1959                                         <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>
1960                                         <figure>
1961                                                 <title>Testing the copied Staff Client</title>
1962                                                 <screen>
1963                                                 $ su - opensrf
1964                                                 $ xulrunner ~/eg-client-x.x.x.x/build/application.ini
1965                                                 </screen>
1966                                         </figure>
1967                                 </section>
1968                                 <section>
1969                                         <title>Building the Staff Client on the Server</title>
1970                                         <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>
1971                                         <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>
1972                                         <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>
1973                                         <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>
1974                                         <figure>
1975                                                 <title>Creating a symbolic link</title>
1976                                                 <screen>
1977                                                 $ su - root
1978                                                 $ cd /openils/var/web/xul
1979                                                 $ ln -s SERVER_BUILD_ID/ CLIENT_BUILD_ID
1980                                                 </screen>
1981                                         </figure>
1982                                 </section>
1983                                 <section>
1984                                         <title>Building the Staff Client on the client Machine</title>
1985                                         <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 <systemitem class="osname">Kubuntu 7.10</systemitem>; you must modify them for other distributions (the instructions should work as-is for <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Ubuntu</systemitem> derivatives).</para>
1986                                         <procedure>
1987                                                 <step>
1988                                                         <para>Prerequisites</para>
1989                                                         <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>
1990                                                         <figure>
1991                                                                 <title>Installing subversion and xulrunner</title>
1992                                                                 <screen>
1993                                                                 $ sudo apt-get install subversion
1994                                                                 $ sudo apt-get install xulrunner
1995                                                                 </screen>
1996                                                         </figure>
1997                                                 </step>
1998                                                 <step>
1999                                                         <para>Download the Source Code</para>
2000                                                         <itemizedlist>
2001                                                                 <listitem>
2002                                                                         <para>Determine which version is needed</para>
2003                                                                         <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>
2004                                                                         <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>
2005                                                                         <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>
2006                                                                 </listitem>
2007                                                                 <listitem>
2008                                                                         <para>Download the Code</para>
2009                                                                         <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>
2010                                                                         <figure>
2011                                                                                 <title>Downloading the source code</title>
2012                                                                                 <screen>
2013                                                                                 $ su - opensrf
2014                                                                                 $ cd /YOUR/DOWNLOAD/DIRECTORY
2015                                                                                 $ svn co svn://svn.open-ils.org/ILS/tags/rel_1_2_1_4/
2016                                                                                 </screen>
2017                                                                         </figure>
2018                                                                         <para>Remember to change <literal>rel_1_2_1_4</literal> to the appropriate tag for your installation.</para>
2019                                                                 </listitem>
2020                                                         </itemizedlist>
2021                                                 </step>
2022                                                 <step>
2023                                                         <para>Build the Staff Client</para>
2024                                                         <section>
2025                                                                 <title>Evergreen 1.2.x</title>
2026                                                                 <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>
2027                                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands to build the Staff Client:</para>
2028                                                                 <figure>
2029                                                                         <title>Finding the downloaded source code</title>
2030                                                                         <screen>
2031                                                                         $ su - opensrf
2032                                                                         $ cd /YOUR/DOWNLOAD/DIRECTORY
2033                                                                         $ cd Open-ILS/xul/staff_client
2034                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_2_1_4'
2035                                                                         ...
2036                                                                         </screen>
2037                                                                 </figure>
2038                                                         </section>
2039                                                         <section>
2040                                                                 <title>Evergreen 1.4.x</title>
2041                                                                 <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>
2042                                                                 <caution>FIXME -- Need instructions for getting certain Javascript files from OpenSRF, preferably without actually installing OpenSRF.
2043 </caution>
2044                                                                 <figure>
2045                                                                         <title>Building 1.4.x</title>
2046                                                                         <screen>
2047                                                                         $ su - opensrf
2048                                                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.4.0.4.tar.gz
2049                                                                         $ tar xfz Evergreen-ILS-1.4.0.4.tar.gz
2050                                                                         $ cd Evergreen-ILS-1.4.0.4/
2051                                                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
2052                                                                         $ cd Open-ILS/xul/staff_client/
2053                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_4_0_4' install
2054                                                                         </screen>
2055                                                                 </figure>
2056                                                                 <para/>
2057                                                                 <para>If you're installing from a Subversion checkout:</para>
2058                                                                 <figure>
2059                                                                         <title>Building from a <application>subversion</application> checkout</title>
2060                                                                         <screen>
2061                                                                         $ su - opensrf
2062                                                                         $ svn co svn://svn.open-ils.org/ILS/tags/rel_1_4_0_4/
2063                                                                         $ cd rel_1_4_0_4
2064                                                                         $ ./autogen.sh   # If you downloaded a .tar.gz of Evergreen, you may skip this step
2065                                                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
2066                                                                         $ cd Open-ILS/xul/staff_client/
2067                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_4_0_4' install
2068                                                                         </screen>
2069                                                                 </figure>
2070                                                         </section>
2071                                                 </step>
2072                                                 <step>
2073                                                         <para>Run the Staff Client (from the command line)</para>
2074                                                         <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>
2075                                                         <figure>
2076                                                                 <title>Running the Staff Client</title>
2077                                                                 <screen>
2078                                                                 $ su - opensrf
2079                                                                 $ xulrunner application.ini
2080                                                                 </screen>
2081                                                         </figure>
2082                                                 </step>
2083                                                 <step>
2084                                                         <para>(OPTIONAL) Cleaning Up / Creating Shortcuts</para>
2085                                                         <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>
2086                                                         <figure>
2087                                                                 <title>Creating a "staging" directory</title>
2088                                                                 <screen>
2089                                                                 $ mkdir ~/&lt;Destination Directory>
2090                                                                 $ cd ~/&lt;Download Directory>/Open-ILS/xul/
2091                                                                 $ cp -r staff_client ~/&lt;Destination Directory>
2092                                                                 </screen>
2093                                                         </figure>
2094                                                         <para>Finally, test the Staff Client to verify that all the necessary files were moved to the destination directory:</para>
2095                                                         <figure>
2096                                                                 <title>Testing the copied Staff Client</title>
2097                                                                 <screen>
2098                                                                 $ cd ~/&lt;Destination Directory>/staff_client/build
2099                                                                 $ xulrunner application.ini
2100                                                                 </screen>
2101                                                         </figure>
2102                                                         <para>If there were no problems, then finish the cleanup by removing the original download directory and all subdirectories:</para>
2103                                                         <figure>
2104                                                                 <title>Cleaning up</title>
2105                                                                 <screen>
2106                                                                 $ rm -r -f ~/&lt;Download Directory>
2107                                                                 </screen>
2108                                                         </figure>
2109                                                         <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>
2110                                                         <figure>
2111                                                                 <title>Running the copied Staff Client</title>
2112                                                                 <screen>
2113                                                                 $ xulrunner ~/&lt;Destination Directory>/staff_client/build/application.ini
2114                                                                 </screen>
2115                                                         </figure>
2116                                                 </step>
2117                                         </procedure>
2118                                 </section>
2119                                 <section>
2120                                         <title>Using <application>Wine</application> to Install On Linux</title>
2121                                         <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>
2122                                         <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>
2123                                         <procedure>
2124                                                 <step>
2125                                                         <para>Install <application>Wine</application></para>
2126                                                         <figure>
2127                                                                 <title>Installing <application>Wine</application></title>
2128                                                                 <screen>
2129                                                                 $ sudo apt-get install wine
2130                                                                 </screen>
2131                                                         </figure>
2132                                                 </step>
2133                                                 <step>
2134                                                         <para>Download <systemitem class="osname">Windows</systemitem> installer for the Staff Client</para>
2135                                                         <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>
2136                                                         <figure>
2137                                                                 <title>Downloading the Staff Client installer</title>
2138                                                                 <screen>
2139                                                                 $ su - opensrf
2140                                                                 $ cd /YOUR/DOWNLOAD/DIRECTORY
2141                                                                 $ wget http://open-ils.org/downloads/evergreen-setup-rel_version-number.exe
2142                                                                 </screen>
2143                                                         </figure>
2144                                                 </step>
2145                                                 <step>
2146                                                         <para>Run the downloaded <systemitem class="osname">Windows</systemitem> installer</para>
2147                                                         <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>
2148                                                         <figure>
2149                                                                 <title>Using Wine to run the <systemitem class="osname">Windows</systemitem> installer</title>
2150                                                                 <screen>
2151                                                                 $ su - opensrf
2152                                                                 $ cd /YOUR/DOWNLOAD/DIRECTORY
2153                                                                 $ wine evergreen-setup-rel_version-number.exe
2154                                                                 </screen>
2155                                                         </figure>
2156                                                         <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>
2157                                                 </step>
2158                                                 <step>
2159                                                         <para>Launch the Staff Client</para>
2160                                                         <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>
2161 , or else launch the Staff Client from the desktop shortcut.</para>
2162                                                 </step>
2163                                         </procedure>
2164                                 </section>
2165                                 <section>
2166                                         <title>Running the Staff Client over an SSH Tunnel</title>
2167                                         <para>The Staff Client can use an SSH tunnel as a SOCKS 5 proxy. For more details, see <xref linkend="serversideinstallation-proxy"/>.</para>
2168                                 </section>
2169                         </section>
2170                         <section xml:id="serversideinstallation-workstationnames">
2171                                 <title>Assigning Workstation Names</title>
2172                                 <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>
2173                                 <figure>
2174                                         <title>Example of unconfigured Staff Client</title>
2175                                         <mediaobject>
2176                                                 <imageobject>
2177                                                         <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-1.png" scalefit="1" width="70%"/>
2178                                                 </imageobject>
2179                                         </mediaobject>
2180                                 </figure>
2181                                 <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>
2182                                 <figure>
2183                                         <title>Example of configured Staff Client</title>
2184                                         <mediaobject>
2185                                                 <imageobject>
2186                                                         <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-2.png" scalefit="1" width="70%"/>
2187                                                 </imageobject>
2188                                         </mediaobject>
2189                                 </figure>
2190                                 <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>
2191                                 <para>Once you have registered your workstation with the server, your screen will look like this:</para>
2192                                 <figure>
2193                                         <title>Example of registered Staff Client</title>
2194                                         <mediaobject>
2195                                                 <imageobject>
2196                                                         <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-3.png" scalefit="1" width="70%"/>
2197                                                 </imageobject>
2198                                         </mediaobject>
2199                                 </figure>
2200                                 <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>
2201                         </section>
2202                 </section>
2203                 <section xml:id="serversideinstallation-building-staffclient">
2204                         <title>Manually Building the Staff Client</title>
2205                         <para>This section reviews the process of manually building the Staff Client in various environments.</para>
2206                         <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>
2207                         <section>
2208                                 <title>Building the Staff Client</title>
2209                                 <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>
2210                                 <section>
2211                                         <title>Option STAFF_CLIENT_BUILD_ID</title>
2212                                         <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>
2213                                         <para>The following commands could be used during the normal build process:</para>
2214                                         <figure>
2215                                                 <title>Commands used during normal Evergreen build</title>
2216                                                 <screen>
2217                                                 $ su - root
2218                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
2219                                                 $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
2220                                                 ...
2221                                                 </screen>
2222                                         </figure>
2223                                         <para>The following commands will manually build the Staff Client using a different BUILD_ID.</para>
2224                                         <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>
2225                                         <figure>
2226                                                 <title>Commands to manually build the Staff Client</title>
2227                                                 <screen>
2228                                                 $ su - opensrf
2229                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2230                                                 $ make STAFF_CLIENT_BUILD_ID=my_test_id  build
2231                                                 ...
2232                                                 </screen>
2233                                         </figure>
2234                                 </section>
2235                                 <section>
2236                                         <title>Option STAFF_CLIENT_VERSION</title>
2237                                         <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>
2238                                         <para>The following commands could be used during the normal build process:</para>
2239                                         <figure>
2240                                                 <title>Commands used during normal Evergreen build</title>
2241                                                 <screen>
2242                                                 $ su - root
2243                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
2244                                                 $ make STAFF_CLIENT_VERSION=0mytest.200 install
2245                                                 ...
2246                                                 </screen>
2247                                         </figure>
2248                                         <para>The following commands will manually build the Staff Client using a different VERSION.</para>
2249                                         <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>
2250                                         <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>
2251                                         <figure>
2252                                                 <title>Commands to manually build the Staff Client</title>
2253                                                 <screen>
2254                                                 $ su - opensrf
2255                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2256                                                 $ make STAFF_CLIENT_VERSION=0mytest.200  build
2257                                                 ...
2258                                                 </screen>
2259                                         </figure>
2260                                 </section>
2261                                 <section>
2262                                         <title>Option STAFF_CLIENT_STAMP_ID variable</title>
2263                                         <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>
2264                                         <para>The following commands could be used during the normal build process:</para>
2265                                         <figure>
2266                                                 <title>Commands used during normal Evergreen build</title>
2267                                                 <screen>
2268                                                 $ su - root
2269                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
2270                                                 $ make STAFF_CLIENT_STAMP_ID=my_test_stamp install
2271                                                 ...
2272                                                 </screen>
2273                                         </figure>
2274                                         <para>The following commands will manually build the Staff Client using a different STAMP_ID.</para>
2275                                         <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>
2276                                         <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>
2277                                         <figure>
2278                                                 <title>Commands to manually build the Staff Client</title>
2279                                                 <screen>
2280                                                 $ su - opensrf
2281                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2282                                                 $ make STAFF_CLIENT_STAMP_ID=my_test_stamp  build
2283                                                 ...
2284                                                 </screen>
2285                                         </figure>
2286                                 </section>
2287                         </section>
2288                         <section>
2289                                 <title>Advanced Build Options</title>
2290                                 <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>
2291                                 <table>
2292                                         <title>Keywords Targets for <application>make</application> Command</title>
2293                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
2294                                                 <colspec colnum="1" colwidth="1*"/>
2295                                                 <colspec colnum="2" colwidth="3*"/>
2296                                                 <thead>
2297                                                         <row>
2298                                                                 <entry>Keyword</entry>
2299                                                                 <entry>Description</entry>
2300                                                         </row>
2301                                                 </thead>
2302                                                 <tbody>
2303                                                         <row>
2304                                                                 <entry>clients</entry>
2305                                                                 <entry>Runs "make win-client", "make linux-client", and "make generic-client" individually</entry>
2306                                                         </row>
2307                                                         <row>
2308                                                                 <entry>client_dir</entry>
2309                                                                 <entry>Builds a client directory from the build directory, without doing a rebuild. The same as "copy everything but server/".</entry>
2310                                                         </row>
2311                                                         <row>
2312                                                                 <entry>client_app</entry>
2313                                                                 <entry>Prerequisite "client_dir"; removes "install.rdf" from client directory so an APP bundle can't be installed as an extension</entry>
2314                                                         </row>
2315                                                         <row>
2316                                                                 <entry>client_ext</entry>
2317                                                                 <entry>Prerequisite "client_dir"; remove "application.ini", "autoupdate.js", "standalone_xul_app.js" from client directory so an extension won't break Firefox</entry>
2318                                                         </row>
2319                                                         <row>
2320                                                                 <entry>extension</entry>
2321                                                                 <entry>Prerequisite "client_ext"; rewritten to use "client_ext"</entry>
2322                                                         </row>
2323                                                         <row>
2324                                                                 <entry>generic-client</entry>
2325                                                                 <entry>Prerequisite "client_app"; makes an XPI file suitable for use with "xulrunner --install-app""</entry>
2326                                                         </row>
2327                                                         <row>
2328                                                                 <entry>win-xulrunner</entry>
2329                                                                 <entry>Prerequisite "client_app"; adds Windows xulrunner to client build</entry>
2330                                                         </row>
2331                                                         <row>
2332                                                                 <entry>linux-xulrunner</entry>
2333                                                                 <entry>Prerequisite "client_app"; adds Linux xulrunner to client build</entry>
2334                                                         </row>
2335                                                         <row>
2336                                                                 <entry>win-client</entry>
2337                                                                 <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>
2338                                                         </row>
2339                                                         <row>
2340                                                                 <entry>linux-client</entry>
2341                                                                 <entry>Prerequisite "linux_xulrunner"; builds a "tar.bz2" bundle of the Linux client</entry>
2342                                                         </row>
2343                                                         <row>
2344                                                                 <entry>[generic-|win-|linux-|extension-]updates[-client]</entry>
2345                                                                 <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>
2346                                                         </row>
2347                                                 </tbody>
2348                                         </tgroup>
2349                                 </table>
2350                                 <para>Descriptions of other special build options follow:</para>
2351                                 <itemizedlist>
2352                                         <listitem>
2353                                                 <para>Developer Build</para>
2354                                                 <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>
2355                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>make</command> from the Staff Client source directory:</para>
2356                                                 <figure>
2357                                                         <title>Commands to do a "developer build"</title>
2358                                                         <screen>
2359                                                         $ su - opensrf
2360                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2361                                                         $ make devbuild
2362                                                         ...
2363                                                         </screen>
2364                                                 </figure>
2365                                         </listitem>
2366                                         <listitem>
2367                                                 <para>Compressed Javascript</para>
2368                                                 <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>
2369                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands from the Staff Client source directory:</para>
2370                                                 <figure>
2371                                                         <title>Commands to compress Javascript</title>
2372                                                         <screen>
2373                                                         $ su - opensrf
2374                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2375                                                         $ make compress-javascript
2376                                                         ...
2377                                                         </screen>
2378                                                 </figure>
2379                                                 <para>You can also combine Javascript review and compression, and also perform a "developer build".</para>
2380                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands from the Staff Client source directory:</para>
2381                                                 <figure>
2382                                                         <title>Commands to compress Javascript and do a "developer build"</title>
2383                                                         <screen>
2384                                                         $ su - opensrf
2385                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2386         
2387                                                         # order of options is important!
2388                                                         $ make  devbuild  compress-javascript
2389                                                         ...
2390                                                         </screen>
2391                                                 </figure>
2392                                         </listitem>
2393                                         <listitem>
2394                                                 <para>Automatic Update Host</para>
2395                                                 <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>
2396                                                 <figure>
2397                                                         <title>Commands to set AUTOUPDATE_HOST for normal Evergreen build</title>
2398                                                         <screen>
2399                                                         $ su - root
2400                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
2401                                                         $ make AUTOUPDATE_HOST=localhost install
2402                                                         ...
2403                                                         </screen>
2404                                                 </figure>
2405                                                 <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>
2406                                                 <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>
2407                                                 <figure>
2408                                                         <title>Commands to manually specify AUTOUPDATE_HOST</title>
2409                                                         <screen>
2410                                                         $ su - opensrf
2411                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2412                                                         $ make AUTOUPDATE_HOST=localhost build
2413                                                         ...
2414                                                         </screen>
2415                                                 </figure>
2416                                                 <para>For more information on Automatic Updates, see <xref linkend="serversideinstallation-staffclient-autoupdate"/>.</para>
2417                                         </listitem>
2418                                 </itemizedlist>
2419                         </section>
2420                         <section>
2421                                 <title>Installing and Activating a Manually Built Staff Client</title>
2422                                 <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>
2423                                 <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>
2424                                 <figure>
2425                                         <title>Commands to install the Staff Client on the same machine</title>
2426                                         <screen>
2427                                         $ su - opensrf
2428                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2429                                         $ mkdir -p "/openils/var/web/xul/$(cat build/BUILD_ID)"
2430                                         $ cp -R build/server "/openils/var/web/xul/$(cat build/BUILD_ID)"
2431                                         </screen>
2432                                 </figure>
2433                         </section>
2434                         <section>
2435                                 <title>Packaging the Staff Client</title>
2436                                 <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>
2437                                 <itemizedlist>
2438                                         <listitem>
2439                                                 <para>Packaging a Generic Client</para>
2440                                                 <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>
2441                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2442                                                 <figure>
2443                                                         <title>Commands to package a "generic" client</title>
2444                                                         <screen>
2445                                                         $ su - opensrf
2446                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2447                                                         $ make generic-client
2448                                                         ...
2449                                                         </screen>
2450                                                 </figure>
2451                                         </listitem>
2452                                         <listitem>
2453                                                 <para>Packaging a <systemitem class="osname">Windows</systemitem> Client</para>
2454                                                 <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>
2455                                                 <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>
2456                                                 <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>
2457                                                 <table>
2458                                                         <title>Useful icon ID strings</title>
2459                                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
2460                                                                 <colspec colnum="1" colwidth="1*"/>
2461                                                                 <colspec colnum="2" colwidth="1*"/>
2462                                                                 <tbody>
2463                                                                         <row>
2464                                                                                 <entry>IDI_APPICON</entry>
2465                                                                                 <entry>Tray icon</entry>
2466                                                                         </row>
2467                                                                         <row>
2468                                                                                 <entry>32512</entry>
2469                                                                                 <entry>Default window icon</entry>
2470                                                                         </row>
2471                                                                 </tbody>
2472                                                         </tgroup>
2473                                                 </table>
2474                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2475                                                 <figure>
2476                                                         <title>Commands to build a <systemitem class="osname">Windows</systemitem> client</title>
2477                                                         <screen>
2478                                                         $ su - opensrf
2479                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2480                                                         $ make win-client
2481                                                         ...
2482                                                         </screen>
2483                                                 </figure>
2484                                         </listitem>
2485                                         <listitem>
2486                                                 <para>Packaging a <systemitem class="osname">Linux</systemitem> Client</para>
2487                                                 <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>
2488                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2489                                                 <figure>
2490                                                         <title>Commands to build a <systemitem class="osname">Linux</systemitem> client</title>
2491                                                         <screen>
2492                                                         $ su - opensrf
2493                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2494                                                         $ make linux-client
2495                                                         ...
2496                                                         </screen>
2497                                                 </figure>
2498                                         </listitem>
2499                                         <listitem>
2500                                                 <para>Packaging a Firefox Extension</para>
2501                                                 <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>
2502                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2503                                                 <figure>
2504                                                         <title>Commands to build a Firefox extension</title>
2505                                                         <screen>
2506                                                         $ su - opensrf
2507                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2508                                                         $ make extension
2509                                                         ...
2510                                                         </screen>
2511                                                 </figure>
2512                                         </listitem>
2513                                 </itemizedlist>
2514                         </section>
2515                         <section xml:id="serversideinstallation-staffclient-autoupdate">
2516                                 <title>Staff Client Automatic Updates</title>
2517                                 <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>
2518                                 <section>
2519                                         <title>WARNINGS</title>
2520                                         <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>
2521                                         <para>In addition, automatic updates have special requirements for the file <filename>update.rdf</filename>:</para>
2522                                         <orderedlist>
2523                                                 <listitem>It must be served from an SSL server, or</listitem>
2524                                                 <listitem>It must be signed with the <ulink url="https://developer.mozilla.org/en/McCoy">McCoy</ulink> tool.</listitem>
2525                                         </orderedlist>
2526                                         <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>
2527                                 </section>
2528                                 <section>
2529                                         <title>Autoupdate Host</title>
2530                                         <para>The name of the automatic update host can be provided in either of two ways:</para>
2531                                         <orderedlist>
2532                                                 <listitem>At configuration time for the normal build of the Evergreen server-side software, or</listitem>
2533                                                 <listitem>During a manual Staff Client build process.</listitem>
2534                                         </orderedlist>
2535                                         <para/>
2536                                         <itemizedlist>
2537                                                 <listitem>
2538                                                         <para>At configuration time for the normal build of Evergreen server-side software</para>
2539                                                         <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>
2540                                                         <figure>
2541                                                                 <title>Commands to configure Evergreen</title>
2542                                                                 <screen>
2543                                                                 $ su - opensrf
2544                                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
2545                                                                 $ ./configure --prefix=/openils --sysconfdir=/openils/conf --with-updateshost=hostname
2546                                                                 $ make
2547                                                                 ...
2548                                                                 </screen>
2549                                                         </figure>
2550                                                 </listitem>
2551                                                 <listitem>
2552                                                         <para>During a manual Staff Client build process</para>
2553                                                         <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>
2554                                                         <para>If neither option is used then, by default, the Staff Client will not include the automatic update preferences.</para>
2555                                                 </listitem>
2556                                         </itemizedlist>
2557                                 </section>
2558                                 <section>
2559                                         <title>Building Updates</title>
2560                                         <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>
2561                                         <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>
2562                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2563                                         <figure>
2564                                                 <title>Commands for building updates</title>
2565                                                 <screen>
2566                                                 $ su - opensrf
2567                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2568         
2569                                                 # command to build all updates at once:
2570                                                 $ make updates
2571                                                 ...
2572         
2573                                                 # commands to build updates individually:
2574                                                 $ make generic-updates
2575                                                 ...
2576                                                 $ make win-updates
2577                                                 ...
2578                                                 $ make linux-updates
2579                                                 ...
2580                                                 $ make extension-updates
2581                                                 ...
2582                                                 </screen>
2583                                         </figure>
2584                                 </section>
2585                                 <section>
2586                                         <title>Building updates with clients</title>
2587                                         <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>
2588                                         <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>
2589                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2590                                         <figure>
2591                                                 <title>Commands for building updates</title>
2592                                                 <screen>
2593                                                 $ su - opensrf
2594                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2595         
2596                                                 # command to build all updates at once:
2597                                                 $ make updates-client
2598                                                 ...
2599         
2600                                                 # commands to build updates individually:
2601                                                 $ make generic-updates-client
2602                                                 ...
2603                                                 $ make win-updates-client
2604                                                 ...
2605                                                 $ make linux-updates-client
2606                                                 ...
2607                                                 </screen>
2608                                         </figure>
2609                                 </section>
2610                                 <section>
2611                                         <title>Activating the Update Server</title>
2612                                         <para>This section reviews scripts associated with the update server, and requires some final adjustments to file permissions.</para>
2613                                         <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>
2614                                         <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>
2615                                         <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>
2616                                         <figure>
2617                                                 <title>Changing file permissions of scripts</title>
2618                                                 <screen>
2619                                                 $ su - root
2620                                                 $ cd /openils/var/updates/pub
2621                                                 $ chmod +x  check  download  manualupdate.html  update.rdf
2622                                                 </screen>
2623                                         </figure>
2624                                 </section>
2625                         </section>
2626                         <section>
2627                                 <title>Other tips</title>
2628                                 <section>
2629                                         <title>Multiple workstations on one install</title>
2630                                         <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>
2631                                         <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>
2632                                         <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>
2633                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>
2634                                         <figure>
2635                                                 <title>Command to add start menu option</title>
2636                                                 <screen>
2637                                                 $ su - opensrf
2638                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
2639                                                 $ make NSIS_EXTRAOPTS=-DPROFILES win-client
2640                                                 ...
2641                                                 </screen>
2642                                         </figure>
2643                                 </section>
2644                                 <section>
2645                                         <title> Multiple Staff Clients</title>
2646                                         <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>
2647                                         <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>
2648                                 </section>
2649                         </section>
2650                 </section>
2651                 <section xml:id="serversideinstallation-running-staffclient">
2652                         <title>Running the Staff Client</title>
2653                         <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>
2654                         <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>
2655                         <figure>
2656                                 <title>Commands to run the Staff Client</title>
2657                                 <screen>
2658                                 $ su - opensrf
2659                                 $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
2660                                 </screen>
2661                         </figure>
2662                 </section>
2663                 <section xml:id="serversideinstallation-proxy">
2664                         <title>Configuring a Proxy for the Staff Client</title>
2665                         <section>
2666                                 <title>Why Use a Proxy for the Staff Client?</title>
2667                                 <para>There are several reasons for sending network traffic for the Staff Client through an SSH proxy:</para>
2668                                 <itemizedlist>
2669                                         <listitem>
2670                                                 <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>
2671                                         </listitem>
2672                                         <listitem>
2673                                                 <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>
2674                                         </listitem>
2675                                 </itemizedlist>
2676                         </section>
2677                         <section>
2678                                 <title>Setting Up an SSH Tunnel</title>
2679                                 <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>
2680                                 <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>
2681                                 <figure>
2682                                         <title>Setting up an SSH tunnel in PuTTY</title>
2683                                         <mediaobject>
2684                                                 <imageobject>
2685                                                         <imagedata fileref="../media/serversideinstallation-proxy-putty.png" scalefit="1" width="70%"/>
2686                                                 </imageobject>
2687                                         </mediaobject>
2688                                 </figure>
2689                                 <procedure>
2690                                         <step>Use the menu on the left to go to <emphasis><menuchoice><guimenu>Connection</guimenu><guimenuitem>SSH</guimenuitem><guimenuitem>Tunnels</guimenuitem></menuchoice></emphasis>.</step>
2691                                         <step>Enter <literal>9999</literal> in the "Source port".</step>
2692                                         <step>Choose <guibutton>Dynamic</guibutton>. Do not enter anything in the Destination text entry box.</step>
2693                                         <step>Click <guibutton>Add</guibutton>. "D9999" will now appear in the "Forwarded ports" list.</step>
2694                                         <step>Use the menu on the left to go back to "Session", and enter the host name of the SSH server.</step>
2695                                         <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>
2696                                 </procedure>
2697                         </section>
2698                         <section>
2699                                 <title>Configuring the Staff Client to Use the SSH Tunnel</title>
2700                                 <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>
2701                                 <figure>
2702                                         <title>The SOCKS section of <filename>all.js</filename> before changes</title>
2703                                         <mediaobject>
2704                                                 <imageobject>
2705                                                         <imagedata fileref="../media/serversideinstallation-proxy-socks-1.png" scalefit="1" width="70%"/>
2706                                                 </imageobject>
2707                                         </mediaobject>
2708                                 </figure>
2709                                 <para>Make the following changes:</para>
2710                                 <itemizedlist>
2711                                         <listitem>Change the value of <emphasis>network.proxy.socks</emphasis> from <emphasis role="bold">""</emphasis> to <emphasis role="bold">"localhost"</emphasis>.</listitem>
2712                                         <listitem>Change the value of <emphasis>network.proxy.socks_port</emphasis> from <emphasis role="bold">"0"</emphasis> to <emphasis role="bold">9999</emphasis>.</listitem>
2713                                 </itemizedlist>
2714                                 <figure xml:id="serversideinstallation-socks-figure">
2715                                         <title>The SOCKS section of <filename>all.js</filename> after changes</title>
2716                                         <mediaobject>
2717                                                 <imageobject>
2718                                                         <imagedata fileref="../media/serversideinstallation-proxy-socks-2.png" scalefit="1" width="70%"/>
2719                                                 </imageobject>
2720                                         </mediaobject>
2721                                 </figure>
2722                                 <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>
2723                         </section>
2724                 </section>
2725         </section>
2726         <section xml:id="serversideinstallation-ssl">
2727                 <title>Getting a Signed SSL Certificate</title>
2728                 <para>This section describes how to get a properly signed SSL certificate.</para>
2729                 <para>For temporary testing purposes, you can use the command <command>openssl</command> to create a new SSL key for your Apache server. This is just a self-signed certificate and will generate warnings in the Staff Client and browser during testing and development. For a public production server you should configure or purchase a properly signed SSL certificate.</para>
2730                 <indexterm>
2731                         <primary>ZZZ-REVIEW</primary>
2732                         <secondary>ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </secondary>
2733                 </indexterm>
2734                 <caution>ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </caution>
2735         </section>
2736         <index/>
2737 </chapter>