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