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