]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
ea8202a455439fb60550a0c6d48d0a79fd687f6d
[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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-ubuntudebian"> "Installing Evergreen On Ubuntu or Debian" </link></emphasis></emphasis> for instructions tailored to installing on some particular distributions of the Linux operating system. Earlier software distributions are described in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-previousversions"> "Installing Previous Versions of Evergreen" </link></emphasis></emphasis>.</para>
12                 <para>Current versions of the Evergreen server-side software run as native applications 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 and 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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-virtual">"Installing Evergreen in Virtualized Unix Environments"</link></emphasis></emphasis>.</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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-opensrf"> "Installing OpenSRF On Ubuntu or Debian" </link></emphasis></emphasis>, 
15 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-postgresql"> "Installing PostgreSQL" </link></emphasis></emphasis>, 
16 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-apache"> "Apache" </link></emphasis></emphasis> and
17 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-memcached"> "memcached Servers" </link></emphasis></emphasis>.
18                 </para>
19                 <para>Finally, installation of the Evergreen Staff Client software is reviewed in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-staffclient"> "Running the Evergreen Staff Client" </link></emphasis></emphasis>. </para>
20                 <section>
21                         <title>Evergreen Software Dependencies</title>
22                         <para>The Evergreen server-side software is keyed to certain major software sub-components in the Evergreen environment. Successful installation of Evergreen software requires that software versions agree with those listed here:</para>
23                         <figure>
24                                 <title>Evergreen software dependencies</title>
25                                 <informaltable>
26                                         <tgroup align="left" cols="3" colsep="1" rowsep="1">
27                                                 <colspec colname="Evergreen" colnum="1" colwidth="1*"/>
28                                                 <colspec colname="OpenSRF" colnum="2" colwidth="1*"/>
29                                                 <colspec colname="PostgreSQL" colnum="3" colwidth="1*"/>
30                                                 <thead>
31                                                         <row>
32                                                                 <entry>Evergreen</entry>
33                                                                 <entry>OpenSRF</entry>
34                                                                 <entry>PostgreSQL</entry>
35                                                         </row>
36                                                 </thead>
37                                                 <tbody>
38                                                         <row>
39                                                                 <entry>1.6.x</entry>
40                                                                 <entry>1.2</entry>
41                                                                 <entry>8.2 / 8.3</entry>
42                                                         </row>
43                                                 </tbody>
44                                                 <tbody>
45                                                         <row>
46                                                                 <entry>1.4.x</entry>
47                                                                 <entry>1.0</entry>
48                                                                 <entry>8.1 / 8.2</entry>
49                                                         </row>
50                                                 </tbody>
51                                                 <tbody>
52                                                         <row>
53                                                                 <entry>1.2.x</entry>
54                                                                 <entry>0.9</entry>
55                                                                 <entry>8.1 / 8.2</entry>
56                                                         </row>
57                                                 </tbody>
58                                         </tgroup>
59                                 </informaltable>
60                         </figure>
61                         <para>[[ VERIFY THE DEPENDENCIES IN THIS TABLE ]] </para>
62                 </section>
63                 <section>
64                         <title>Current Stable Software Release</title>
65                         <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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-ubuntudebian"> "Installing Evergreen on Ubuntu or Debian" </link></emphasis></emphasis> .
66                         </para>
67                         <para>This release of Evergreen software is dependent on the Open Service Request Framework (OpenSRF) software framework. 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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-opensrf"> "Installing OpenSRF" </link></emphasis></emphasis> .</para>
68                 </section>
69                 <section>
70                         <title>Previous Software Releases</title>
71                         <para>Earlier releases of Evergreen are also available. Instructions for installing, configuring and testing earlier versions are found in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-previousversions"> "Installing Previous Versions of Evergreen" </link></emphasis></emphasis> .</para>
72                         <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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-ubuntudebian-previous"> "Installing Evergreen 1.4.0.6 on Ubuntu or Debian" </link></emphasis></emphasis> .
73                         </para>
74                         <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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-opensrf-previous"> "Installing OpenSRF 1.0.x" </link></emphasis></emphasis> .
75                         </para>
76                 </section>
77                 <section>
78                         <title>System Requirements</title>
79                         <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>
80                         <para> [[ ADD FURTHER CONTENT ON HARDWARE AND SOFTWARE REQUIREMENTS ]] </para>
81                         <para>
82                                 <screen>
83                                 From Dan Scott on [http://list.georgialibraries.org/pipermail/
84                                   open-ils-general/2007-July/000316.html|OPEN-ILS-GENERAL]:
85                                 On 8/11/07, lan ye &lt;lye at mail.slcl.org> wrote:
86                                 > We've been researching the Evergreen Open Source Library system,
87                                 > and would like to have a list of hardware requirements for the
88                                 > installation of a small test server. To keep things within a
89                                 > small budget, I would like to just use an ordinary PC. Could you
90                                 > send some information to us?
91         
92                                 For system requirements, it depends on how extensive you want your
93                                 tests to be. Evergreen and all of the pieces it depends on
94                                 (PostgreSQL, Apache, Ejabberd) run happily in a VMWare image
95                                 allocated 512MB of RAM on my laptop with just the Project
96                                 Gutenberg e-books loaded, and that's enough to evaluate the OPAC
97                                 interface / try out the staff client / make some local changes and
98                                 generally experiment. But I'm not going to load one million bib
99                                 records into that system and expect it to perform. So, probably
100                                 any hardware you have lying around would be adequate for a small
101                                 test server.
102         
103                                 > It looks like Evergreen has been successfully installed on two
104                                 > Linux systems: Gentoo and Ubuntu. Which one is the best for us
105                                 > to test using what's already in place at other libraries? Are
106                                 > there any differences / Advantages in functionality between
107                                 > Gentoo and Ubuntu?
108         
109                                 As John said, GPLS is running on Debian, and that's the only
110                                 Evergreen system that is in production at the moment. However, the
111                                 documentation for installing on Debian is a bit scattered right
112                                 now. The developers themselves used Gentoo originally, and that's
113                                 what I'm using at the moment &amp; have documented in the wiki;
114                                 the install process on Ubuntu is very thoroughly documented and
115                                 Ubuntu is reasonably close to Debian.  
116                                 See http://open-ils.org/dokuwiki/doku.php?id=server_installation 
117                                 for the list of install instructions for various distributions.
118         
119                                 As for advantages / disadvantages of particular distributions,
120                                 that's a religious war that I don't want to step into... We'll try
121                                 to help you out no matter what distribution you choose; just
122                                 please choose a current release :)
123         
124                                 -- 
125                                 Dan Scott
126                                 Laurentian University
127                                 </screen>
128                                 <screen>
129                                 And from James Fournie in that same [http://list.georgialibraries.org/
130                                   pipermail/open-ils-general/2007-July/000317.html|thread]:
131                                 We are running a test Ubuntu server on a ~1ghz Celeron PC with
132                                 512mb RAM.  It seems to be ok handling the Gutenberg samples, and
133                                 our collection of about 8000 records. We did have serious problems
134                                 using anything less than 512mb RAM. Also, I tried Evergreen on a
135                                 K6 II 350, but it wasn't pretty.
136         
137                                 James Fournie
138                                 Digitization Librarian
139                                 Union of B.C. Indian Chiefs
140                                 </screen>
141                         </para>
142                 </section>
143                 <section>
144                         <title>Example System Architectures</title>
145                         <para>This sections describes examples of some working Evergreen system architectures, including both server-side software and Staff Client software.</para>
146                         <para>A bare-minimum system Evergreen system requires only a single Server and a single 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>
147                         <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.</para>
148                         <section xml:id="serversideinstallation-example-pines">
149                                 <title>PINES</title>
150                                 <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>
151                                 <para>[[ ADD FURTHER INFORMATION ON PINES ]] </para>
152                         </section>
153                         <section xml:id="serversideinstallation-example-sitka">
154                                 <title>Sitka</title>
155                                 <para>[[ ADD FURTHER INFORMATION ON SITKA ]] </para>
156                         </section>
157                         <section xml:id="serversideinstallation-example-other">
158                                 <title>Other working systems</title>
159                                 <para>[[ ADD FURTHER INFORMATION ON OTHER WORKING SYSTEMS ]] </para>
160                         </section>
161                 </section>
162         </section>
163         <section xml:id="serversideinstallation-all">
164                 <title>Installation of Server-Side Software</title>
165                 <para>This section describes the installation of the major components of Evergreen server-side software, including the Open Service Request Framework (OpenSRF), and Evergreen itself.</para>
166                 <para>As far as possible, perform the following steps in the exact order they are 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 <emphasis><emphasis role="bold"><link linkend="adminmisc-backingup"> "Backing Up" </link></emphasis></emphasis>  for further information.</para>
167                 <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>
168                 <section xml:id="serversideinstallation-opensrf">
169                         <title>Installing OpenSRF On Ubuntu or Debian</title>
170                         <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>
171                         <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>
172                         <note>
173                                 <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>
174                                 <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>
175                                 <itemizedlist>
176                                         <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>
177                                         <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>
178                                 </itemizedlist>
179                                 <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>
180                         </note>
181                         <section>
182                                 <title>Add the OpenSRF User</title>
183                                 <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>
184                                 <figure>
185                                         <title>Add the user "opensrf"</title>
186                                         <screen>
187                                         $ su - opensrf
188                                         $ useradd -m -s /bin/bash opensrf
189                                         $ passwd opensrf
190                                         </screen>
191                                 </figure>
192                         </section>
193                         <section>
194                                 <title>Download and Unpack Latest OpenSRF Version</title>
195                                 <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>
196                                 <para>[[ VERIFY LOCATION OF LATEST VERSION OF OPENSRF ]]</para>
197                                 <figure>
198                                         <title>Commands to download/extract OpenSRF</title>
199                                         <screen>
200                                         $ su - opensrf
201                                         $ wget http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz
202                                         $ tar zxf OpenSRF-1.2.2.tar.gz
203                                         </screen>
204                                 </figure>
205                                 <para>The new directory <emphasis>/home/opensrf/OpenSRF-1.2.2</emphasis> will be created.</para>
206                         </section>
207                         <section>
208                                 <title>Install Prerequisites to Build OpenSRF</title>
209                                 <para>In this step you will install and configure a set of prerequisites used to build OpenSRF. In a following step you will actually build the software using the <emphasis>make</emphasis> utility.</para>
210                                 <para>As the <emphasis role="bold">root</emphasis> user, enter the commands show below in <emphasis>Figure 1.5</emphasis> 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 here:</para>
211                                 <para>[[ ADD INFO FOR OTHER LINUX DISTRIBUTIONS ]]</para>
212                                 <figure>
213                                         <title>Keywords used with "make"</title>
214                                         <informaltable>
215                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
216                                                         <colspec colname="keyword" colnum="1" colwidth="1*"/>
217                                                         <colspec colname="description" colnum="2" colwidth="1*"/>
218                                                         <thead>
219                                                                 <row>
220                                                                         <entry>Keyword</entry>
221                                                                         <entry>Description</entry>
222                                                                 </row>
223                                                         </thead>
224                                                         <tbody>
225                                                                 <row>
226                                                                         <entry>debian-lenny</entry>
227                                                                         <entry>for Debian Lenny (5.0), the most recent version</entry>
228                                                                 </row>
229                                                         </tbody>
230                                                         <tbody>
231                                                                 <row>
232                                                                         <entry>debian-etch</entry>
233                                                                         <entry>for Debian Etch (4.0)</entry>
234                                                                 </row>
235                                                         </tbody>
236                                                         <tbody>
237                                                                 <row>
238                                                                         <entry>ubuntu-intrepid</entry>
239                                                                         <entry>for Ubuntu Jaunty (9.04)</entry>
240                                                                 </row>
241                                                         </tbody>
242                                                         <tbody>
243                                                                 <row>
244                                                                         <entry>ubuntu-intrepid</entry>
245                                                                         <entry>for Ubuntu Intrepid (8.10)</entry>
246                                                                 </row>
247                                                         </tbody>
248                                                         <tbody>
249                                                                 <row>
250                                                                         <entry>ubuntu-hardy</entry>
251                                                                         <entry>for Ubuntu Hardy (8.04)</entry>
252                                                                 </row>
253                                                         </tbody>
254                                                 </tgroup>
255                                         </informaltable>
256                                 </figure>
257                                 <figure>
258                                         <title>Commands to install prerequisites for OpenSRF</title>
259                                         <screen>
260                                         $ su - root
261                                         $ cd /home/opensrf/OpenSRF-1.2.2
262                                         $ make -f src/extras/Makefile.install [distribution]
263                                         </screen>
264                                 </figure>
265                                 <para>This will install a number of packages required by OpenSRF on your system, 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>
266                         </section>
267                         <section>
268                                 <title>Configure OpenSRF</title>
269                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, configure OpenSRF by preparing a "make" file to be used in the next step to compile and link OpenSRF. You can include the <emphasis>--enable-python</emphasis>  and <emphasis>--enable-java</emphasis> configure options if you want to include support for Python and Java, respectively:</para>
270                                 <figure>
271                                         <title>Commands to prepare make file for OpenSRF</title>
272                                         <screen>
273                                         $ su - opensrf
274                                         $ cd /home/opensrf/OpenSRF-1.2.2
275                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
276                                         $ make
277                                         </screen>
278                                 </figure>
279                         </section>
280                         <section>
281                                 <title>Compile and link OpenSRF</title>
282                                 <para>As the <emphasis role="bold">root</emphasis> user, return to your OpenSRF build directory and compile, link and install OpenSRF:</para>
283                                 <figure>
284                                         <title>Commands to build OpenSRF</title>
285                                         <screen>
286                                         $ su - opensrf
287                                         $ cd /home/opensrf/OpenSRF-1.2.2
288                                         $ make install
289                                         </screen>
290                                 </figure>
291                         </section>
292                         <section>
293                                 <title>Update the system dynamic library path</title>
294                                 <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 dynamic library path:</para>
295                                 <figure>
296                                         <title>Commands to modify system dynamic library path</title>
297                                         <screen>
298                                         $ su - root
299                                         $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
300                                         /usr/local/lib
301                                         /usr/local/lib/dbd
302                                         ENDOFFILE
303                                         $ ldconfig
304                                         </screen>
305                                 </figure>
306                         </section>
307                         <section>
308                                 <title>Define public and private OpenSRF domains</title>
309                                 <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>. Here are the entries to add to a stock file <emphasis>/etc/hosts</emphasis> for our example domains:</para>
310                                 <figure>
311                                         <title>Entries to add to /etc/hosts</title>
312                                         <screen>
313                                         127.0.1.3       private.localhost       private
314                                         </screen>
315                                 </figure>
316                         </section>
317                         <section>
318                                 <title>Change file ownerships</title>
319                                 <para>As the <emphasis role="bold">root</emphasis> user, change the ownership of the installed files to the opensrf user:</para>
320                                 <figure>
321                                         <title>Entries to add to /etc/hosts</title>
322                                         <screen>
323                                         chown -R opensrf:opensrf /openils
324                                         </screen>
325                                 </figure>
326                         </section>
327                         <section>
328                                 <title>Stop the "ejabberd" service</title>
329                                 <para>As the <emphasis role="bold">root</emphasis> user, stop the "ejabberd" service:</para>
330                                 <figure>
331                                         <title>Stop the "ejabberd" service</title>
332                                         <screen>
333                                         $ /etc/init.d/ejabberd stop
334                                         </screen>
335                                 </figure>
336                                 <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>
337                                 <figure>
338                                         <title>Stop the "ejabberd" service</title>
339                                         <screen>
340                                         $ su - root
341                                         $ epmd -kill
342                                         $ killall beam; killall beam.smp
343                                         $ rm /var/lib/ejabberd/*
344                                         $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd
345                                         </screen>
346                                 </figure>
347                         </section>
348                         <section>
349                                 <title>Edit the "ejabberd" configuration</title>
350                                 <para>As the <emphasis role="bold">root</emphasis> user, edit <emphasis>/etc/ejabberd/ejabberd.cfg</emphasis> :</para>
351                                 <itemizedlist>
352                                         <listitem>Change <screen>{hosts, ["localhost"]}.</screen> to <screen>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</screen></listitem>
353                                         <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>
354                                         <listitem>Change all three occurrences of <emphasis role="bold">max_stanza_size</emphasis> to <emphasis role="bold">2000000</emphasis>.</listitem>
355                                         <listitem>Change both occurrences of <emphasis role="bold">maxrate</emphasis> to <emphasis role="bold">500000</emphasis>.       </listitem>
356                                         <listitem>Comment out the <emphasis role="bold">{mod_offline</emphasis> line by placing two <emphasis role="bold">%</emphasis> signs in front.</listitem>
357                                 </itemizedlist>
358                         </section>
359                         <section>
360                                 <title>Restart the "ejabberd" service</title>
361                                 <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>
362                                 <figure>
363                                         <title>Restarting the "ejabberd" service</title>
364                                         <screen>
365                                         $ /etc/init.d/ejabberd start
366                                         </screen>
367                                 </figure>
368                         </section>
369                         <section>
370                                 <title>Register "router" and "ejabberd" users</title>
371                                 <para>On each domain, you need two "ejabberd" users to manage the OpenSRF communications:</para>
372                                 <itemizedlist>
373                                         <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>
374                                         <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>
375                                 </itemizedlist>
376                                 <para>As the <emphasis role="bold">root</emphasis> user, 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 your configuration in <emphasis>opensrf_core.xml</emphasis>:</para>
377                                 <figure>
378                                         <title>Register "router" and "ejabberd" users</title>
379                                         <screen>
380                                         # Syntax for registering a user with ejabberdctl:
381                                         #    ejabberdctl register &lt;user> &lt;domain> &lt;password>
382                                         #
383                                         $ ejabberdctl register router private.localhost &lt;password>
384                                         $ ejabberdctl register opensrf private.localhost &lt;password>
385                                         $ ejabberdctl register router public.localhost &lt;password>
386                                         $ ejabberdctl register opensrf public.localhost &lt;password>
387                                         </screen>
388                                 </figure>
389                         </section>
390                         <section>
391                                 <title>Create configuration files</title>
392                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, create the configuration files <emphasis> /openils/conf/opensrf_core.xml</emphasis> and <emphasis>/openils/conf/opensrf.xml</emphasis> from the example templates:</para>
393                                 <figure>
394                                         <title>Commands to copy OpenSRF configuration files</title>
395                                         <screen>
396                                         $ su - root
397                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
398                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
399                                         </screen>
400                                 </figure>
401                         </section>
402                         <section>
403                                 <title>Edit opensrf_core.xml</title>
404                                 <para>Edit the file <emphasis>/openils/conf/opensrf_core.xml</emphasis> to change the "ejabberd" usernames and passwords as follows.</para>
405                                 <note>
406                                         <para>
407                                                 <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>
408                                         </para>
409                                 </note>
410                                 <figure>
411                                         <title>Updates needed to the file "/openils/conf/opensrf_core.xml"</title>
412                                         <screen>
413                                         /config/opensrf/username  = opensrf
414
415                                         /config/opensrf/passwd    = password for "private.localhost" opensrf user
416
417                                         /config/gateway/username  = opensrf
418
419                                         /config/gateway/passwd    = password for "public.localhost" opensrf user
420
421                                         # first entry, where "transport/server" == "public.localhost" :
422                                         /config/routers/router/transport 
423                                             username = router
424                                             password = password for "public.localhost" router user
425
426                                         # second entry, where "transport/server" == "private.localhost" :
427                                         /config/routers/router/transport
428                                             username = router
429                                             password = password for "private.localhost" router user
430                                         </screen>
431                                 </figure>
432                                 <para>You also need to specify the domains from which Evergreen will accept and to which Evergreen 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>
433                         </section>
434                         <section>
435                                 <title>Edit opensrf.xml</title>
436                                 <para>Edit the file <emphasis>/openils/conf/opensrf.xml</emphasis> to set the location of the persistent database in the <emphasis role="bold">&lt;dbfile></emphasis> element near the end of the file:</para>
437                                 <figure>
438                                         <title>example of file "opensrf.xml"</title>
439                                         <screen>
440                                         &lt;!-- Example of an app-specific setting override -->
441                                         &lt;opensrf.persist>
442                                           &lt;app_settings>
443                                             &lt;dbfile>/tmp/persist.db&lt;/dbfile>
444                                           &lt;/app_settings>
445                                         &lt;/opensrf.persist>
446                                         </screen>
447                                 </figure>
448                         </section>
449                         <section>
450                                 <title>Copy srfsh.xml.example</title>
451                                 <para>In this step 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>
452                                 <itemizedlist>
453                                         <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>
454                                         <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>
455                                         <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
456                                         <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
457                                 </itemizedlist>
458                                 <figure>
459                                         <title>Sample of configuration file /openils/conf/srfsh.xml.example</title>
460                                         <screen>
461                                         &lt;?xml version="1.0"?>
462                                         &lt;!-- This file follows the standard bootstrap config file layout -->
463                                         &lt;!-- found in opensrf_core.xml -->
464                                         &lt;srfsh>
465                                         &lt;router_name>router&lt;/router_name>
466                                         &lt;domain>private.localhost&lt;/domain>
467                                         &lt;username>opensrf&lt;/username>
468                                         &lt;passwd>privsrf&lt;/passwd>
469                                         &lt;port>5222&lt;/port>
470                                         &lt;logfile>/tmp/srfsh.log&lt;/logfile>
471                                         &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
472                                         &lt;loglevel>4&lt;/loglevel>
473                                         &lt;/srfsh>
474                                         </screen>
475                                 </figure>
476                         </section>
477                         <section>
478                                 <title>Modify environmental variable PATH for "opensrf" user</title>
479                                 <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>
480                                 <figure>
481                                         <title>Add path to ".bashrc" configuration file</title>
482                                         <screen>
483                                         $ echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc
484                                         $ exit
485                                         </screen>
486                                 </figure>
487                         </section>
488                         <section>
489                                 <title>Starting OpenSRF</title>
490                                 <para>Before starting OpenSRF, ensure that the "ejabberd" and "memcached" daemons are running.</para>
491                                 <para>As the <emphasis role="bold">root</emphasis> user, start the "ejabberd" and "memcached" services:</para>
492                                 <figure>
493                                         <title>Start some services</title>
494                                         <screen>
495                                         $ su - root
496                                         $ /etc/init.d/ejabberd start
497                                         $ /etc/init.d/memcached start
498                                         </screen>
499                                 </figure>
500                                 <para>As the <emphasis role="bold">root</emphasis> user, OpenSRF:</para>
501                                 <figure>
502                                         <title>Start OpenSRF</title>
503                                         <screen>
504                                         $ su - opensrf
505
506                                         # ensure you have the needed path
507                                         $ export PATH=$PATH:/openils/bin
508
509                                         # start the OpenSRF service:
510                                         # use "-l" to force hostname to be "localhost"
511                                         $ osrf_ctl.sh -l -a start_all     
512                                         </screen>
513                                 </figure>
514                                 <note>
515                                         <para>
516                                                 <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>
517                                         </para>
518                                 </note>
519                         </section>
520                         <section>
521                                 <title>Testing connections to OpenSRF</title>
522                                 <para>As the <emphasis role="bold">root</emphasis> user, test your connection to OpenSRF by executing the utility <emphasis>srfsh</emphasis> and trying to call the <emphasis>add</emphasis> method on the OpenSRF "math" service:</para>
523                                 <figure>
524                                         <title>Testing OpenSRF with the "math" method</title>
525                                         <screen>
526                                         $ su - opensrf
527                                         $ /openils/bin/srfsh
528                                         srfsh#  request opensrf.math add 2 2
529                                         Received Data: 4
530                                         ------------------------------------
531                                         Request Completed Successfully
532                                         Request Time in seconds: 0.007519
533                                         ------------------------------------
534                                         srfsh#
535                                         </screen>
536                                 </figure>
537                                 <para>For other srfsh commands, type 'help' in at the prompt.</para>
538                         </section>
539                         <section>
540                                 <title>Stopping OpenSRF</title>
541                                 <para>As the <emphasis role="bold">root</emphasis> user, stop OpenSRF:</para>
542                                 <figure>
543                                         <title>Testing OpenSRF with the "math" method</title>
544                                         <screen>
545                                         $ su - opensrf
546                                         $ osrf_ctl.sh -l -a stop_all
547                                         </screen>
548                                 </figure>
549                         </section>
550                 </section>
551                 <section xml:id="serversideinstallation-ubuntudebian">
552                         <title>Installing Evergreen On Ubuntu or Debian</title>
553                         <para>This section outlines the installation process for the latest stable version of Evergreen (1.6.0.7).</para>
554                         <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>
555                         <note>
556                                 <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>
557                                 <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>
558                                 <itemizedlist>
559                                         <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>
560                                         <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>
561                                 </itemizedlist>
562                                 <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>
563                         </note>
564                         <section xml:id="serversideinstallation-opensrf-overview">
565                                 <title>Installing OpenSRF</title>
566                                 <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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-opensrf"> "Installing OpenSRF" </link></emphasis></emphasis>.</para>
567                                 <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>
568                         </section>
569                         <section>
570                                 <title>Download and Unpack Latest Evergreen Version</title>
571                                 <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>
572                                 <para>[[ VERIFY LOCATION OF LATEST VERSION OF EVERGREEN ]]</para>
573                                 <figure>
574                                         <title>Commands to download/extract Evergreen</title>
575                                         <screen>
576                                         $ su - opensrf
577                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz
578                                         $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz
579                                         </screen>
580                                 </figure>
581                                 <para>The new directory <emphasis>/home/opensrf/Evergreen-ILS-1.6.0.1</emphasis> will be created.</para>
582                         </section>
583                         <section>
584                                 <title>Install Prerequisites to Build Evergreen</title>
585                                 <para>In this step you will install and configure a set of prerequisites used to build Evergreen. In a following step you will actually build the software using the <emphasis>make</emphasis> utility.</para>
586                                 <para>As the <emphasis role="bold">root</emphasis> user, enter the commands show below in <emphasis> Figure 1.3</emphasis> 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 here:</para>
587                                 <para>[[ ADD INFO FOR OTHER LINUX DISTRIBUTIONS ]]</para>
588                                 <figure>
589                                         <title>Keywords used with "make"</title>
590                                         <informaltable>
591                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
592                                                         <colspec colname="keyword" colnum="1" colwidth="1*"/>
593                                                         <colspec colname="description" colnum="2" colwidth="1*"/>
594                                                         <thead>
595                                                                 <row>
596                                                                         <entry>Keyword</entry>
597                                                                         <entry>Description</entry>
598                                                                 </row>
599                                                         </thead>
600                                                         <tbody>
601                                                                 <row>
602                                                                         <entry>debian-lenny</entry>
603                                                                         <entry>for Debian Lenny (5.0), the most recent version</entry>
604                                                                 </row>
605                                                         </tbody>
606                                                         <tbody>
607                                                                 <row>
608                                                                         <entry>debian-etch</entry>
609                                                                         <entry>for Debian Etch (4.0)</entry>
610                                                                 </row>
611                                                         </tbody>
612                                                         <tbody>
613                                                                 <row>
614                                                                         <entry>ubuntu-karmic</entry>
615                                                                         <entry>for Ubuntu Lucid (10.04) [same as for Karmic]</entry>
616                                                                 </row>
617                                                         </tbody>
618                                                         <tbody>
619                                                                 <row>
620                                                                         <entry>ubuntu-karmic</entry>
621                                                                         <entry>for Ubuntu Karmic (9.10)</entry>
622                                                                 </row>
623                                                         </tbody>
624                                                         <tbody>
625                                                                 <row>
626                                                                         <entry>ubuntu-intrepid</entry>
627                                                                         <entry>for Ubuntu Intrepid (8.10)</entry>
628                                                                 </row>
629                                                         </tbody>
630                                                         <tbody>
631                                                                 <row>
632                                                                         <entry>ubuntu-hardy</entry>
633                                                                         <entry>for Ubuntu Hardy (8.04)</entry>
634                                                                 </row>
635                                                         </tbody>
636                                                         <tbody>
637                                                                 <row>
638                                                                         <entry>ubuntu-gutsy</entry>
639                                                                         <entry>for Ubuntu Gutsy (7.10)</entry>
640                                                                 </row>
641                                                         </tbody>
642                                                         <tbody>
643                                                                 <row>
644                                                                         <entry>gentoo</entry>
645                                                                         <entry>generic for Gentoo versions</entry>
646                                                                 </row>
647                                                         </tbody>
648                                                         <tbody>
649                                                                 <row>
650                                                                         <entry>centos</entry>
651                                                                         <entry>generic for Centos versions</entry>
652                                                                 </row>
653                                                         </tbody>
654                                                 </tgroup>
655                                         </informaltable>
656                                 </figure>
657                                 <figure>
658                                         <title>Commands to install prerequisites for Evergreen</title>
659                                         <screen>
660                                         $ su - root
661                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
662                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]
663                                         </screen>
664                                 </figure>
665                         </section>
666                         <section>
667                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>
668                                 <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>
669                                 <para>For further information on installing PostgreSQL, see the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-postgresql"> "Installing PostgreSQL" </link></emphasis></emphasis>.</para>
670                                 <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>
671                                 <figure>
672                                         <title>Commands to install the PostgreSQL server</title>
673                                         <screen>
674                                         $ su - root
675         
676                                         # Debian Lenny and Ubuntu Hardy (8.04)
677                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
678         
679                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
680                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
681                                         </screen>
682                                 </figure>
683                                 <note>
684                                         <para>
685                                                 <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>
686                                         </para>
687                                 </note>
688                                 <para>[[ VERIFY: IS THIS STILL TRUE? ]]</para>
689                                 <para>[[ ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE ]]</para>
690                         </section>
691                         <section>
692                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
693                                 <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>
694                                 <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>
695                                 <figure>
696                                         <title>Commands to install Perl modules</title>
697                                         <screen>
698                                         # ensure the gcc compiler is installed
699                                         $ su - root
700                                         $ aptitude install gcc
701         
702                                         # install the Perl modules
703                                         $ perl -MCPAN -e shell
704                                         cpan> install JSON::XS
705                                         cpan> install MARC::Record
706                                         cpan> install MARC::File::XML
707                                         </screen>
708                                 </figure>
709                                 <para>[[ ADD INFO ON HOW TO INSTALL THE PERL MODULES ]]</para>
710                                 <para>[[ ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED ]]</para>
711                         </section>
712                         <section>
713                                 <title>Update the system dynamic library path</title>
714                                 <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 dynamic library path:</para>
715                                 <figure>
716                                         <title>Commands to modify system dynamic library path</title>
717                                         <screen>
718                                         $ su - root
719                                         $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
720                                         /usr/local/lib
721                                         /usr/local/lib/dbd
722                                         ENDOFFILE
723                                         $ ldconfig
724                                         </screen>
725                                 </figure>
726                         </section>
727                         <section>
728                                 <title>(OPTIONAL) Restart the PostgreSQL Service</title>
729                                 <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>
730                                 <para>[[ ADD INFO ON OTHER VERSIONS OF POSTGRESQL ]]</para>
731                                 <figure>
732                                         <title>Commands to restart PostgreSQL service</title>
733                                         <screen>
734                                         $ su - root
735                                         $ /etc/init.d/postgresql-8.3 restart
736                                         </screen>
737                                 </figure>
738                         </section>
739                         <section>
740                                 <title>Configure and Compile Evergreen Sources</title>
741                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, configure and compile the software from the prerequisites that were set up in previous steps:</para>
742                                 <figure>
743                                         <title>Commands to configure and compile Evergreen</title>
744                                         <screen>
745                                         $ su - opensrf
746                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
747                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
748                                         $ make
749                                         </screen>
750                                 </figure>
751                         </section>
752                         <section>
753                                 <title>Link and Install Evergreen</title>
754                                 <para>As the <emphasis role="bold">root</emphasis> user, link and install the compiled code. In the commands below, 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. Finally, create a symbolic link named <emphasis role="bold">server</emphasis> in <emphasis role="bold">/openils/var/web/xul</emphasis> to the <emphasis role="bold">/server</emphasis> subdirectory of your Staff Client build:</para>
755                                 <figure>
756                                         <title>Commands to link and install Evergreen</title>
757                                         <screen>
758                                         $ su - root
759                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
760                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_6 install
761                                         $ cd /openils/var/web/xul
762                                         $ ln -sf rel_1_6_0_7/server server
763                                         </screen>
764                                 </figure>
765                         </section>
766                         <section>
767                                 <title>Copy the OpenSRF Configuration Files</title>
768                                 <para>As the <emphasis role="bold">root</emphasis> user, copy the example OpenSRF configuration files into place. This will replace the OpenSRF configuration files that you set up while installing and testing 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>
769                                 <figure>
770                                         <title>Commands to copy OpenSRF configuration files</title>
771                                         <screen>
772                                         $ su - root
773                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
774                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
775                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
776                                         $ chown -R opensrf:opensrf /openils/
777                                         </screen>
778                                 </figure>
779                         </section>
780                         <section>
781                                 <title>Create and configure PostgreSQL Database</title>
782                                 <para>As the <emphasis role="bold">postgres</emphasis> user on your PostgreSQL server, create the Evergreen database.</para>
783                                 <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>
784                                 <orderedlist>
785                                         <listitem>
786                                                 <para>
787                                                         <emphasis role="bold">Create and configure the database</emphasis>
788                                                 </para>
789                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
790                                                 <figure>
791                                                         <title>Commands to create database and adjust the path</title>
792                                                         <screen>
793                                                         # create the database
794                                                         $ su - postgres
795                                                         $ createdb -E UNICODE evergreen
796                                                         $ createlang plperl   evergreen
797                                                         $ createlang plperlu  evergreen
798                                                         $ createlang plpgsql  evergreen
799                 
800                                                         # adjust the paths
801                                                         $ psql -f /usr/share/postgresql/8.3/contrib/tablefunc.sql evergreen
802                                                         $ psql -f /usr/share/postgresql/8.3/contrib/tsearch2.sql  evergreen
803                                                         $ psql -f /usr/share/postgresql/8.3/contrib/pgxml.sql     evergreen
804                                                         </screen>
805                                                 </figure>
806                                         </listitem>
807                                         <listitem>
808                                                 <para><emphasis role="bold">Create new Evergreen superuser</emphasis> </para>
809                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system, create the new user <emphasis role="bold"> evergreen </emphasis>:</para>
810                                                 <figure>
811                                                         <title>Commands to create the 'evergreen' user</title>
812                                                         <screen>
813                                                         # create superuser 'evergreen' and set the password
814                                                         $ su - postgres
815                                                         $ createuser -P -s evergreen
816                                                         Enter password for new role:  mynewpassword
817                                                         Enter it again:  mynewpassword
818                                                         </screen>
819                                                 </figure>
820                                         </listitem>
821                                 </orderedlist>
822                         </section>
823                         <section>
824                                 <title>Create Database Schema</title>
825                                 <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>
826                                 <para>Enter the commands and replace <emphasis>[HOSTNAME], [PORT], [USER], [PASSWORD]</emphasis> and <emphasis>[DATABASENAME]</emphasis> with appropriate values.</para>
827                                 <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>
828                                 <figure>
829                                         <title>Commands to create Evergreen database schema</title>
830                                         <screen>
831                                         $ su - root
832                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
833                                         $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
834                                                 --service all --create-schema --create-bootstrap --create-offline \
835                                                 --hostname [HOSTNAME] --port [PORT] \
836                                                 --user [USER] --password [PASSWORD] --database [DATABASENAME]
837                                         </screen>
838                                 </figure>
839                                 <note>
840                                         <para>
841                                                 <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>
842                                         </para>
843                                 </note>
844                         </section>
845                         <section>
846                                 <title>Configure the Apache Server</title>
847                                 <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>
848                                 <figure>
849                                         <title>Commands to configure the Apache server</title>
850                                         <screen>
851                                         # configure the Apache server
852                                         $ su - root
853                                         $ a2enmod ssl        # enable mod_ssl
854                                         $ a2enmod rewrite    # enable mod_rewrite
855                                         $ a2enmod expires    # enable mod_expires
856                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
857         
858                                         # copy files
859                                         $ cp Open-ILS/examples/apache/eg.conf       /etc/apache2/sites-available/
860                                         $ cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/
861                                         $ cp Open-ILS/examples/apache/startup.pl    /etc/apache2/
862                                         </screen>
863                                 </figure>
864                         </section>
865                         <section>
866                                 <title>Create a Security Certificate (SSL Key)</title>
867                                 <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>
868                                 <figure>
869                                         <title>Commands to create an SSL key</title>
870                                         <screen>
871                                         $ mkdir /etc/apache2/ssl
872                                         $ cd /etc/apache2/ssl
873                                         $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
874                                         </screen>
875                                 </figure>
876                                 <warning>
877                                         <para>
878                                                 <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>
879                                         </para>
880                                 </warning>
881                                 <para> [[ ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE ]] </para>
882                         </section>
883                         <section xml:id="serversideinstallation-modify-apache">
884                                 <title>Modify the Apache Configuration File</title>
885                                 <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>
886                                 <itemizedlist>
887                                         <listitem>
888                                                 <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>
889                                                 <para>
890                                                         <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>
891                                                 </para>
892                                                 <warning>
893                                                         <para>
894                                                                 <emphasis>You must remove these changes after testing is completed. See the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-postinstallation"> "Post-Installation Chores" </link></emphasis></emphasis> for further details on removing this change after the Evergreen installation is complete.</emphasis>
895                                                         </para>
896                                                 </warning>
897                                         </listitem>
898                                         <listitem>
899                                                 <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>
900                                                 <para> [[ ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS ]] </para>
901                                         </listitem>
902                                         <listitem>
903                                                 <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>
904                                                 <para> [[ ADD INFO ON WHETHER THIS IS STILL NECESSARY ]] </para>
905                                                 <orderedlist>
906                                                         <listitem>
907                                                                 <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>
908                                                                 <screen>www-data</screen>
909                                                                 <para>to the user:</para>
910                                                                 <screen>opensrf</screen>
911                                                         </listitem>
912                                                         <listitem>
913                                                                 <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>
914                                                                 <screen>export APACHE_RUN_USER=www-data</screen>
915                                                                 <para>to the phrase:</para>
916                                                                 <screen>export APACHE_RUN_USER=opensrf</screen>
917                                                         </listitem>
918                                                 </orderedlist>
919                                         </listitem>
920                                         <listitem>
921                                                 <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>
922                                         </listitem>
923                                 </itemizedlist>
924                         </section>
925                         <section>
926                                 <title>(OPTIONAL) Performance Modifications for Apache</title>
927                                 <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>
928                                 <itemizedlist>
929                                         <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>
930                                         <listitem>
931                                                 <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>
932                                                 <figure>
933                                                         <title>(OPTIONAL) Updates to Apache configuration</title>
934                                                         <screen>
935                                                         &lt;IfModule mpm_prefork_module>
936                                                            StartServers           20
937                                                            MinSpareServers         5
938                                                            MaxSpareServers        15
939                                                            MaxClients            150
940                                                            MaxRequestsPerChild 10000
941                                                         &lt;/IfModule>
942                                                         
943                                                         MaxKeepAliveRequests 100
944                                                         </screen>
945                                                 </figure>
946                                         </listitem>
947                                 </itemizedlist>
948                         </section>
949                         <section>
950                                 <title>Enable the Evergreen Site</title>
951                                 <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>
952                                 <figure>
953                                         <title>Apache Commands to Enable the Evergreen Web Site</title>
954                                         <screen>
955                                         $ su - root
956         
957                                         # disables the default site (i.e., the "It Works" page).
958                                         $ a2dissite default
959         
960                                         # enables the Evergreen web site
961                                         $ a2ensite eg.conf
962                                         </screen>
963                                 </figure>
964                         </section>
965                         <section>
966                                 <title>Modify the OpenSRF Configuration File</title>
967                                 <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>
968                                 <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>
969                                 <note>
970                                         <para>
971                                                 <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>
972                                         </para>
973                                 </note>
974                                 <para>[[ ADD A BETTER DIAGRAM HERE ]]</para>
975                                 <figure>
976                                         <title>Updates needed to the file "/openils/conf/opensrf_core.xml"</title>
977                                         <screen>
978                                         /config/opensrf/username  = opensrf
979         
980                                         /config/opensrf/passwd    = password for "private.localhost" opensrf user
981         
982                                         /config/gateway/username  = opensrf
983         
984                                         /config/gateway/passwd    = password for "public.localhost" opensrf user
985         
986                                         # first entry, where "transport/server" == "public.localhost" :
987                                         /config/routers/router/transport 
988                                             username = router
989                                             password = password for "public.localhost" router user
990
991                                         # second entry, where "transport/server" == "private.localhost" :
992                                         /config/routers/router/transport
993                                             username = router
994                                             password = password for "private.localhost" router user
995                                         </screen>
996                                 </figure>
997                         </section>
998                         <section>
999                                 <title>Create Configuration Files for Users Needing srfsh</title>
1000                                 <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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-testing"> "Testing the Installation" </link></emphasis></emphasis> for further information.</para>
1001                                 <para>In this step 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>
1002                                 <itemizedlist>
1003                                         <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>
1004                                         <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>
1005                                         <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
1006                                         <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
1007                                 </itemizedlist>
1008                                 <figure>
1009                                         <title>Sample of configuration file /openils/conf/srfsh.xml.example</title>
1010                                         <screen>
1011                                         &lt;?xml version="1.0"?>
1012                                         &lt;!-- This file follows the standard bootstrap config file layout -->
1013                                         &lt;!-- found in opensrf_core.xml -->
1014                                         &lt;srfsh>
1015                                         &lt;router_name>router&lt;/router_name>
1016                                         &lt;domain>private.localhost&lt;/domain>
1017                                         &lt;username>opensrf&lt;/username>
1018                                         &lt;passwd>evergreen&lt;/passwd>
1019                                         &lt;port>5222&lt;/port>
1020                                         &lt;logfile>/tmp/srfsh.log&lt;/logfile>
1021                                         &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
1022                                         &lt;loglevel>4&lt;/loglevel>
1023                                         &lt;/srfsh>
1024                                         </screen>
1025                                 </figure>
1026                         </section>
1027                         <section>
1028                                 <title>Modify the OpenSRF Environment</title>
1029                                 <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>
1030                                 <note>
1031                                         <para>
1032                                                 <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>
1033                                         </para>
1034                                 </note>
1035                                 <figure>
1036                                         <title>Modify the OpenSRF environment</title>
1037                                         <screen>
1038                                         # change permissions
1039                                         $ su - opensrf
1040                                         $ chmod 755 /openils/var/cgi-bin/*.cgi
1041         
1042                                         # add environmental variable
1043                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
1044         
1045                                         # inherit the new environment
1046                                         $ . ~/.bashrc
1047                                         </screen>
1048                                 </figure>
1049                         </section>
1050                         <section xml:id="serversideinstallation-localization">
1051                                 <title>(OPTIONAL) Configuration for Other Languages</title>
1052                                 <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>
1053                                 <para> [[ ADD SECTION ON LANGUAGE LOCALIZATION ]] </para>
1054                         </section>
1055                 </section>
1056         </section>
1057         <section xml:id="serversideinstallation-testing">
1058                 <title>Testing the Installation</title>
1059                 <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>
1060                 <section xml:id="serversideinstallation-testing-connections">
1061                         <title>Testing Connections to Evergreen</title>
1062                         <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>
1063                         <figure>
1064                                 <title>Running the srfsh utility</title>
1065                                 <screen>
1066                                 $ su - opensrf
1067                                 $ /openils/bin/srfsh
1068                                 srfsh% login admin open-ils
1069                                 Received Data: "250bf1518c7527a03249858687714376"
1070                                 ------------------------------------
1071                                 Request Completed Successfully
1072                                 Request Time in seconds: 0.045286
1073                                 ------------------------------------
1074                                 Received Data: {
1075                                    "ilsevent":0,
1076                                    "textcode":"SUCCESS",
1077                                    "desc":" ",
1078                                    "pid":21616,
1079                                    "stacktrace":"oils_auth.c:304",
1080                                    "payload":{
1081                                       "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
1082                                       "authtime":420
1083                                    }
1084                                 }
1085                                 ------------------------------------
1086                                 Request Completed Successfully
1087                                 Request Time in seconds: 1.336568
1088                                 ------------------------------------
1089                                 </screen>
1090                         </figure>
1091                         <para>If this does not work, try other simple troubleshooting steps:</para>
1092                         <itemizedlist>
1093                                 <listitem>
1094                                         <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>
1095                                         <para>[[ MAY NEED TO REWORK THIS DIAGRAM TO USE SAME IMAGE STANDARDS AS OTHER CHAPTERS ]]</para>
1096                                         <figure>
1097                                                 <title>Executing the script <emphasis> settings-test.pl</emphasis></title>
1098                                                 <mediaobject>
1099                                                         <imageobject>
1100                                                                 <imagedata fileref="../media/serversideinstallation-testing-1.png" scalefit="1" width="100%"/>
1101                                                         </imageobject>
1102                                                 </mediaobject>
1103                                                 <mediaobject>
1104                                                         <imageobject>
1105                                                                 <imagedata fileref="../media/serversideinstallation-testing-2.png" scalefit="1" width="100%"/>
1106                                                         </imageobject>
1107                                                 </mediaobject>
1108                                         </figure>
1109                                         <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, <emphasis><emphasis role="bold"><link linkend="troubleshooting"> "Troubleshooting" </link></emphasis></emphasis> .</para>
1110                                 </listitem>
1111                                 <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>
1112                         </itemizedlist>
1113                 </section>
1114                 <section xml:id="serversideinstallation-testing-opac">
1115                         <title>Testing the Catalog</title>
1116                         <para>By default, the OPAC will live at the URL <emphasis>http://my.domain.com/opac/</emphasis>.</para>
1117                         <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>
1118                         <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>
1119                         <para>[[ ADD OTHER SIMPLE FUNCTIONAL TESTS ]]</para>
1120                 </section>
1121                 <section xml:id="serversideinstallation-testing-othersrfsh">
1122                         <title>Other Tests with srfsh</title>
1123                         <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>
1124                         <screen>
1125                         srfsh# math_bench 10
1126                         |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
1127                         ++++++++++++++++++++++++++++++++++++++++
1128                         Average round trip time: 0.033425
1129                         srfsh#
1130                         </screen>
1131                         <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>
1132                         <para>For other srfsh commands, type 'help' in at the prompt.</para>
1133                 </section>
1134                 <section xml:id="serversideinstallation-starting-apache-server">
1135                         <title>Testing the Apache Web Server</title>
1136                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>
1137                         <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>
1138                         <figure>
1139                                 <title>Test the Apache Web Server</title>
1140                                 <screen>
1141                                 $ su - root
1142                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart
1143                                 </screen>
1144                         </figure>
1145                 </section>
1146         </section>
1147         <section xml:id="serversideinstallation-starting">
1148                 <title>Starting Evergreen</title>
1149                 <orderedlist>
1150                         <listitem>
1151                                 <para>As the <emphasis role="bold">root</emphasis> user, start the "ejabberd" and "memcached" services (if they aren't already running):</para>
1152                                 <figure>
1153                                         <title>Start some services</title>
1154                                         <screen>
1155                                         $ su - root
1156                                         $ /etc/init.d/ejabberd start
1157                                         $ /etc/init.d/memcached start
1158                                         </screen>
1159                                 </figure>
1160                         </listitem>
1161                         <listitem>
1162                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, start Evergreen.</para>
1163                                 <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>
1164                                 <figure>
1165                                         <title>Start Evergreen</title>
1166                                         <screen>
1167                                         $ su - opensrf
1168
1169                                         # ensure you have the needed path
1170                                         $ export PATH=$PATH:/openils/bin
1171
1172                                         # start the OpenSRF service:
1173                                         # use "-l" to force hostname to be "localhost"
1174                                         $ osrf_ctl.sh -l -a start_all     
1175                                         </screen>
1176                                 </figure>
1177                                 <note>
1178                                         <para>
1179                                                 <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>
1180                                         </para>
1181                                 </note>
1182                                 <para>[[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]]</para>
1183                                 <para>Execute the following command to determine the fully qualified domain name of your system:</para>
1184                                 <figure>
1185                                         <title>(OPTIONAL) Determine the fully qualified domain name</title>
1186                                         <screen>
1187                                         $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
1188                                         </screen>
1189                                 </figure>
1190                                 <itemizedlist>
1191                                         <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>
1192                                         <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>
1193                                 </itemizedlist>
1194                         </listitem>
1195                         <listitem>
1196                                 <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>
1197                                 <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>
1198                                 <figure>
1199                                         <title>Generate web files</title>
1200                                         <screen>
1201                                         $ su - opensrf
1202                                         $ cd /openils/bin
1203                                         $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u
1204                                         Updating Evergreen organization tree and IDL \
1205                                                 using '/openils/conf/opensrf_core.xml'
1206
1207                                         Updating fieldmapper
1208                                         Exception: OpenSRF::EX::Session 2010-04-16T06:31:38 \
1209                                                 OpenSRF::Utils::SettingsClient \
1210                                                 /usr/local/share/perl/5.10.0/OpenSRF/Utils/SettingsClient.pm:103 \
1211                                                 Session Error: router@private.localhost/opensrf.settings \
1212                                                 IS NOT CONNECTED TO THE NETWORK!!!
1213                                         </screen>
1214                                         <para>[[ ADD RESULTS OF TESTS FROM "autogen.sh" ]]</para>
1215                                 </figure>
1216                         </listitem>
1217                         <listitem>
1218                                 <para>As the <emphasis role="bold">root</emphasis> user, restart the Apache Web server:</para>
1219                                 <figure>
1220                                         <title>Restart the Apache web server</title>
1221                                         <screen>
1222                                         $ su - root
1223                                         $ /etc/init.d/apache2 restart
1224                                         </screen>
1225                                 </figure>
1226                                 <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>
1227                         </listitem>
1228                 </orderedlist>
1229         </section>
1230         <section xml:id="serversideinstallation-stopping">
1231                 <title>Stopping Evergreen</title>
1232                 <para>As the <emphasis role="bold">opensrf</emphasis> user, stop all Evergreen services by using the following command:</para>
1233                 <figure>
1234                         <title>Stop all Evergreen services</title>
1235                         <screen>
1236                         $ su - opensrf
1237
1238                         # stop the server:
1239                         # use "-l" to force hostname to be "localhost"
1240                         $ osrf_ctl.sh -l -a stop_all
1241                         </screen>
1242                 </figure>
1243                 <note>
1244                         <para>
1245                                 <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>
1246                         </para>
1247                 </note>
1248                 <para>[[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]]</para>
1249         </section>
1250         <section xml:id="serversideinstallation-postinstallation">
1251                 <title>Post-Installation Chores</title>
1252                 <section>
1253                         <title>Remove temporary changes from Apache configuration file</title>
1254                         <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>
1255                         <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 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-modify-apache"> "Modify the Apache Configuration File" </link></emphasis></emphasis> 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>
1256                 </section>
1257                 <section>
1258                         <title>Configure a permanent SSL key</title>
1259                         <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>
1260                         <warning>
1261                                 <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: <emphasis><emphasis role="bold"><link linkend="serversideinstallation-ssl"> "Getting a Signed SSL Security Certificate" </link></emphasis></emphasis> </emphasis>.</para>
1262                         </warning>
1263                 </section>
1264                 <section>
1265                         <title>Set Up Support For Reports</title>
1266                         <para>Evergreen reports are extremely powerful, but some configuration is required. See the section <emphasis><emphasis role="bold"><link linkend="report-introduction"> "Reports" </link></emphasis></emphasis> for details.</para>
1267                         <section>
1268                                 <title>Starting the Reporter Daemon</title>
1269                                 <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>
1270                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, start the reporter daemon using the following command:</para>
1271                                 <figure>
1272                                         <title>Starting the Reporter Daemon</title>
1273                                         <screen>
1274                                         $ su - opensrf
1275                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/src/reporter
1276                                         $ ./clark-kent.pl --daemon
1277                                         </screen>
1278                                 </figure>
1279                                 <para>You can also specify other options with this utility:</para>
1280                                 <itemizedlist>
1281                                         <listitem>--sleep=interval      : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>
1282                                         <listitem>--lockfile=filename   : where to place the lockfile for the process; defaults to <emphasis>/tmp/reporter-LOCK</emphasis></listitem>
1283                                         <listitem>--concurrency=integer : number of reporter daemon processes to run; defaults to "1"</listitem>
1284                                         <listitem>--boostrap=filename   : OpenSRF bootstrap configuration file; defaults to <emphasis>/openils/conf/opensrf_core.xml</emphasis></listitem>
1285                                 </itemizedlist>
1286                         </section>
1287                         <section>
1288                                 <title>Stopping the Reporter Daemon</title>
1289                                 <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>
1290                                 <note>
1291                                         <para>
1292                                                 <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>
1293                                         </para>
1294                                 </note>
1295                                 <figure>
1296                                         <title>Stopping the Reporter Daemon</title>
1297                                         <screen>
1298                                         $ su - opensrf
1299                                         # find and kill the process ID number(s)
1300                                         $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
1301                                         # remove the lock file
1302                                         $ rm /tmp/reporter-LOCK
1303                                         </screen>
1304                                 </figure>
1305                         </section>
1306                 </section>
1307         </section>
1308         <section xml:id="serversideinstallation-staffclient">
1309                 <title>Running the Evergreen Staff Client</title>
1310                 <para>[[ ADD CONTENT: LINUX VS WINDOWS STAFF CLIENT ]]</para>
1311                 <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>
1312                 <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>
1313                 <figure>
1314                         <title>Running the Linux Staff Client</title>
1315                         <screen>
1316                         $ su - opensrf
1317                         $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
1318                         </screen>
1319                 </figure>
1320         </section>
1321         <section xml:id="serversideinstallation-otherlinux">
1322                 <title>Installing Evergreen On Other Linux Systems</title>
1323                 <para>[[ ADD CONTENT FOR INSTALLING ON OTHER LINUX SYSTEMS ]]</para>
1324         </section>
1325         <section xml:id="serversideinstallation-virtual">
1326                 <title>Installing Evergreen in Virtualized Unix Environments</title>
1327                 <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>
1328                 <para>[[ ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS ]]</para>
1329                 <section xml:id="serversideinstallation-virtualized-virtualbox">
1330                         <title>VirtualBox</title>
1331                         <para>[[ ADD CONTENT FOR VirtualBox ]]</para>
1332                 </section>
1333                 <section xml:id="serversideinstallation-virtualized-vmware">
1334                         <title>VMware</title>
1335                         <para>[[ ADD CONTENT FOR VMware ]]</para>
1336                 </section>
1337                 <section xml:id="serversideinstallation-virtualized-virtualpc">
1338                         <title>VirtualPC</title>
1339                         <para>[[ ADD CONTENT FOR VirtualPC ]]</para>
1340                 </section>
1341         </section>
1342         <section xml:id="serversideinstallation-previousversions">
1343                 <title>Installing Previous Versions of Evergreen</title>
1344                 <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>
1345                 <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>
1346                 <section xml:id="serversideinstallation-ubuntudebian-previous">
1347                         <title>Installing Evergreen 1.4.0.6 on Ubuntu or Debian</title>
1348                         <para>[[ ADD CONTENT FOR INSTALLING EVERGREEN 1.4.0.6 ON UBUNTU OR DEBIAN ]]</para>
1349                 </section>
1350                 <section xml:id="serversideinstallation-opensrf-previous">
1351                         <title>Installing OpenSRF 1.0.x</title>
1352                         <para>[[ ADD CONTENT FOR INSTALLING OPENSRF 1.0.x ]]</para>
1353                 </section>
1354         </section>
1355         <section xml:id="serversideinstallation-postgresql">
1356                 <title>Installing PostgreSQL</title>
1357                 <para>[[ ADD CONTENT FOR POSTGRESQL ]] </para>
1358         </section>
1359         <section xml:id="serversideinstallation-apache">
1360                 <title>Apache</title>
1361                 <section>
1362                         <title>Securing Apache (httpd)</title>
1363                         <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>
1364                         <para>[[ ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD ]]</para>
1365                         <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>
1366                 </section>
1367                 <para>[[ ADD MORE CONTENT FOR APACHE ]] </para>
1368         </section>
1369         <section xml:id="serversideinstallation-memcached">
1370                 <title>memcached Servers</title>
1371                 <para>[[ ADD CONTENT FOR MEMCACHED ]] </para>
1372         </section>
1373         <section xml:id="serversideinstallation-organizationandpolicy">
1374                 <title>Organization and Policy Editing</title>
1375                 <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 <emphasis><emphasis role="bold"><link linkend="serveradministration-orgunits"> "Organizational Unit Types and Organizational Units" </link></emphasis></emphasis> for further information. Examples of what can be configured include:</para>
1376                 <itemizedlist>
1377                         <listitem>Adding a branch library</listitem>
1378                         <listitem>Changing circulation rules for an existing library</listitem>
1379                         <listitem>Adding a new staff position or user group</listitem>
1380                 </itemizedlist>
1381                 <para>[[ ADD CONTENT FOR ORGANIZATION AND POLICY EDITING ]] </para>
1382         </section>
1383         <section xml:id="serversideinstallation-sip">
1384                 <title>Installing the SIP Server</title>
1385                 <para>[[ ADD CONTENT FOR INSTALLING THE SIP SERVER ]]</para>
1386         </section>
1387         <section xml:id="serversideinstallation-nginx">
1388                 <title>Using nginx to serve static content</title>
1389                 <para>[[ ADD CONTENT FOR USING NGINX TO SERVE STATIC CONTENT ]]</para>
1390         </section>
1391         <section xml:id="serversideinstallation-ssl">
1392                 <title>Getting a Signed SSL Security Certificate</title>
1393                 <para>[[ ADD EXPLANATION OF HOW TO GET A SIGNED SSL CERTIFICATE ]] </para>
1394         </section>
1395 </chapter>