tweaks to section "Installing Evergreen V1.6.0.7 On Ubuntu or Debian"
[working/Evergreen.git] / 1.6 / admin / ServersideInstallation.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter xml:id="ServersideInstallation" xmlns="" xmlns:xi="" xmlns:xl="">
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                         <caution fileref="media/caution.png">VERIFY THE DEPENDENCIES IN THIS TABLE </caution>
52                 </section>
53                 <section>
54                         <title>Current Stable Software Release</title>
55                         <para>The current stable release of Evergreen is version <emphasis><emphasis role="bold"></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> .
56                         </para>
57                         <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>
58                 </section>
59                 <section>
60                         <title>Previous Software Releases</title>
61                         <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>
62                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold"></emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in the section <link linkend="serversideinstallation-ubuntudebian-previous">"Installing Evergreen on Ubuntu or Debian"</link> .</para>
63                         <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>
64                 </section>
65                 <section>
66                         <title>System Hardware Requirements</title>
67                         <para>This section describes various requirements of the hardware and software environment that must be fulfilled to support a successful Evergreen installation. The system requirements for running Evergreen really depend on what you want to do with it. For just evaluating the software, or for a very small library (for example, 1 circulation station, a few thousand items, and infrequent online catalog use), any modern desktop or laptop made within the last few years capable of running Linux, FreeBSD, etc. should suffice. We recommend at least 512mb of RAM.</para>
68                         <caution fileref="media/caution.png"> ADD FURTHER CONTENT ON HARDWARE AND SOFTWARE REQUIREMENTS </caution>
69                         <figure>
70                                 <title>Conversation on mailing-list about system requirements</title>
71                                 <screen>
72                                 >>>From Dan Scott on [
73                                   open-ils-general/2007-July/000316.html|OPEN-ILS-GENERAL]:
74                                 On 8/11/07, lan ye &lt;lye at> wrote:
75                                 > We've been researching the Evergreen Open Source Library system, and would
76                                 > like to have a list of hardware requirements for the installation of a small
77                                 > test server. To keep things within a small budget, I would like to just use
78                                 > an ordinary PC. Could you send some information to us?
80                                 For system requirements, it depends on how extensive you want your tests to
81                                 be. Evergreen and all of the pieces it depends on (PostgreSQL, Apache, Ejabberd) run
82                                 happily in a VMWare image allocated 512MB of RAM on my laptop with just the Project
83                                 Gutenberg e-books loaded, and that's enough to evaluate the OPAC interface / try out the
84                                 staff client / make some local changes and generally experiment. But I'm not going to
85                                 load one million bib records into that system and expect it to perform. So, probably any
86                                 hardware you have lying around would be adequate for a small test server.
88                                 > It looks like Evergreen has been successfully installed on two Linux
89                                 > systems: Gentoo and Ubuntu. Which one is the best for us to test using
90                                 > what's already in place at other libraries? Are there any differences /
91                                 > Advantages in functionality between Gentoo and Ubuntu?
93                                 As John said, GPLS is running on Debian, and that's the only Evergreen system that is in
94                                 production at the moment. However, the documentation for installing on Debian is a bit
95                                 scattered right now. The developers themselves used Gentoo originally, and that's what
96                                 I'm using at the moment &amp; have documented in the wiki; the install process on Ubuntu
97                                 is very thoroughly documented and Ubuntu is reasonably close to Debian.  See
98                        for the list of install
99                                 instructions for various distributions.
101                                 As for advantages / disadvantages of particular distributions, that's a religious war
102                                 that I don't want to step into... We'll try to help you out no matter what distribution
103                                 you choose; just please choose a current release :)
105                                 --
106                                 Dan Scott
107                                 Laurentian University
109                                 >>>And from James Fournie in that same [
110                                   pipermail/open-ils-general/2007-July/000317.html|thread]:
112                                 We are running a test Ubuntu server on a ~1ghz Celeron PC with 512mb RAM.  It seems to
113                                 be ok handling the Gutenberg samples, and our collection of about 8000 records. We did
114                                 have serious problems using anything less than 512mb RAM. Also, I tried Evergreen on a
115                                 K6 II 350, but it wasn't pretty.
117                                 James Fournie
118                                 Digitization Librarian
119                                 Union of B.C. Indian Chiefs
120                                 </screen>
121                         </figure>
122                 </section>
123                 <section>
124                         <title>System Architectures</title>
125                         <para>This sections describes examples of some working Evergreen system architectures, including both server-side software and Staff Client software.</para>
126                         <para>A bare-minimum system requires only a single Evergreen Server and a single Evergreen Staff Client, both residing on a single server machine. In fact, that is a reasonable architecture for simple experiments or as a proof of concept in a conference-room pilot. But typical real-world systems will probably consist of at least one or two Evergreen Servers plus multiple Staff Clients.</para>
127                         <para>Another simple system may require only that you install one or more instances of the Staff Client software. For instance, if your consortium already provides the Evergreen server software or if you are using the hosted version provided by Equinox, you do not need to install the Evergreen server-side software at all; you need only the Staff Client.</para>
128                         <section xml:id="serversideinstallation-example-pines">
129                                 <title>PINES</title>
130                                 <para>In order to provide load balancing and high-availability at the OPAC and Staff Client level, PINES has implemented a Linux Virtual Server environment with five independent mini-clusters. This allows live updates of the entire system with no perceived downtime or interruption in service.</para>
131                                 <caution fileref="media/caution.png"> ADD FURTHER INFORMATION ON PINES </caution>
132                         </section>
133                         <section xml:id="serversideinstallation-example-sitka">
134                                 <title>Sitka</title>
135                                 <caution fileref="media/caution.png"> ADD FURTHER INFORMATION ON SITKA </caution>
136                         </section>
137                         <section xml:id="serversideinstallation-example-other">
138                                 <title>Other Working Systems</title>
139                                 <caution fileref="media/caution.png"> ADD FURTHER INFORMATION ON OTHER WORKING SYSTEMS </caution>
140                         </section>
141                 </section>
142         </section>
143         <section xml:id="serversideinstallation-all">
144                 <title>Installation of Server-Side Software</title>
145                 <para>This section describes the installation of the major components of Evergreen server-side software.</para>
146                 <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>
147                 <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>
148                 <section xml:id="serversideinstallation-opensrf">
149                         <title>Installing OpenSRF On Ubuntu or Debian</title>
150                         <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>
151                         <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>
152                         <note>
153                                 <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>
154                                 <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>
155                                 <itemizedlist>
156                                         <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>
157                                         <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>
158                                 </itemizedlist>
159                                 <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>
160                         </note>
161                         <section>
162                                 <title>Add the OpenSRF User</title>
163                                 <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>
164                                 <figure>
165                                         <title>Commands to add "opensrf" user</title>
166                                         <screen>
167                                         $ su - opensrf
168                                         $ useradd -m -s /bin/bash opensrf
169                                         $ passwd opensrf
170                                         Enter new UNIX password: ******
171                                         Retype new UNIX password: ******
172                                         passwd: password updated successfully
173                                         $
174                                         </screen>
175                                 </figure>
176                         </section>
177                         <section>
178                                 <title>Download and Unpack Latest OpenSRF Version</title>
179                                 <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=""></ulink></emphasis></emphasis></para>
180                                 <figure>
181                                         <title>Commands to download and unpack OpenSRF</title>
182                                         <screen>
183                                         $ su - opensrf
184                                         $ wget
185                                         $ tar zxf OpenSRF-1.2.2.tar.gz
186                                         </screen>
187                                 </figure>
188                                 <para>The new directory <emphasis>/home/opensrf/OpenSRF-1.2.2</emphasis> will be created.</para>
189                         </section>
190                         <section>
191                                 <title>Install Prerequisites to Build OpenSRF</title>
192                                 <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>
193                                 <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>
194                                 <figure>
195                                         <title>Commands to install prerequisites for OpenSRF</title>
196                                         <screen>
197                                         $ su - root
198                                         $ cd /home/opensrf/OpenSRF-1.2.2
199                                         $ make -f src/extras/Makefile.install [distribution]
200                                         ...
201                                         </screen>
202                                 </figure>
203                                 <table xml:id="serversideinstallation-keywords-figure-1">
204                                         <title>Keywords Targets for "make"</title>
205                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
206                                                 <colspec colnum="1" colwidth="1*"/>
207                                                 <colspec colnum="2" colwidth="3*"/>
208                                                 <thead>
209                                                         <row>
210                                                                 <entry>Keyword</entry>
211                                                                 <entry>Description</entry>
212                                                         </row>
213                                                 </thead>
214                                                 <tbody>
215                                                         <row>
216                                                                 <entry>debian-lenny</entry>
217                                                                 <entry>for Debian Lenny (5.0)</entry>
218                                                         </row>
219                                                         <row>
220                                                                 <entry>debian-etch</entry>
221                                                                 <entry>for Debian Etch (4.0)</entry>
222                                                         </row>
223                                                         <row>
224                                                                 <entry>ubuntu-karmic</entry>
225                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
226                                                         </row>
227                                                         <row>
228                                                                 <entry>ubuntu-intrepid</entry>
229                                                                 <entry>for Ubuntu Jaunty (9.04) or Intrepid (8.10)</entry>
230                                                         </row>
231                                                         <row>
232                                                                 <entry>ubuntu-hardy</entry>
233                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
234                                                         </row>
235                                                 </tbody>
236                                         </tgroup>
237                                 </table>
238                                 <caution fileref="media/caution.png"> ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
239                                 <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>
240                         </section>
241                         <section>
242                                 <title>Configure OpenSRF</title>
243                                 <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>
244                                 <figure>
245                                         <title>Commands to configure OpenSRF</title>
246                                         <screen>
247                                         $ su - opensrf
248                                         $ cd /home/opensrf/OpenSRF-1.2.2
249                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
250                                         $ make
251                                         ...
252                                         </screen>
253                                 </figure>
254                         </section>
255                         <section>
256                                 <title>Compile, Link and Install OpenSRF</title>
257                                 <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>
258                                 <figure>
259                                         <title>Commands to build, link and install OpenSRF</title>
260                                         <screen>
261                                         $ su - opensrf
262                                         $ cd /home/opensrf/OpenSRF-1.2.2
263                                         $ make install
264                                         ...
265                                         </screen>
266                                 </figure>
267                         </section>
268                         <section>
269                                 <title>Update the System Dynamic Library Path</title>
270                                 <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/</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>
271                                 <figure>
272                                         <title>Commands to modify system dynamic library path</title>
273                                         <screen>
274                                         $ su - root
275                                         $ echo "/openils/lib" > /etc/
276                                         $ ldconfig
277                                         </screen>
278                                 </figure>
279                         </section>
280                         <section>
281                                 <title>Define Public and Private OpenSRF Domains</title>
282                                 <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>
283                                 <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>
284                                 <figure>
285                                         <title>Example public and private domains in /etc/hosts</title>
286                                         <screen>
287                                      public.localhost        public
288                                      private.localhost       private
289                                         </screen>
290                                 </figure>
291                         </section>
292                         <section>
293                                 <title>Change File Ownerships</title>
294                                 <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>
295                                 <figure>
296                                         <title>Commands to change file ownerships</title>
297                                         <screen>
298                                         $ chown -R opensrf:opensrf /openils
299                                         </screen>
300                                 </figure>
301                         </section>
302                         <section>
303                                 <title>Stop the "ejabberd" Service</title>
304                                 <para>As the <emphasis role="bold">root</emphasis> user, stop the "ejabberd" service:</para>
305                                 <figure>
306                                         <title>Commands to stop the "ejabberd" service</title>
307                                         <screen>
308                                         $ /etc/init.d/ejabberd stop
309                                         </screen>
310                                 </figure>
311                                 <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>
312                                 <figure>
313                                         <title>Commands to recover from "ejabberd" error</title>
314                                         <screen>
315                                         $ su - root
316                                         $ epmd -kill
317                                         $ killall beam; killall beam.smp
318                                         $ rm /var/lib/ejabberd/*
319                                         $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd
320                                         </screen>
321                                 </figure>
322                         </section>
323                         <section>
324                                 <title>Edit the "ejabberd" configuration</title>
325                                 <para>As the <emphasis role="bold">root</emphasis> user, edit the file <emphasis>/etc/ejabberd/ejabberd.cfg</emphasis> and make the following changes:</para>
326                                 <itemizedlist>
327                                         <listitem>Change <emphasis role="bold">{hosts, ["localhost"]}.</emphasis> to <emphasis role="bold">{hosts, ["localhost", "private.localhost", "public.localhost"]}.</emphasis></listitem>
328                                         <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>
329                                         <listitem>Change all three occurrences of <emphasis role="bold">max_stanza_size</emphasis> to <emphasis role="bold">2000000</emphasis>.</listitem>
330                                         <listitem>Change both occurrences of <emphasis role="bold">maxrate</emphasis> to <emphasis role="bold">500000</emphasis>.       </listitem>
331                                         <listitem>Comment out the line <emphasis role="bold">{mod_offline, []}</emphasis> by placing two <emphasis role="bold">%</emphasis> comment signs in front.</listitem>
332                                 </itemizedlist>
333                         </section>
334                         <section>
335                                 <title>Restart the "ejabberd" service</title>
336                                 <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>
337                                 <figure>
338                                         <title>Commands to restart the "ejabberd" service</title>
339                                         <screen>
340                                         $ /etc/init.d/ejabberd start
341                                         </screen>
342                                 </figure>
343                         </section>
344                         <section>
345                                 <title>Register "router" and "ejabberd" users</title>
346                                 <para>On each domain, you need two "ejabberd" users to manage the OpenSRF communications:</para>
347                                 <itemizedlist>
348                                         <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>
349                                         <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>
350                                 </itemizedlist>
351                                 <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>
352                                 <figure>
353                                         <title>Commands to registe "router" and "ejabberd" users</title>
354                                         <screen>
355                                         # Syntax for registering a user with ejabberdctl:
356                                         #    ejabberdctl register &lt;user> &lt;domain> &lt;password>
357                                         #
358                                         $ ejabberdctl register router private.localhost &lt;password>
359                                         $ ejabberdctl register opensrf private.localhost &lt;password>
360                                         $ ejabberdctl register router public.localhost &lt;password>
361                                         $ ejabberdctl register opensrf public.localhost &lt;password>
362                                         </screen>
363                                 </figure>
364                         </section>
365                         <section>
366                                 <title>Create configuration files</title>
367                                 <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>
368                                 <figure>
369                                         <title>Commands to create configuration files</title>
370                                         <screen>
371                                         $ su - root
372                                         $ cd /openils/conf
373                                         $ cp opensrf.xml.example      opensrf.xml
374                                         $ cp opensrf_core.xml.example opensrf_core.xml
375                                         </screen>
376                                 </figure>
377                         </section>
378                         <section>
379                                 <title>Edit opensrf_core.xml</title>
380                                 <para>Edit the file <emphasis>/openils/conf/opensrf_core.xml</emphasis> to change the "ejabberd" usernames and passwords as follows.</para>
381                                 <note>
382                                         <para>
383                                                 <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>
384                                         </para>
385                                 </note>
386                                 <figure>
387                                         <title>Updates needed in the file "/openils/conf/opensrf_core.xml"</title>
388                                         <screen>
389                                         /config/opensrf/username = opensrf
391                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
393                                         /config/gateway/username = opensrf
395                                         /config/gateway/passwd = password for "public.localhost" opensrf user
397                                         # first entry, where "transport/server" == "public.localhost" :
398                                         /config/routers/router/transport 
399                                             username = router
400                                             password = password for "public.localhost" router user
402                                         # second entry, where "transport/server" == "private.localhost" :
403                                         /config/routers/router/transport
404                                             username = router
405                                             password = password for "private.localhost" router user
406                                         </screen>
407                                 </figure>
408                                 <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>
409                         </section>
410                         <section>
411                                 <title>Modify the file "opensrf.xml"</title>
412                                 <para>Modify the file <emphasis>/openils/conf/opensrf.xml</emphasis>.</para>
413                                 <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>
414                                 <figure>
415                                         <title>Example of the file "opensrf.xml"</title>
416                                         <screen>
417                                         &lt;!-- Example of an app-specific setting override -->
418                                         &lt;opensrf.persist>
419                                           &lt;app_settings>
420                                             &lt;dbfile>/tmp/persist.db&lt;/dbfile>
421                                           &lt;/app_settings>
422                                         &lt;/opensrf.persist>
423                                         </screen>
424                                 </figure>
425                         </section>
426                         <section>
427                                 <title>Create Configuration Files for Users Needing srfsh</title>
428                                 <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>
429                                 <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>
430                                 <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>
431                                 <itemizedlist>
432                                         <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>
433                                         <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>
434                                         <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
435                                         <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
436                                 </itemizedlist>
437                                 <figure>
438                                         <title>Example of the file "/openils/conf/srfsh.xml.example"</title>
439                                         <screen>
440                                         &lt;?xml version="1.0"?>
441                                         &lt;!-- This file follows the standard bootstrap config file layout -->
442                                         &lt;!-- found in opensrf_core.xml -->
443                                         &lt;srfsh>
444                                         &lt;router_name>router&lt;/router_name>
445                                         &lt;domain>private.localhost&lt;/domain>
446                                         &lt;username>opensrf&lt;/username>
447                                         &lt;passwd>privsrf&lt;/passwd>
448                                         &lt;port>5222&lt;/port>
449                                         &lt;logfile>/tmp/srfsh.log&lt;/logfile>
450                                         &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
451                                         &lt;loglevel>4&lt;/loglevel>
452                                         &lt;/srfsh>
453                                         </screen>
454                                 </figure>
455                         </section>
456                         <section>
457                                 <title>Modify Environmental Variable PATH for "opensrf" User</title>
458                                 <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>
459                                 <figure>
460                                         <title>Commands to add path to ".bashrc" configuration file</title>
461                                         <screen>
462                                         $ su - opensrf
463                                         $ echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc
464                                         </screen>
465                                 </figure>
466                         </section>
467                         <section>
468                                 <title>Starting OpenSRF</title>
469                                 <para>As the <emphasis role="bold">root</emphasis> user, start the "ejabberd" and "memcached" services:</para>
470                                 <figure>
471                                         <title>Commands to start "ejabberd" and "memcached" services</title>
472                                         <screen>
473                                         $ su - root
474                                         $ /etc/init.d/ejabberd start
475                                         $ /etc/init.d/memcached start
476                                         </screen>
477                                 </figure>
478                                 <para/>
479                                 <para>Finally, as the <emphasis role="bold">opensrf</emphasis> user, start OpenSRF:</para>
480                                 <figure>
481                                         <title>Commands to start OpenSRF</title>
482                                         <screen>
483                                         $ su - opensrf
485                                         # ensure you have the needed path
486                                         $ export PATH=$PATH:/openils/bin
488                                         # start the OpenSRF service:
489                                         # use "-l" to force hostname to be "localhost"
490                                         $ -l -a start_all     
491                                         </screen>
492                                 </figure>
493                                 <note>
494                                         <para>
495                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but <emphasis></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>
496                                         </para>
497                                 </note>
498                         </section>
499                         <section>
500                                 <title>Testing connections to OpenSRF</title>
501                                 <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>
502                                 <figure>
503                                         <title>Commands to test OpenSRF with "srfsh"</title>
504                                         <screen>
505                                         $ su - opensrf
506                                         $ /openils/bin/srfsh
507                                         srfsh#  request opensrf.math add 2 2
508                                         Received Data: 4
509                                         ------------------------------------
510                                         Request Completed Successfully
511                                         Request Time in seconds: 0.007519
512                                         ------------------------------------
513                                         srfsh#
514                                         </screen>
515                                 </figure>
516                                 <caution fileref="media/caution.png"> VERIFY THIS TEST </caution>
517                                 <para>For other srfsh commands, type 'help' in at the prompt.</para>
518                         </section>
519                         <section>
520                                 <title>Stopping OpenSRF</title>
521                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, stop OpenSRF:</para>
522                                 <figure>
523                                         <title>Commands to stop OpenSRF</title>
524                                         <screen>
525                                         $ su - opensrf
526                                         $ -l -a stop_all
527                                         </screen>
528                                 </figure>
529                         </section>
530                 </section>
531                 <section xml:id="serversideinstallation-ubuntudebian">
532                         <title>Installing Evergreen V1.6.0.7 On Ubuntu or Debian</title>
533                         <para>This section outlines the installation process for the latest stable version of Evergreen (</para>
534                         <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>
535                         <note>
536                                 <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>
537                                 <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>
538                                 <itemizedlist>
539                                         <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>
540                                         <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>
541                                 </itemizedlist>
542                                 <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>
543                         </note>
544                         <section xml:id="serversideinstallation-opensrf-overview">
545                                 <title>Installing OpenSRF</title>
546                                 <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>
547                                 <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>
548                         </section>
549                         <section>
550                                 <title>Download and Unpack Latest Evergreen Version</title>
551                                 <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=""></ulink></emphasis></emphasis></para>
552                                 <figure>
553                                         <title>Commands to download and unpack Evergreen</title>
554                                         <screen>
555                                         $ su - opensrf
556                                         $ wget
557                                         $ tar zxf Evergreen-ILS-
558                                         </screen>
559                                 </figure>
560                                 <para>The new directory <emphasis>/home/opensrf/Evergreen-ILS-</emphasis> will be created.</para>
561                         </section>
562                         <section>
563                                 <title>Install Prerequisites to Build Evergreen</title>
564                                 <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>
565                                 <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>
566                                 <figure>
567                                         <title>Commands to install prerequisites for Evergreen</title>
568                                         <screen>
569                                         $ su - root
570                                         $ cd /home/opensrf/Evergreen-ILS-
571                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]
572                                         ...
573                                         </screen>
574                                 </figure>
575                                 <table xml:id="serversideinstallation-keywords-figure-2">
576                                         <title>Keywords Targets for "make"</title>
577                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
578                                                 <colspec colnum="1" colwidth="1*"/>
579                                                 <colspec colnum="2" colwidth="3*"/>
580                                                 <thead>
581                                                         <row>
582                                                                 <entry>Keyword</entry>
583                                                                 <entry>Description</entry>
584                                                         </row>
585                                                 </thead>
586                                                 <tbody>
587                                                         <row>
588                                                                 <entry>debian-lenny</entry>
589                                                                 <entry>for Debian Lenny (5.0), the most recent version</entry>
590                                                         </row>
591                                                         <row>
592                                                                 <entry>debian-etch</entry>
593                                                                 <entry>for Debian Etch (4.0)</entry>
594                                                         </row>
595                                                         <row>
596                                                                 <entry>ubuntu-karmic</entry>
597                                                                 <entry>for Ubuntu Lucid (10.04) [same as for Karmic]</entry>
598                                                         </row>
599                                                         <row>
600                                                                 <entry>ubuntu-karmic</entry>
601                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
602                                                         </row>
603                                                         <row>
604                                                                 <entry>ubuntu-intrepid</entry>
605                                                                 <entry>for Ubuntu Intrepid (8.10)</entry>
606                                                         </row>
607                                                         <row>
608                                                                 <entry>ubuntu-hardy</entry>
609                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
610                                                         </row>
611                                                         <row>
612                                                                 <entry>ubuntu-gutsy</entry>
613                                                                 <entry>for Ubuntu Gutsy (7.10)</entry>
614                                                         </row>
615                                                         <row>
616                                                                 <entry>gentoo</entry>
617                                                                 <entry>generic for Gentoo versions</entry>
618                                                         </row>
619                                                         <row>
620                                                                 <entry>centos</entry>
621                                                                 <entry>generic for Centos versions</entry>
622                                                         </row>
623                                                 </tbody>
624                                         </tgroup>
625                                 </table>
626                                 <caution fileref="media/caution.png"> ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
627                         </section>
628                         <section>
629                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>
630                                 <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>
631                                 <para>For further information on installing PostgreSQL, see the section <link linkend="serversideinstallation-postgresql">"Installing PostgreSQL"</link>.</para>
632                                 <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>
633                                 <figure>
634                                         <title>Commands to install the PostgreSQL server</title>
635                                         <screen>
636                                         $ su - root
638                                         # Debian Lenny and Ubuntu Hardy (8.04)
639                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
640                                         ...
642                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
643                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
644                                         ...
645                                         </screen>
646                                 </figure>
647                                 <note>
648                                         <para>
649                                                 <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>
650                                         </para>
651                                 </note>
652                                 <caution fileref="media/caution.png"> VERIFY: IS THIS STILL TRUE? </caution>
653                                 <caution fileref="media/caution.png"> ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE </caution>
654                         </section>
655                         <section>
656                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
657                                 <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>
658                                 <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>
659                                 <figure>
660                                         <title>Commands to install Perl modules</title>
661                                         <screen>
662                                         # ensure the gcc compiler is installed
663                                         $ su - root
664                                         $ aptitude install gcc
666                                         # install the Perl modules
667                                         $ perl -MCPAN -e shell
668                                         cpan> install JSON::XS
669                                         cpan> install MARC::Record
670                                         cpan> install MARC::File::XML
671                                         </screen>
672                                 </figure>
673                                 <caution fileref="media/caution.png"> ADD INFO ON HOW TO INSTALL THE PERL MODULES </caution>
674                                 <caution fileref="media/caution.png"> ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </caution>
675                         </section>
676                         <section>
677                                 <title>Update the System Dynamic Library Path</title>
678                                 <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/</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>
679                                 <figure>
680                                         <title>Commands to modify system dynamic library path</title>
681                                         <screen>
682                                         $ su - root
683                                         $ cat > /etc/ &lt;&lt; ENDOFFILE
684                                         /usr/local/lib
685                                         /usr/local/lib/dbd
686                                         ENDOFFILE
687                                         $ ldconfig
688                                         </screen>
689                                 </figure>
690                         </section>
691                         <section>
692                                 <title>(OPTIONAL) Restart the PostgreSQL Service</title>
693                                 <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"></emphasis> cannot be found. If your PostgreSQL server is running on another system, just skip this step.</para>
694                                 <caution fileref="media/caution.png"> ADD INFO ON OTHER VERSIONS OF POSTGRESQL </caution>
695                                 <figure>
696                                         <title>Commands to restart PostgreSQL service</title>
697                                         <screen>
698                                         $ su - root
699                                         $ /etc/init.d/postgresql-PGSQL_VERSION restart
700                                         </screen>
701                                 </figure>
702                                 <emphasis>Where "PGSQL_VERSION" is your installed PostgreSQL version (e.g. "8.3").</emphasis>
703                         </section>
704                         <section xml:id="serversideinstallation-configure">
705                                 <title>Configure Evergreen</title>
706                                 <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>
707                                 <figure>
708                                         <title>Commands to configure Evergreen</title>
709                                         <screen>
710                                         $ su - opensrf
711                                         $ cd /home/opensrf/Evergreen-ILS-
712                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
713                                         $ make
714                                         ...
715                                         </screen>
716                                 </figure>
717                         </section>
718                         <section xml:id="serversideinstallation-compilingevergreen">
719                                 <title>Compile, Link and Install Evergreen</title>
720                                 <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>
721                                 <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>
722                                 <para>For further information on manually building the Staff Client, see the section <link linkend="serversideinstallation-staffclient">"Installing the Evergreen Staff Client"</link>.</para>
723                                 <figure>
724                                         <title>Commands to build, link and install Evergreen</title>
725                                         <screen>
726                                         $ su - root
727                                         $ cd /home/opensrf/Evergreen-ILS-
728                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
729                                         ...
730                                         </screen>
731                                         <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>
732                                 </figure>
733                                 <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>
734                                 <figure>
735                                         <title>Commands to create symbolic link</title>
736                                         <screen>
737                                         $ su - root
738                                         $ cd /openils/var/web/xul
739                                         $ ln -sf rel_1_6_0_7/server server
740                                         </screen>
741                                 </figure>
742                         </section>
743                         <section>
744                                 <title>Copy the OpenSRF Configuration Files</title>
745                                 <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>
746                                 <figure>
747                                         <title>Commands to copy OpenSRF configuration files</title>
748                                         <screen>
749                                         $ su - root
750                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
751                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
752                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
753                                         $ chown -R opensrf:opensrf /openils/
754                                         </screen>
755                                 </figure>
756                         </section>
757                         <section>
758                                 <title>Create and Configure PostgreSQL Database</title>
759                                 <para>As the <emphasis role="bold">postgres</emphasis> user on your PostgreSQL server, create the Evergreen database.</para>
760                                 <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>
761                                 <orderedlist>
762                                         <listitem>
763                                                 <para>
764                                                         <emphasis role="bold">Create and configure the database</emphasis>
765                                                 </para>
766                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
767                                                 <figure>
768                                                         <title>Commands to create database and adjust the path</title>
769                                                         <screen>
770                                                         # create the database
771                                                         $ su - postgres
772                                                         $ createdb -E UNICODE evergreen
773                                                         $ createlang plperl   evergreen
774                                                         $ createlang plperlu  evergreen
775                                                         $ createlang plpgsql  evergreen
777                                                         # adjust the paths
778                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen
779                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen
780                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen
781                                                         </screen>
782                                                 </figure>
783                                                 <emphasis>Where "PGSQL_VERSION" is your installed PostgreSQL version (e.g. "8.3").</emphasis>
784                                         </listitem>
785                                         <listitem>
786                                                 <para><emphasis role="bold">Create new Evergreen superuser</emphasis> </para>
787                                                 <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>
788                                                 <figure>
789                                                         <title>Commands to create the "evergreen" user</title>
790                                                         <screen>
791                                                         # create superuser 'evergreen' and set the password
792                                                         $ su - postgres
793                                                         $ createuser -P -s evergreen
794                                                         Enter password for new role: MYNEWPASSWORD
795                                                         Enter it again: MYNEWPASSWORD
796                                                         </screen>
797                                                 </figure>
798                                                 <emphasis>Where "MYNEWPASSWORD" is the password chosen.</emphasis>
799                                         </listitem>
800                                 </orderedlist>
801                         </section>
802                         <section>
803                                 <title>Create Database Schema</title>
804                                 <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>
805                                 <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>
806                                 <figure>
807                                         <title>Commands to create Evergreen database schema</title>
808                                         <screen>
809                                         $ su - root
810                                         $ cd /home/opensrf/Evergreen-ILS-
811                                         $ perl Open-ILS/src/support-scripts/ --update-config \
812                                                 --service all --create-schema --create-bootstrap --create-offline \
813                                                 --hostname HOSTNAME --port PORT \
814                                                 --user evergreen --password PASSWORD --database DATABASENAME
815                                         </screen>
816                                 </figure>
817                                 <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>
818                                 <note>
819                                         <para>
820                                                 <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>
821                                         </para>
822                                 </note>
823                         </section>
824                         <section>
825                                 <title>Configure the Apache Server</title>
826                                 <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>
827                                 <figure>
828                                         <title>Commands to configure the Apache server</title>
829                                         <screen>
830                                         # configure the Apache server
831                                         $ su - root
832                                         $ a2enmod ssl        # enable mod_ssl
833                                         $ a2enmod rewrite    # enable mod_rewrite
834                                         $ a2enmod expires    # enable mod_expires
835                                         $ cd /home/opensrf/Evergreen-ILS-
837                                         # copy files
838                                         $ cp Open-ILS/examples/apache/eg.conf    /etc/apache2/sites-available/
839                                         $ cp Open-ILS/examples/apache/eg_vhost.conf   /etc/apache2/
840                                         $ cp Open-ILS/examples/apache/      /etc/apache2/
841                                         </screen>
842                                 </figure>
843                         </section>
844                         <section>
845                                 <title>Create a Security Certificate (SSL Key)</title>
846                                 <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>
847                                 <figure>
848                                         <title>Commands to create an SSL key</title>
849                                         <screen>
850                                         $ mkdir /etc/apache2/ssl
851                                         $ cd /etc/apache2/ssl
852                                         $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
853                                         </screen>
854                                 </figure>
855                                 <warning>
856                                         <para>
857                                                 <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>
858                                         </para>
859                                 </warning>
860                                 <caution fileref="media/caution.png"> ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </caution>
861                         </section>
862                         <section xml:id="serversideinstallation-modify-apache">
863                                 <title>Modify the Apache Configuration File</title>
864                                 <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>
865                                 <orderedlist>
866                                         <listitem>
867                                                 <para>Comment out the line <emphasis role="bold">Allow from</emphasis>, then uncomment the line <emphasis role="bold">Allow from all</emphasis>.</para>
868                                                 <para>
869                                                         <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>
870                                                 </para>
871                                                 <warning>
872                                                         <para>
873                                                                 <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>
874                                                         </para>
875                                                 </warning>
876                                         </listitem>
877                                         <listitem>
878                                                 <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>
879                                                 <caution fileref="media/caution.png"> ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </caution>
880                                         </listitem>
881                                         <listitem>
882                                                 <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>
883                                                 <itemizedlist>
884                                                         <listitem>
885                                                                 <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>
886                                                         </listitem>
887                                                         <listitem>
888                                                                 <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>
889                                                         </listitem>
890                                                 </itemizedlist>
891                                         </listitem>
892                                         <listitem>
893                                                 <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>
894                                         </listitem>
895                                 </orderedlist>
896                         </section>
897                         <section>
898                                 <title>(OPTIONAL) Performance Modifications for Apache</title>
899                                 <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>
900                                 <orderedlist>
901                                         <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>
902                                         <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.
903                                                 <figure><title>(OPTIONAL) Example of updates to Apache configuration</title><screen>
904                                                         &lt;IfModule mpm_prefork_module>
905                                                            StartServers           20
906                                                            MinSpareServers         5
907                                                            MaxSpareServers        15
908                                                            MaxClients            150
909                                                            MaxRequestsPerChild 10000
910                                                         &lt;/IfModule>
912                                                         MaxKeepAliveRequests 100
913                                                         </screen></figure></listitem>
914                                 </orderedlist>
915                         </section>
916                         <section>
917                                 <title>Enable the Evergreen Site</title>
918                                 <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>
919                                 <figure>
920                                         <title>Commands to enable the Evergreen Web Site</title>
921                                         <screen>
922                                         $ su - root
924                                         # disable the default site
925                                         $ a2dissite default
927                                         # enable the Evergreen web site
928                                         $ a2ensite eg.conf
929                                         </screen>
930                                 </figure>
931                         </section>
932                         <section>
933                                 <title>Modify the OpenSRF Configuration File</title>
934                                 <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>
935                                 <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>
936                                 <note>
937                                         <para>
938                                                 <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>
939                                         </para>
940                                 </note>
941                                 <caution fileref="media/caution.png"> ADD A BETTER DIAGRAM HERE </caution>
942                                 <figure>
943                                         <title>Updates needed in the file "/openils/conf/opensrf_core.xml"</title>
944                                         <screen>
945                                         /config/opensrf/username = opensrf
947                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
949                                         /config/gateway/username = opensrf
951                                         /config/gateway/passwd = password for "public.localhost" opensrf user
953                                         # first entry, where "transport/server" == "public.localhost" :
954                                         /config/routers/router/transport 
955                                             username = router
956                                             password = password for "public.localhost" router user
958                                         # second entry, where "transport/server" == "private.localhost" :
959                                         /config/routers/router/transport
960                                             username = router
961                                             password = password for "private.localhost" router user
962                                         </screen>
963                                 </figure>
964                         </section>
965                         <section>
966                                 <title>Create Configuration Files for Users Needing srfsh</title>
967                                 <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>
968                                 <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>
969                                 <orderedlist>
970                                         <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>
971                                         <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>
972                                         <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
973                                         <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
974                                 </orderedlist>
975                                 <figure>
976                                         <title>Example of user's file ".srfsh.xml"</title>
977                                         <screen>
978                                         &lt;?xml version="1.0"?>
979                                         &lt;!-- This file follows the standard bootstrap config file layout -->
980                                         &lt;!-- found in opensrf_core.xml -->
981                                         &lt;srfsh>
982                                         &lt;router_name>router&lt;/router_name>
983                                         &lt;domain>private.localhost&lt;/domain>
984                                         &lt;username>opensrf&lt;/username>
985                                         &lt;passwd>evergreen&lt;/passwd>
986                                         &lt;port>5222&lt;/port>
987                                         &lt;logfile>/tmp/srfsh.log&lt;/logfile>
988                                         &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
989                                         &lt;loglevel>4&lt;/loglevel>
990                                         &lt;/srfsh>
991                                         </screen>
992                                 </figure>
993                         </section>
994                         <section>
995                                 <title>Modify the OpenSRF Environment</title>
996                                 <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>
997                                 <note>
998                                         <para>
999                                                 <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>
1000                                         </para>
1001                                 </note>
1002                                 <figure>
1003                                         <title>Commands to modify the OpenSRF environment</title>
1004                                         <screen>
1005                                         # change permissions
1006                                         $ su - opensrf
1007                                         $ chmod 755 /openils/var/cgi-bin/*.cgi
1009                                         # add environmental variable
1010                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
1012                                         # inherit the new environment
1013                                         $ . ~/.bashrc
1014                                         </screen>
1015                                 </figure>
1016                         </section>
1017                         <section xml:id="serversideinstallation-starting">
1018                                 <title>Starting Evergreen</title>
1019                                 <orderedlist>
1020                                         <listitem>
1021                                                 <para>As the <emphasis role="bold">root</emphasis> user, start the "ejabberd" and "memcached" services (if they are not already running):</para>
1022                                                 <figure>
1023                                                         <title>Commands to start "ejabberd" and "memcached" services</title>
1024                                                         <screen>
1025                                                         $ su - root
1026                                                         $ /etc/init.d/ejabberd start
1027                                                         $ /etc/init.d/memcached start
1028                                                         </screen>
1029                                                 </figure>
1030                                         </listitem>
1031                                         <listitem>
1032                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, start Evergreen.</para>
1033                                                 <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>
1034                                                 <figure>
1035                                                         <title>Commands to start Evergreen</title>
1036                                                         <screen>
1037                                                         $ su - opensrf
1039                                                         # ensure you have the needed path
1040                                                         $ export PATH=$PATH:/openils/bin
1042                                                         # start the OpenSRF service:
1043                                                         # use "-l" to force hostname to be "localhost"
1044                                                         $ -l -a start_all     
1045                                                         </screen>
1046                                                 </figure>
1047                                                 <note>
1048                                                         <para>
1049                                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but the utility <emphasis></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>
1050                                                         </para>
1051                                                 </note>
1052                                                 <caution fileref="media/caution.png"> ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1053                                                 <para>Execute the following command to determine the fully qualified domain name of your system:</para>
1054                                                 <figure>
1055                                                         <title>(OPTIONAL) Commands to determine the fully qualified domain name</title>
1056                                                         <screen>
1057                                                         $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
1058                                                         </screen>
1059                                                 </figure>
1060                                                 <itemizedlist>
1061                                                         <listitem>When you attempt to start Evergreen, if you receive an error message similar to <emphasis> 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>
1062                                                         <listitem>When you attempt to start Evergreen, if you receive an error message similar to <emphasis>Can't locate OpenSRF/ 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>
1063                                                 </itemizedlist>
1064                                         </listitem>
1065                                         <listitem>
1066                                                 <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>
1067                                                 <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>
1068                                                 <figure>
1069                                                         <title>Commands to generate web files</title>
1070                                                         <screen>
1071                                                         $ su - opensrf
1072                                                         $ cd /openils/bin
1073                                                         $ ./ -c /openils/conf/opensrf_core.xml -u
1074                                                         Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
1075                                                         Updating fieldmapper
1076                                                         ...
1077                                                         </screen>
1078                                                         <caution fileref="media/caution.png"> ADD RESULTS OF TESTS FROM "" </caution>
1079                                                 </figure>
1080                                         </listitem>
1081                                         <listitem>
1082                                                 <para>As the <emphasis role="bold">root</emphasis> user, restart the Apache Web server:</para>
1083                                                 <figure>
1084                                                         <title>Commands to restart Apache web server</title>
1085                                                         <screen>
1086                                                         $ su - root
1087                                                         $ /etc/init.d/apache2 restart
1088                                                         </screen>
1089                                                 </figure>
1090                                                 <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>
1091                                         </listitem>
1092                                 </orderedlist>
1093                         </section>
1094                         <section xml:id="serversideinstallation-testing">
1095                                 <title>Testing the Installation</title>
1096                                 <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>
1097                                 <section xml:id="serversideinstallation-testing-connections">
1098                                         <title>Testing Connections to Evergreen</title>
1099                                         <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>
1100                                         <figure>
1101                                                 <title>Commands to test Evergreen with "srfsh"</title>
1102                                                 <screen>
1103                                                 $ su - opensrf
1104                                                 $ /openils/bin/srfsh
1105                                                 srfsh% login admin open-ils
1106                                                 Received Data: "250bf1518c7527a03249858687714376"
1107                                                 ------------------------------------
1108                                                 Request Completed Successfully
1109                                                 Request Time in seconds: 0.045286
1110                                                 ------------------------------------
1111                                                 Received Data: {
1112                                                    "ilsevent":0,
1113                                                    "textcode":"SUCCESS",
1114                                                    "desc":" ",
1115                                                    "pid":21616,
1116                                                    "stacktrace":"oils_auth.c:304",
1117                                                    "payload":{
1118                                                       "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
1119                                                       "authtime":420
1120                                                    }
1121                                                 }
1122                                                 ------------------------------------
1123                                                 Request Completed Successfully
1124                                                 Request Time in seconds: 1.336568
1125                                                 ------------------------------------
1126                                                 </screen>
1127                                         </figure>
1128                                 </section>
1129                                 <section>
1130                                         <title>Other Connection Tests with "srfsh"</title>
1131                                         <para></para>
1132                                         <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>
1133                                         <screen>
1134                                         srfsh# math_bench 10
1135                                         |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
1136                                         ++++++++++++++++++++++++++++++++++++++++
1137                                         Average round trip time: 0.033425
1138                                         srfsh#
1139                                         </screen>
1140                                         <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>
1141                                         <para>For other srfsh commands, type 'help' in at the prompt.</para>
1142                                         <para/>
1143                                         <para>If this does not work, try the troubleshooting steps in the following section.</para>
1144                                 </section>
1145                                 <section>
1146                                         <title>Testing with ""</title>
1147                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, run the script <emphasis></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>
1148                                         <caution fileref="media/caution.png"> REWORK THIS DIAGRAM TO USE SAME IMAGE STANDARDS AS OTHER CHAPTERS </caution>
1149                                         <figure>
1150                                                 <title>Executing the script <emphasis></emphasis></title>
1151                                                 <mediaobject>
1152                                                         <imageobject>
1153                                                                 <imagedata fileref="../media/serversideinstallation-testing-1.png" scalefit="1" width="100%"/>
1154                                                         </imageobject>
1155                                                 </mediaobject>
1156                                                 <mediaobject>
1157                                                         <imageobject>
1158                                                                 <imagedata fileref="../media/serversideinstallation-testing-2.png" scalefit="1" width="100%"/>
1159                                                         </imageobject>
1160                                                 </mediaobject>
1161                                         </figure>
1162                                         <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>
1163                                         <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="">Evergreen development mailing list</ulink> for assistance before making any drastic changes to your system configuration.</para>
1164                                 </section>
1165                                 <section xml:id="serversideinstallation-testing-opac">
1166                                         <title>Testing the Catalog</title>
1167                                         <para>By default, the OPAC will live at the URL <emphasis></emphasis>.</para>
1168                                         <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>
1169                                         <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>
1170                                         <caution fileref="media/caution.png"> ADD OTHER SIMPLE FUNCTIONAL TESTS </caution>
1171                                 </section>
1172                                 <section>
1173                                         <title>Running the Evergreen Staff Client</title>
1174                                         <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>
1175                                         <para>For example, if the source files for the Evergreen installation are in the directory <emphasis>/home/opensrf/Evergreen-ILS-</emphasis>, start the Staff Client as follows:</para>
1176                                         <figure>
1177                                                 <title>Commands to run the Staff Client</title>
1178                                                 <screen>
1179                                                 $ su - opensrf
1180                                                 $ xulrunner /home/opensrf/Evergreen-ILS-
1181                                                 </screen>
1182                                         </figure>
1183                                 </section>
1184                                 <section xml:id="serversideinstallation-starting-apache-server">
1185                                         <title>Testing the Apache Web Server</title>
1186                                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>
1187                                         <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>
1188                                         <figure>
1189                                                 <title>Commands to test the Apache Web Server</title>
1190                                                 <screen>
1191                                                 $ su - root
1192                                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart
1193                                                 </screen>
1194                                         </figure>
1195                                 </section>
1196                         </section>
1197                         <section xml:id="serversideinstallation-stopping">
1198                                 <title>Stopping Evergreen</title>
1199                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, stop all Evergreen services by using the following command:</para>
1200                                 <figure>
1201                                         <title>Commands to stop Evergreen</title>
1202                                         <screen>
1203                                         $ su - opensrf
1205                                         # stop the server:
1206                                         # use "-l" to force hostname to be "localhost"
1207                                         $ -l -a stop_all
1208                                         </screen>
1209                                 </figure>
1210                                 <note>
1211                                         <para>
1212                                                 <emphasis>You can also stop Evergreen services <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but the utility <emphasis></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>
1213                                         </para>
1214                                 </note>
1215                                 <caution fileref="media/caution.png"> ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1216                         </section>
1217                 </section>
1218                 <section xml:id="serversideinstallation-postinstallation">
1219                         <title>Post-Installation Chores</title>
1220                         <section>
1221                                 <title>Remove temporary changes from Apache configuration file</title>
1222                                 <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>
1223                                 <para>Uncomment the line <emphasis role="bold">Allow from</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>
1224                         </section>
1225                         <section>
1226                                 <title>Configure a permanent SSL key</title>
1227                                 <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>
1228                                 <warning>
1229                                         <para>
1230                                                 <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>
1231                                         </para>
1232                                 </warning>
1233                                 <caution fileref="media/caution.png"> ADD EXPLANATION OF HOW TO GET PERMANENT SSL CERTIFICATE </caution>
1234                         </section>
1235                         <section>
1236                                 <title>Set Up Support For Reports</title>
1237                                 <para>Evergreen reports are extremely powerful, but some configuration is required. See the section <link linkend="report-introduction">"Reports"</link> for details.</para>
1238                                 <section>
1239                                         <title>Starting the Reporter Daemon</title>
1240                                         <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>
1241                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, start the reporter daemon using the following command:</para>
1242                                         <figure>
1243                                                 <title>Commands to start the Reporter daemon</title>
1244                                                 <screen>
1245                                                 $ su - opensrf
1246                                                 $ cd /home/opensrf/Evergreen-ILS-
1247                                                 $ ./ --daemon
1248                                                 </screen>
1249                                         </figure>
1250                                         <para>You can also specify other options with this utility:</para>
1251                                         <itemizedlist>
1252                                                 <listitem>--sleep=interval      : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>
1253                                                 <listitem>--lockfile=filename   : where to place the lockfile for the process; defaults to <emphasis>/tmp/reporter-LOCK</emphasis></listitem>
1254                                                 <listitem>--concurrency=integer : number of reporter daemon processes to run; defaults to "1"</listitem>
1255                                                 <listitem>--bootstrap=filename   : OpenSRF bootstrap configuration file; defaults to <emphasis>/openils/conf/opensrf_core.xml</emphasis></listitem>
1256                                         </itemizedlist>
1257                                 </section>
1258                                 <section>
1259                                         <title>Stopping the Reporter Daemon</title>
1260                                         <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>
1261                                         <note>
1262                                                 <para>
1263                                                         <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>
1264                                                 </para>
1265                                         </note>
1266                                         <figure>
1267                                                 <title>Commands to stop the Reporter daemon</title>
1268                                                 <screen>
1269                                                 $ su - opensrf
1270                                                 # find and kill the process ID number(s)
1271                                                 $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
1272                                                 # remove the lock file
1273                                                 $ rm /tmp/reporter-LOCK
1274                                                 </screen>
1275                                         </figure>
1276                                 </section>
1277                         </section>
1278                 </section>
1279                 <section xml:id="serversideinstallation-staffclient">
1280                         <title>Installing the Evergreen Staff Client</title>
1281                         <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 the final compile/link/install phase of the default Evergreen build process.</para>
1282                         <section>
1283                                 <title>Building the Evergreen Staff Client</title>
1284                                 <para>You can also build the Staff Client manually by running the <emphasis>make</emphasis> command in the source directory <emphasis>/home/opensrf/Evergreen-ILS-</emphasis>. The <emphasis>make</emphasis> command accepts a number of options to build special versions of the Staff Client. Following is a list of environment variables that can be passed to <emphasis>make</emphasis> to influence the manual build process:</para>
1285                                 <section>
1286                                         <title>Option STAFF_CLIENT_BUILD_ID</title>
1287                                         <para>This variable defaults to an automatically generated date/time string during the normal Evergreen server-side software installation process, but you can also specify it manually. The following commands could have been used during the normal build process:</para>
1288                                         <figure>
1289                                                 <title>Commands for normal Evergreen build</title>
1290                                                 <screen>
1291                                                 $ su - root
1292                                                 $ cd /home/opensrf/Evergreen-ILS-
1293                                                 $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
1294                                                 ...
1295                                                 </screen>
1296                                         </figure>
1297                                         <para>You can also manually set the BUILD_ID. The following commands will manually build the Staff Client using a different BUILD_ID.</para>
1298                                         <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>
1299                                         <figure>
1300                                                 <title>Commands to manually build the Staff Client</title>
1301                                                 <screen>
1302                                                 $ su - opensrf
1303                                                 $ cd /home/opensrf/Evergreen-ILS-
1304                                                 $ make STAFF_CLIENT_BUILD_ID=my_test_id  build
1305                                                 ...
1306                                                 </screen>
1307                                         </figure>
1308                                 </section>
1309                                 <section>
1310                                         <title>Option STAFF_CLIENT_VERSION</title>
1311                                         <para>During the normal Evergreen server-side software build process this variable is pulled automatically from a README file in the Evergreen source root, but you can also specify it manually. The following commands could have been used during the normal build process:</para>
1312                                         <figure>
1313                                                 <title>Commands used for normal Evergreen build</title>
1314                                                 <screen>
1315                                                 $ su - root
1316                                                 $ cd /home/opensrf/Evergreen-ILS-
1317                                                 $ make STAFF_CLIENT_VERSION=0mytest.200 install
1318                                                 ...
1319                                                 </screen>
1320                                         </figure>
1321                                         <para>If you manually build the Staff Client, VERSION will default to <emphasis>0trunk.revision</emphasis>, where revision is either automatically pulled from SVN or an empty string on failure. If you wish to make extensions update automatically then your version needs to conform to the format found in <ulink url="">Toolkit Version Format</ulink> and newer versions need to be "higher" than older versions.</para>
1322                                         <para>You can manually set VERSION. The following commands will manually build the Staff Client using a different VERSION.</para>
1323                                         <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>
1324                                         <figure>
1325                                                 <title>Commands to manually build the Staff Client</title>
1326                                                 <screen>
1327                                                 $ su - opensrf
1328                                                 $ cd /home/opensrf/Evergreen-ILS-
1329                                                 $ make STAFF_CLIENT_VERSION=0mytest.200  build
1330                                                 ...
1331                                                 </screen>
1332                                         </figure>
1333                                 </section>
1334                                 <section>
1335                                         <title>Option STAFF_CLIENT_STAMP_ID variable</title>
1336                                         <para>During the normal Evergreen server-side software build process this variable is generated from STAFF_CLIENT_VERSION, but you can also specify it manually. The following commands could have been used during the normal build process:</para>
1337                                         <figure>
1338                                                 <title>Commands used for normal Evergreen build</title>
1339                                                 <screen>
1340                                                 $ su - root
1341                                                 $ cd /home/opensrf/Evergreen-ILS-
1342                                                 $ make STAFF_CLIENT_STAMP_ID=my_test_stamp install
1343                                                 ...
1344                                                 </screen>
1345                                         </figure>
1346                                         <para>It is possible to have multiple versions of the Staff Client with different stamps, possibly for different uses or client-side customizations.</para>
1347                                         <para>You can manually set STAMP_ID. The following commands will manually build the Staff Client using a different STAMP_ID.</para>
1348                                         <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>
1349                                         <figure>
1350                                                 <title>Commands to manually build the Staff Client</title>
1351                                                 <screen>
1352                                                 $ su - opensrf
1353                                                 $ cd /home/opensrf/Evergreen-ILS-
1354                                                 $ make STAFF_CLIENT_STAMP_ID=my_test_stamp  build
1355                                                 ...
1356                                                 </screen>
1357                                         </figure>
1358                                 </section>
1359                         </section>
1360                         <section>
1361                                 <title>Advanced Build Options</title>
1362                                 <para>In addition to the basic options listed above, there are a number of other 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>
1363                                 <table>
1364                                         <title>Keywords Targets for "make" Command</title>
1365                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
1366                                                 <colspec colnum="1" colwidth="1*"/>
1367                                                 <colspec colnum="2" colwidth="3*"/>
1368                                                 <thead>
1369                                                         <row>
1370                                                                 <entry>Keyword</entry>
1371                                                                 <entry>Description</entry>
1372                                                         </row>
1373                                                 </thead>
1374                                                 <tbody>
1375                                                         <row>
1376                                                                 <entry>clients</entry>
1377                                                                 <entry>Run "make win-client", "make linux-client", and "make generic-client" individually</entry>
1378                                                         </row>
1379                                                         <row>
1380                                                                 <entry>client_dir</entry>
1381                                                                 <entry>Build a client directory from the build directory, without doing a rebuild. The same as "copy everything but server/".</entry>
1382                                                         </row>
1383                                                         <row>
1384                                                                 <entry>client_app</entry>
1385                                                                 <entry>Prereq "client_dir"; removes "install.rdf" from client directory so an app bundle can't be installed as an extension</entry>
1386                                                         </row>
1387                                                         <row>
1388                                                                 <entry>client_ext</entry>
1389                                                                 <entry>Prereq "client_dir"; remove "application.ini", "autoupdate.js", "standalone_xul_app.js" from client directory so an extension won't break Firefox</entry>
1390                                                         </row>
1391                                                         <row>
1392                                                                 <entry>extension</entry>
1393                                                                 <entry>Prereq "client_ext"; rewritten to use "client_ext"</entry>
1394                                                         </row>
1395                                                         <row>
1396                                                                 <entry>generic-client</entry>
1397                                                                 <entry>Prereq "client_app"; make an XPI file suitable for use with "xulrunner --install-app""</entry>
1398                                                         </row>
1399                                                         <row>
1400                                                                 <entry>win-xulrunner</entry>
1401                                                                 <entry>Prereq "client_app"; add Windows xulrunner to client build</entry>
1402                                                         </row>
1403                                                         <row>
1404                                                                 <entry>linux-xulrunner</entry>
1405                                                                 <entry>Prereq "client_app"; add Linux xulrunner to client build</entry>
1406                                                         </row>
1407                                                         <row>
1408                                                                 <entry>win-client</entry>
1409                                                                 <entry>Prereq "win-xulrunner"; build "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>
1410                                                         </row>
1411                                                         <row>
1412                                                                 <entry>linux-client</entry>
1413                                                                 <entry>Prereq "linux_xulrunner"; build a "tar.bz2" bundle of the Linux client</entry>
1414                                                         </row>
1415                                                         <row>
1416                                                                 <entry>[generic | win | linux | extension]-updates[-client]</entry>
1417                                                                 <entry>Call external/ 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>
1418                                                         </row>
1419                                                 </tbody>
1420                                         </tgroup>
1421                                 </table>
1422                                 <itemizedlist>
1423                                         <listitem>
1424                                                 <para>Developer Build</para>
1425                                                 <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 special developer options.</para>
1426                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, run <emphasis>make</emphasis> from the Staff Client source directory:</para>
1427                                                 <figure>
1428                                                         <title>Commands to do a "developer build"</title>
1429                                                         <screen>
1430                                                         $ su - opensrf
1431                                                         $ cd /home/opensrf/Evergreen-ILS-
1432                                                         $ make devbuild
1433                                                         ...
1434                                                         </screen>
1435                                                 </figure>
1436                                         </listitem>
1437                                         <listitem>
1438                                                 <para>Compressed Javascript</para>
1439                                                 <para>You can automatically run the Google "Closure Compiler" utility to review and compress Javascript code after the build process completes by substituting "compress-javascript" for "build" when running <emphasis>make</emphasis>.</para>
1440                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, run the following commands from the Staff Client source directory:</para>
1441                                                 <figure>
1442                                                         <title>Commands to compress Javascript</title>
1443                                                         <screen>
1444                                                         $ su - opensrf
1445                                                         $ cd /home/opensrf/Evergreen-ILS-
1446                                                         $ make compress-javascript
1447                                                         ...
1448                                                         </screen>
1449                                                 </figure>
1450                                                 <para>You can also combine Javascript review and compression, and also perform a "developer build".</para>
1451                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, run the following commands from the Staff Client source directory:</para>
1452                                                 <figure>
1453                                                         <title>Commands to compress Javascript and do a "developer build"</title>
1454                                                         <screen>
1455                                                         $ su - opensrf
1456                                                         $ cd /home/opensrf/Evergreen-ILS-
1458                                                         # order of options is important!
1459                                                         $ make devbuild compress-javascript
1460                                                         ...
1461                                                         </screen>
1462                                                 </figure>
1463                                         </listitem>
1464                                         <listitem>
1465                                                 <para>Automatic Update Host</para>
1466                                                 <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>
1467                                                 <figure>
1468                                                         <title>Commands to set AUTOUPDATE_HOST for normal Evergreen build</title>
1469                                                         <screen>
1470                                                         $ su - root
1471                                                         $ cd /home/opensrf/Evergreen-ILS-
1472                                                         $ make AUTOUPDATE_HOST=localhost install
1473                                                         ...
1474                                                         </screen>
1475                                                 </figure>
1476                                                 <para>You can manually set AUTOUPDATE_HOST. The following commands will manually build the Staff Client using a different AUTOUPDATE_HOST.</para>
1477                                                 <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>
1478                                                 <figure>
1479                                                         <title>Commands to manually specify AUTOUPDATE_HOST</title>
1480                                                         <screen>
1481                                                         $ su - opensrf
1482                                                         $ cd /home/opensrf/Evergreen-ILS-
1483                                                         $ make AUTOUPDATE_HOST=localhost build
1484                                                         ...
1485                                                         </screen>
1486                                                 </figure>
1487                                                 <para>For more information see the section <link linkend="serversideinstallation-staffclient-autoupdate">"Automatic Updates"</link>.</para>
1488                                         </listitem>
1489                                 </itemizedlist>
1490                         </section>
1491                         <section>
1492                                 <title>Installing and Activating the Staff Client</title>
1493                                 <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 from its source directory, then you need to take additional steps to install and active it.</para>
1494                                 <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>
1495                                 <figure>
1496                                         <title>Commands to install and active the Staff Client</title>
1497                                         <screen>
1498                                         $ su - opensrf
1499                                         $ cd /home/opensrf/Evergreen-ILS-
1500                                         $ mkdir -p "/openils/var/web/xul/$(cat build/STAMP_ID)"
1501                                         $ cp -R build/server "/openils/var/web/xul/$(cat build/STAMP_ID)"
1502                                         </screen>
1503                                 </figure>
1504                         </section>
1505                         <section>
1506                                 <title>Packaging the Staff Client</title>
1507                                 <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>
1508                                 <itemizedlist>
1509                                         <listitem>
1510                                                 <para>Packaging a Generic Client</para>
1511                                                 <para>This build creates a Staff Client packaged as an XPI file suitable for use with <emphasis>XULRunner</emphasis>.</para>
1512                                                 <para>This special build 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>
1513                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1514                                                 <figure>
1515                                                         <title>Commands to package a "generic" client</title>
1516                                                         <screen>
1517                                                         $ su - opensrf
1518                                                         $ cd /home/opensrf/Evergreen-ILS-
1519                                                         $ make generic-client
1520                                                         ...
1521                                                         </screen>
1522                                                 </figure>
1523                                         </listitem>
1524                                         <listitem>
1525                                                 <para>Packaging a Windows Client</para>
1526                                                 <para>This build creates a Staff Client packaged as a Windows executable</para>
1527                                                 <para>This special build requires that you already have the "zip" utility installed on your system. It also requires that you install <ulink url="">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. The output file "evergreen_staff_client_setup.exe" will be created.</para>
1528                                                 <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>
1529                                                 <para>You can also use a tool such as <ulink url="">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</para>
1530                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1531                                                 <figure>
1532                                                         <title>Useful icon ID strings</title>
1533                                                         <screen>
1534                                                         IDI_APPICON - Tray icon
1535                                                         32512 - Default window icon
1536                                                         </screen>
1537                                                 </figure>
1538                                                 <para/>
1539                                                 <figure>
1540                                                         <title>Commands to build a Windows client</title>
1541                                                         <screen>
1542                                                         $ su - opensrf
1543                                                         $ cd /home/opensrf/Evergreen-ILS-
1544                                                         $ make win-client
1545                                                         ...
1546                                                         </screen>
1547                                                 </figure>
1548                                         </listitem>
1549                                         <listitem>
1550                                                 <para>Packaging a Linux Client</para>
1551                                                 <para>This build creates a Staff Client package for Linux as a "tar.bz2" file with <emphasis>XULRunner</emphasis> already bundled with it. The output file "evergreen_staff_client.tar.bz2" will be created.</para>
1552                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1553                                                 <figure>
1554                                                         <title>Commands to build a Linux client</title>
1555                                                         <screen>
1556                                                         $ su - opensrf
1557                                                         $ cd /home/opensrf/Evergreen-ILS-
1558                                                         $ make linux-client
1559                                                         ...
1560                                                         </screen>
1561                                                 </figure>
1562                                         </listitem>
1563                                         <listitem>
1564                                                 <para>Packaging a Firefox Extension</para>
1565                                                 <para>This special build requires that you already have the "zip" utility installed on your system. This build creates a Staff Client packaged as a Firefox extension. The output file "evergreen.xpi" will be created.</para>
1566                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1567                                                 <figure>
1568                                                         <title>Commands to build a Firefox extension</title>
1569                                                         <screen>
1570                                                         $ su - opensrf
1571                                                         $ cd /home/opensrf/Evergreen-ILS-
1572                                                         $ make extension
1573                                                         ...
1574                                                         </screen>
1575                                                 </figure>
1576                                         </listitem>
1577                                 </itemizedlist>
1578                         </section>
1579                         <section xml:id="serversideinstallation-staffclient-autoupdate">
1580                                 <title>Automatic Updates</title>
1581                                 <para>It is possible to set up support for automatic Staff Client updates, either during the normal Evergreen server-side build process, or by later building the Staff Client with certain special options.</para>
1582                                 <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 WILL NOT WORK.</para>
1583                                 <para>In addition, automatic updates have special requirements for the file <emphasis>update.rdf</emphasis>:</para>
1584                                 <orderedlist>
1585                                         <listitem>It must be served from an SSL server, or</listitem>
1586                                         <listitem>It must be signed with the utility <ulink url="">McCoy</ulink>.</listitem>
1587                                 </orderedlist>
1588                                 <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>
1589                                 <para>The name of the automatic update host can be provided in either of two ways:</para>
1590                                 <orderedlist>
1591                                         <listitem>At configuration time for the Evergreen server-side software, or</listitem>
1592                                         <listitem>During the Staff Client build process</listitem>
1593                                 </orderedlist>
1594                                 <section>
1595                                         <title>Specifying the Automatic Update Host</title>
1596                                         <section>
1597                                                 <title>At configuration time for the Evergreen server-side software</title>
1598                                                 <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>
1599                                                 <figure>
1600                                                         <title>Commands to configure Evergreen</title>
1601                                                         <screen>
1602                                                         $ su - opensrf
1603                                                         $ cd /home/opensrf/Evergreen-ILS-
1604                                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf --with-updateshost=hostname
1605                                                         $ make
1606                                                         ...
1607                                                         </screen>
1608                                                 </figure>
1609                                         </section>
1610                                         <section>
1611                                                 <title>During the Staff Client build process</title>
1612                                                 <para>You will used the variable AUTOUPDATE_HOST=hostname (see above). If you specify just a hostname (such as "") then the URL will be a secure HTTPS URL (such as ""). If you wish to use a non-HTTPS URL then prefix the hostname with "http://". (such as "").</para>
1613                                                 <para>If neither option is used then, by default, the Staff Client will not include the automatic update preferences.</para>
1614                                         </section>
1615                                 </section>
1616                                 <section>
1617                                         <title>Building Updates</title>
1618                                         <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>
1619                                         <para>A "full" update will be built for each specified target (or for all if the target "updates" is used). 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>
1620                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1621                                         <figure>
1622                                                 <title>Commands for building updates</title>
1623                                                 <screen>
1624                                                 $ su - opensrf
1625                                                 $ cd /home/opensrf/Evergreen-ILS-
1627                                                 # command to build all updates at once:
1628                                                 $ make updates
1629                                                 ...
1631                                                 # commands to build updates individually:
1632                                                 $ make generic-updates
1633                                                 ...
1634                                                 $ make win-updates
1635                                                 ...
1636                                                 $ make linux-updates
1637                                                 ...
1638                                                 $ make extension-updates
1639                                                 ...
1640                                                 </screen>
1641                                         </figure>
1642                                 </section>
1643                                 <section>
1644                                         <title>Building updates with "-client"</title>
1645                                         <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>
1646                                         <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>
1647                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1648                                         <figure>
1649                                                 <title>Commands for building updates</title>
1650                                                 <screen>
1651                                                 $ su - opensrf
1652                                                 $ cd /home/opensrf/Evergreen-ILS-
1654                                                 # command to build all updates at once:
1655                                                 $ make updates-client
1656                                                 ...
1658                                                 # commands to build updates individually:
1659                                                 $ make generic-updates-client
1660                                                 ...
1661                                                 $ make win-updates-client
1662                                                 ...
1663                                                 $ make linux-updates-client
1664                                                 ...
1665                                                 </screen>
1666                                         </figure>
1667                                 </section>
1668                                 <section>
1669                                         <title>Activating the Update Server</title>
1670                                         <para>This section reviews scripts associated with the update server, and requires some final adjustments to file permissions.</para>
1671                                         <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>
1672                                         <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>
1673                                         <para>As the <emphasis role="bold">root</emphasis> user, change directory to the updates directory, then execute the following commands:</para>
1674                                         <para>The following scripts should be marked as executable: <emphasis>check, download, manualupdate.html, update.rdf</emphasis>.</para>
1675                                         <figure>
1676                                                 <title>Changing permissions of scripts</title>
1677                                                 <screen>
1678                                                 $ su - root
1679                                                 $ cd /openils/var/updates/pub
1680                                                 $ chmod +x  check  download  manualupdate.html  update.rdf
1681                                                 </screen>
1682                                         </figure>
1683                                 </section>
1684                         </section>
1685                         <section>
1686                                 <title>Other tips</title>
1687                                 <itemizedlist>
1688                                         <listitem>
1689                                                 <para>Multiple workstations on one install</para>
1690                                                 <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>
1691                                                 <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>
1692                                                 <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>
1693                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1694                                                 <figure>
1695                                                         <title>Command to add start menu option</title>
1696                                                         <screen>
1697                                                         $ su - opensrf
1698                                                         $ cd /home/opensrf/Evergreen-ILS-
1699                                                         $ make NSIS_EXTRAOPTS=-DPROFILES win-client
1700                                                         ...
1701                                                         </screen>
1702                                                 </figure>
1703                                         </listitem>
1704                                         <listitem>
1705                                                 <para> Multiple Staff Clients</para>
1706                                                 <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>
1707                                                 <para>Once you have done so, 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>
1708                                         </listitem>
1709                                 </itemizedlist>
1710                         </section>
1711                         <section xml:id="serversideinstallation-running-staffclient">
1712                                 <title>Running the Evergreen Staff Client</title>
1713                                 <caution fileref="media/caution.png">ADD CONTENT: LINUX VS WINDOWS STAFF CLIENT</caution>
1714                                 <para>Run the Evergreen 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>
1715                                 <para>For example, if the source files for the Evergreen installation are in the directory <emphasis>/home/opensrf/Evergreen-ILS-</emphasis>, start the Staff Client as shown in the following command example:</para>
1716                                 <figure>
1717                                         <title>Commands to run the Staff Client</title>
1718                                         <screen>
1719                                         $ su - opensrf
1720                                         $ xulrunner /home/opensrf/Evergreen-ILS-
1721                                         </screen>
1722                                 </figure>
1723                         </section>
1724                 </section>
1725         </section>
1726         <section xml:id="serversideinstallation-otherlinux">
1727                 <title>Installing Evergreen On Other Linux Systems</title>
1728                 <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING ON OTHER LINUX SYSTEMS </caution>
1729         </section>
1730         <section xml:id="serversideinstallation-virtual">
1731                 <title>Installing Evergreen in Virtualized Unix Environments</title>
1732                 <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>
1733                 <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </caution>
1734                 <section xml:id="serversideinstallation-virtualized-virtualbox">
1735                         <title>VirtualBox</title>
1736                         <caution fileref="media/caution.png"> ADD CONTENT FOR VirtualBox </caution>
1737                 </section>
1738                 <section xml:id="serversideinstallation-virtualized-vmware">
1739                         <title>VMware</title>
1740                         <caution fileref="media/caution.png"> ADD CONTENT FOR VMware </caution>
1741                 </section>
1742                 <section xml:id="serversideinstallation-virtualized-virtualpc">
1743                         <title>VirtualPC</title>
1744                         <caution fileref="media/caution.png"> ADD CONTENT FOR VirtualPC </caution>
1745                 </section>
1746         </section>
1747         <section xml:id="serversideinstallation-previousversions">
1748                 <title>Installing Previous Versions of Evergreen</title>
1749                 <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>
1750                 <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold"></emphasis></emphasis>. The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>.</para>
1751                 <section xml:id="serversideinstallation-ubuntudebian-previous">
1752                         <title>Installing Evergreen on Ubuntu or Debian</title>
1753                         <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING EVERGREEN ON UBUNTU OR DEBIAN </caution>
1754                 </section>
1755                 <section xml:id="serversideinstallation-opensrf-previous">
1756                         <title>Installing OpenSRF 1.0.x</title>
1757                         <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING OPENSRF 1.0.x </caution>
1758                 </section>
1759         </section>
1760         <section xml:id="serversideinstallation-postgresql">
1761                 <title>Installing PostgreSQL</title>
1762                 <caution fileref="media/caution.png"> ADD CONTENT FOR POSTGRESQL </caution>
1763         </section>
1764         <section xml:id="serversideinstallation-apache">
1765                 <title>Apache</title>
1766                 <section>
1767                         <title>Securing Apache (httpd)</title>
1768                         <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>
1769                         <caution fileref="media/caution.png"> ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </caution>
1770                         <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>
1771                 </section>
1772                 <caution fileref="media/caution.png"> ADD MORE CONTENT FOR APACHE </caution>
1773         </section>
1774         <section xml:id="serversideinstallation-memcached">
1775                 <title>memcached Servers</title>
1776                 <caution fileref="media/caution.png"> ADD CONTENT FOR MEMCACHED </caution>
1777         </section>
1778         <section xml:id="serversideinstallation-organizationandpolicy">
1779                 <title>Organization and Policy Editing</title>
1780                 <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>
1781                 <itemizedlist>
1782                         <listitem>Adding a branch library</listitem>
1783                         <listitem>Changing circulation rules for an existing library</listitem>
1784                         <listitem>Adding a new staff position or user group</listitem>
1785                 </itemizedlist>
1786                 <caution fileref="media/caution.png"> ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </caution>
1787         </section>
1788         <section xml:id="serversideinstallation-sip">
1789                 <title>Installing the SIP Server</title>
1790                 <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING THE SIP SERVER </caution>
1791         </section>
1792         <section xml:id="serversideinstallation-nginx">
1793                 <title>Using nginx to serve static content</title>
1794                 <caution fileref="media/caution.png"> ADD CONTENT FOR USING NGINX TO SERVE STATIC CONTENT </caution>
1795         </section>
1796         <section xml:id="serversideinstallation-localization">
1797                 <title>(OPTIONAL) Configuration for Other Languages</title>
1798                 <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>
1799                 <caution fileref="media/caution.png"> ADD SECTION ON LANGUAGE LOCALIZATION </caution>
1800         </section>
1801 </chapter>