]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/serversideinstallation.xml
updates to ServersideInstallation and StaffclientInstallation to bring into line...
[working/Evergreen.git] / 1.6 / admin / serversideinstallation.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter version="5.0" xml:id="serversideinstallation" xml:lang="EN" 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.
7                         Installation, configuration, testing and verification 
8                         of the software is straightforward if you follow some simple directions.</para>
9                 </abstract>
10         </info>
11         <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current
12         stable software release. See <xref linkend="serversideinstallation-all"/> for instructions tailored to
13         installing on some particular distributions of the <systemitem class="osname">Linux</systemitem> operating
14         system.</para>
15         <para>The current version of the Evergreen server-side software runs as a native application on any of several
16         well-known <systemitem class="osname">Linux</systemitem> distributions 
17         (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). 
18         It does not currently run as a native application on the <systemitem class="osname">Microsoft Windows</systemitem> 
19         operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP
20         Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can still be
21         installed and run on <systemitem class="osname">Windows</systemitem> via a so-called
22         <emphasis>virtualized</emphasis> Linux-guest Operating System (using, for example,
23         <application>"VirtualBox"</application>, or <application>"VMware"</application>, or
24         <application>"VirtualPC"</application> to emulate a <systemitem class="osname">Linux</systemitem>
25         environment). It can also be installed to run on other <systemitem class="osname">Linux</systemitem> 
26         systems via virtualized environments (using, for example, <application>"VirtualBox"</application> or
27         <application>"VMware"</application>). More information on virtualized environments can be found in 
28         <xref linkend="serversideinstallation-virtual"/>.</para>
29         <para>Installation of the Evergreen Staff Client software is reviewed in <xref linkend="staffclientinstallation"/>. </para>
30         <para>The Evergreen server-side software has dependencies on particular versions of certain major software
31         sub-components. Successful installation of Evergreen software requires that software versions agree with those
32         listed here:</para>
33         <table xml:id="serversideinstall-software-dependencies">
34                 <?dbfo keep-together="always" ?>
35                 <title>Evergreen Software Dependencies</title>
36                 <indexterm>
37                         <primary>Evergreen software dependencies</primary>
38                 </indexterm>
39                 <tgroup align="left" cols="3" colsep="1" rowsep="1">
40                         <colspec colname="Evergreen" colnum="1" colwidth="1.0*"/>
41                         <colspec colname="OpenSRF" colnum="2" colwidth="1.0*"/>
42                         <colspec colname="PostgreSQL" colnum="3" colwidth="1.0*"/>
43                         <thead>
44                                 <row>
45                                         <entry>Evergreen</entry>
46                                         <entry>OpenSRF</entry>
47                                         <entry>PostgreSQL</entry>
48                                 </row>
49                         </thead>
50                         <tbody>
51                                 <row>
52                                         <entry>1.6.1.x</entry>
53                                         <entry>1.4.0</entry>
54                                         <entry>8.2 / 8.3</entry>
55                                 </row>
56                                 <row>
57                                         <entry>1.6.0.x</entry>
58                                         <entry>1.2</entry>
59                                         <entry>8.2 / 8.3</entry>
60                                 </row>
61                                 <row>
62                                         <entry>1.4.x</entry>
63                                         <entry>1.0</entry>
64                                         <entry>8.1 / 8.2</entry>
65                                 </row>
66                                 <row>
67                                         <entry>1.2.x</entry>
68                                         <entry>0.9</entry>
69                                         <entry>8.1 / 8.2</entry>
70                                 </row>
71                         </tbody>
72                 </tgroup>
73         </table>
74         <section xml:id="serversideinstallation-all">
75                 <title>Installing Server-Side Software</title>
76                 <para>This section describes the installation of the major components of Evergreen server-side software.</para>
77                 <para>As far as possible, you should perform the following steps in the exact order given since the
78                 success of many steps relies on the successful completion of earlier steps. You should make backup
79                 copies of files and environments when you are instructed to do so. In the event of installation problems
80                 those copies can allow you to back out of a step gracefully and resume the installation from a known
81                 state. See <xref linkend="backingup"/> for further information.</para>
82                 <para>Of course, after you successfully complete and test the entire Evergreen installation you should
83                 take a final snapshot backup of your system(s). This can be the first in the series of regularly
84                 scheduled system backups that you should probably also begin.</para>
85                 <section xml:id="serversideinstallation-opensrf">
86                         <indexterm>
87                                 <primary>OpenSRF</primary>
88                                 <secondary>installation</secondary>
89                         </indexterm>
90                         <title>Installing OpenSRF 1.4.x On <systemitem class="osname">Ubuntu</systemitem> or
91                                 <systemitem class="osname">Debian</systemitem></title>
92                         <indexterm>
93                                 <primary>Linux</primary>
94                                 <secondary>Debian</secondary>
95                         </indexterm>
96                         <indexterm>
97                                 <primary>Linux</primary>
98                                 <secondary>Ubuntu</secondary>
99                         </indexterm>
100                         <para>This section describes the installation of the latest version of the Open Service Request
101                         Framework (OpenSRF), a major component of the Evergreen server-side software, on 
102                         <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem>
103                         systems. Evergreen software is integrated with and depends on the OpenSRF software
104                         system.</para>
105                         <para>Follow the steps outlined here and run the specified tests to ensure that OpenSRF is
106                         properly installed and configured. Do <emphasis><emphasis role="bold">not</emphasis></emphasis>
107                         continue with any further Evergreen installation steps
108                         until you have verified that OpenSRF has been successfully installed and tested.</para>
109                         <note>
110                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit)
111                                 platforms. OpenSRF 1.4.0 has been tested on <systemitem class="osname">Debian Etch
112                                 (4.0)</systemitem>, <systemitem class="osname">Debian Lenny (5.0)</systemitem> and
113                                 <systemitem class="osname">Ubuntu Lucid Lynx (10.04)</systemitem>.</para>
114                                 <para>In the following instructions, you are asked to perform certain steps as 
115                                 either the <systemitem class="username">root</systemitem> user, the 
116                                 <systemitem class="username">opensrf</systemitem> user, or the 
117                                 <systemitem class="username">postgres</systemitem> user.</para>
118                                 <itemizedlist>
119                                         <listitem>
120                                                 <para><systemitem class="osname">Debian</systemitem> -- To become the
121                                                 <systemitem class="username">root</systemitem> user, issue the command
122                                                 <command>su -</command> and enter the password of the
123                                                 <systemitem class="username">root</systemitem> user.</para>
124                                         </listitem>
125                                         <listitem>
126                                                 <para><systemitem class="osname">Ubuntu</systemitem> -- To become the
127                                                 <systemitem class="username">root</systemitem> user, issue the command
128                                                 <command>sudo su -</command> and enter the password of the 
129                                                 <systemitem class="username">root</systemitem> user.</para>
130                                         </listitem>
131                                 </itemizedlist>
132                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a
133                                 different user, issue the command <command>su - USERNAME</command>. For example, to
134                                 switch from the <systemitem class="username">root</systemitem> user to the 
135                                 <systemitem class="username">opensrf</systemitem> user, issue the command 
136                                 <command>su - opensrf</command>. Once you have become a non-root user, to become 
137                                 the <systemitem class="username">root</systemitem> user again, simply issue the command
138                                 <command>exit</command>.</para>
139                         </note>
140                         <procedure>
141                                 <step>
142                                         <title>Add New <systemitem class="username">opensrf</systemitem> User</title>
143                                         <para>As the <systemitem class="username">root</systemitem> user, add the
144                                         <systemitem class="username">opensrf</systemitem> user to the system.
145                                         In the following example, the default shell for the 
146                                         <systemitem class="username">opensrf</systemitem> user is automatically set
147                                         to <command>/bin/bash</command> to inherit a reasonable environment:</para>
148 <screen>
149         <userinput>
150         # as the root user:
151         useradd -m -s /bin/bash opensrf
152         passwd opensrf</userinput>
153 </screen>
154                                 </step>
155                                 <step>
156                                         <title>Download and Unpack Latest OpenSRF Version</title>
157                                         <indexterm>
158                                                 <primary>OpenSRF</primary>
159                                                 <secondary>download</secondary>
160                                         </indexterm>
161                                         <para>The latest version of OpenSRF can be found here:
162                                         <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.4.0.tar.gz"></ulink> .
163                                         As the <systemitem class="username">opensrf</systemitem> user, change to
164                                         the directory <filename class="directory">/home/opensrf</filename> then download
165                                         and extract OpenSRF. The new subdirectory
166                                         <filename class="directory">/home/opensrf/OpenSRF-1.4.0</filename> will be created:</para>
167 <screen>
168         <userinput>
169         # as the opensrf user:
170         cd /home/opensrf
171         wget http://evergreen-ils.org/downloads/OpenSRF-1.4.0.tar.gz
172         tar zxf OpenSRF-1.4.0.tar.gz</userinput>
173 </screen>
174                                 </step>
175                                 <step>
176                                         <title>Install Prerequisites to Build OpenSRF</title>
177                                         <para>In this section you will install and configure a set of prerequisites that will be
178                                         used to build OpenSRF. In a following step you will actually build the OpenSRF software 
179                                         using the <command>make</command> utility.</para>
180                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show
181                                         below to build the prerequisites from the software distribution that you just downloaded
182                                         and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the following
183                                         example with the keyword corresponding to the name of one of the
184                                         <systemitem class="osname">Linux</systemitem> distributions listed in the following
185                                         distribution keywords table <xref linkend="serversideinstallation-keywords-opensrf"/> . 
186                                         For example, to install the prerequisites for Ubuntu version 10.04 (Lucid Lynx) you would
187                                         enter this command: <command>make -f src/extras/Makefile.install ubuntu-lucid</command> .</para>
188 <screen>
189         <userinput>
190         # as the root user:
191         cd /home/opensrf/OpenSRF-1.4.0
192         make -f src/extras/Makefile.install [DISTRIBUTION]</userinput>
193 </screen>
194                                         <table xml:id="serversideinstallation-keywords-opensrf">
195                                                 <?dbfo keep-together="always" ?>
196                                                 <title>Keyword Targets for OpenSRF <application>"make"</application> Command</title>
197                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
198                                                         <colspec colname="keyword" colnum="1" colwidth="1.0*"/>
199                                                         <colspec colname="linux_version" colnum="2" colwidth="3.0*"/>
200                                                         <thead>
201                                                                 <row>
202                                                                         <entry>Keyword</entry>
203                                                                         <entry>Linux Version</entry>
204                                                                 </row>
205                                                         </thead>
206                                                         <tbody>
207                                                                 <row>
208                                                                         <entry>debian-etch</entry>
209                                                                         <entry>Debian "Etch" (4.0)</entry>
210                                                                 </row>
211                                                                 <row>
212                                                                         <entry>debian-lenny</entry>
213                                                                         <entry>Debian "Lenny" (5.0)</entry>
214                                                                 </row>
215                                                                 <row>
216                                                                         <entry>ubuntu-hardy</entry>
217                                                                         <entry>Ubuntu "Hardy Heron" (8.04)</entry>
218                                                                 </row>
219                                                                 <row>
220                                                                         <entry>ubuntu-karmic</entry>
221                                                                         <entry>Ubuntu "Karmic Koala" (9.10)</entry>
222                                                                 </row>
223                                                                 <row>
224                                                                         <entry>ubuntu-lucid</entry>
225                                                                         <entry>Ubuntu "Lucid Lynx" (10.04)</entry>
226                                                                 </row>
227                                                                 <row>
228                                                                         <entry>fedora13</entry>
229                                                                         <entry>Fedora "Goddard" (13)</entry>
230                                                                 </row>
231                                                                 <row>
232                                                                         <entry>centos</entry>
233                                                                         <entry>Centos</entry>
234                                                                 </row>
235                                                                 <row>
236                                                                         <entry>rhel</entry>
237                                                                         <entry>RHEL</entry>
238                                                                 </row>
239                                                                 <row>
240                                                                         <entry>gentoo</entry>
241                                                                         <entry>Gentoo</entry>
242                                                                 </row>
243                                                         </tbody>
244                                                 </tgroup>
245                                         </table>
246                                         <para>This will install a number of packages on the system that are required by OpenSRF,
247                                         including some Perl modules from CPAN. You can say <literal>No</literal> to the initial
248                                         CPAN configuration prompt to allow it to automatically configure itself to download and
249                                         install Perl modules from CPAN. The CPAN installer will ask you a number of times whether
250                                         it should install prerequisite modules - say <literal>Yes</literal>.</para>
251                                 </step>
252                                 <step>
253                                         <title>Build OpenSRF</title>
254                                         <para>In this section you will configure, build and install the OpenSRF
255                                         components that support other Evergreen services.</para>
256                                         <substeps>
257                                                 <step>
258                                                         <title>Configure OpenSRF</title>
259                                                         <indexterm>
260                                                                 <primary>OpenSRF</primary>
261                                                                 <secondary>configure</secondary>
262                                                         </indexterm>
263                                                         <para>As the <systemitem class="username">opensrf</systemitem>
264                                                         user, return to the new OpenSRF build directory and use the
265                                                         <command>configure</command> utility to prepare for the next
266                                                         step of compiling and linking the software. If you wish to
267                                                         include support for Python and Java, add the configuration
268                                                         options <option>--enable-python</option> and
269                                                         <option>--enable-java</option>, respectively:</para>
270 <screen>
271         <userinput>
272         # as the opensrf user:
273         cd /home/opensrf/OpenSRF-1.4.0
274         ./configure --prefix=/openils --sysconfdir=/openils/conf
275         make</userinput>
276 </screen>
277                                                         <para>This step will take several minutes to complete.</para>
278                                                 </step>
279                                                 <step>
280                                                         <title>Compile, Link and Install OpenSRF</title>
281                                                         <para>As the <systemitem class="username">root</systemitem>
282                                                         user, return to the new OpenSRF build directory and use the
283                                                         <command>make</command> utility to compile, link and install
284                                                         OpenSRF:</para>
285 <screen>
286         <userinput>
287         # as the root user:
288         cd /home/opensrf/OpenSRF-1.4.0
289         make install</userinput>
290 </screen>
291                                                         <para>This step will take several minutes to complete.</para>
292                                                 </step>
293                                                 <step>
294                                                         <title>Update the System Dynamic Library Path</title>
295                                                         <para>You must update the system dynamic library path to force
296                                                         your system to recognize the newly installed libraries. As the
297                                                         <systemitem class="username">root</systemitem> user, do this by
298                                                         creating the new file
299                                                         <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a
300                                                         new library path, then run the command
301                                                         <command>ldconfig</command> to automatically read the file and
302                                                         modify the system dynamic library path:</para>
303 <screen>
304         <userinput>
305         # as the root user:
306         echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf
307         ldconfig</userinput>
308 </screen>
309                                                 </step>
310                                                 <step xml:id="serversideinstallation-definedomains">
311                                                         <title>Define Public and Private OpenSRF Domains</title>
312                                                         <para>For security purposes, OpenSRF uses Jabber domains to separate services
313                                                         into public and private realms. On a single-server system the easiest way to
314                                                         define public and private OpenSRF domains is to define separate host names by 
315                                                         adding entries to the file <filename>/etc/hosts</filename>.</para>
316                                                         <para>In the following steps we will use the example domains
317                                                         <systemitem class="domainname">public.localhost</systemitem> for the public
318                                                         domain and <systemitem class="domainname">private.localhost</systemitem> 
319                                                         for the private domain. In an upcoming step, you will configure two special
320                                                         <systemitem class="service">ejabberd</systemitem> users
321                                                         to handle communications for these two domains.</para>
322                                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file
323                                                         <filename>/etc/hosts</filename> and add the following example domains:</para>
324                                                         <indexterm>
325                                                                 <primary>Jabber</primary>
326                                                         </indexterm>
327 <screen>
328         <userinput>
329         # as the root user:
330         127.0.1.2  public.localhost   public
331         127.0.1.3  private.localhost  private</userinput>
332 </screen>
333                                                 </step>
334                                                 <step>
335                                                         <title>Change File Ownerships</title>
336                                                         <para>Finally, as the <systemitem class="username">root</systemitem>
337                                                         user, change the ownership of all files installed in the
338                                                         directory <filename class="directory">/openils</filename> to the
339                                                         user <systemitem class="username">opensrf</systemitem>:</para>
340 <screen>
341         <userinput>
342         # as the root user:
343         chown -R opensrf:opensrf /openils</userinput>
344 </screen>
345                                                 </step>
346                                         </substeps>
347                                 </step>
348                                 <step xml:id="stop-ejabberd-service">
349                                         <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>
350                                         <indexterm>
351                                                 <primary>ejabberd</primary>
352                                         </indexterm>
353                                         <para>Before continuing with configuration of <systemitem class="service">ejabberd</systemitem>
354                                         you must stop that service. As the <systemitem class="username">root</systemitem> user,
355                                         execute the following command to stop the service:</para>
356 <screen>
357         <userinput>
358         # as the root user:
359         /etc/init.d/ejabberd stop</userinput>
360 </screen>
361                                         <para>If <systemitem class="service">ejabberd</systemitem> reports that it 
362                                         is already stopped, there may have been a problem when it started back
363                                         in the installation step. If there are any remaining daemon processes such as
364                                         <systemitem class="daemon">beam</systemitem> or
365                                         <systemitem class="daemon">epmd</systemitem> 
366                                         you may need to perform the following commands to kill them:</para>
367 <screen>
368         <userinput>
369         # as the root user:
370         epmd -kill
371         killall beam; killall beam.smp
372         rm /var/lib/ejabberd/*
373         echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd</userinput>
374 </screen>
375                                 </step>
376                                 <step>
377                                         <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>
378                                         <para>You must make several configuration changes for the
379                                         <systemitem class="service">ejabberd</systemitem> service before
380                                         it is started again.
381                                         As the <systemitem class="username">root</systemitem> user, edit the file
382                                         <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>
383                                         <substeps>
384                                                 <step>
385                                                         <para>Change the line:</para>
386                                                         <literal>{hosts, ["localhost"]}.</literal>
387                                                         <para>to instead read:</para>
388                                                         <literal>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</literal>
389                                                         <para/>
390                                                 </step>
391                                                 <step>
392                                                         <para>Change the line:</para>
393                                                         <literal>{max_user_sessions, 10}</literal>
394                                                         <para>to instead read:</para>
395                                                         <literal>{max_user_sessions, 10000}</literal>
396                                                         <para/>
397                                                         <para>If the line looks something like this:</para>
398                                                         <literal>{access, max_user_sessions, [{10, all}]}</literal>
399                                                         <para>then change it to instead read:</para>
400                                                         <literal>{access, max_user_sessions, [{10000, all}]}</literal>
401                                                 </step>
402                                                 <step>
403                                                         <para>Change all three occurrences of:</para>
404                                                         <literal>max_stanza_size</literal>
405                                                         <para>to instead read:</para>
406                                                         <literal>2000000</literal>
407                                                 </step>
408                                                 <step>
409                                                         <para>Change both occurrences of:</para>
410                                                         <literal>maxrate</literal>
411                                                         <para>to instead read:</para>
412                                                         <literal>500000</literal>
413                                                 </step>
414                                                 <step>
415                                                         <para>Comment out the line:</para>
416                                                         <literal>{mod_offline, []}</literal>
417                                                         <para>by placing two <literal>%</literal> comment signs in front
418                                                         so it instead reads:</para>
419                                                         <literal>%%{mod_offline, []}</literal>
420                                                 </step>
421                                         </substeps>
422                                 </step>
423                                 <step xml:id="serversideinstallation-opensrf-continued">
424                                         <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>
425                                         <para>As the <systemitem class="username">root</systemitem> user, restart the
426                                         <systemitem class="service">ejabberd</systemitem> service to test the
427                                         configuration changes and to register your users:</para>
428 <screen>
429         <userinput>
430         # as the root user:
431         /etc/init.d/ejabberd start</userinput>
432 </screen>
433                                 </step>
434                                 <step>
435                                         <title>Register <systemitem class="username">router</systemitem> and
436                                                 <systemitem class="username">opensrf</systemitem> as
437                                                 <systemitem class="service">ejabberd</systemitem> users</title>
438                                         <para>The two <systemitem class="service">ejabberd</systemitem> users 
439                                         <systemitem class="username">router</systemitem> and 
440                                         <systemitem class="username">opensrf</systemitem> must be registered 
441                                         and configured to manage OpenSRF router service and communications 
442                                         for the two domains <literal>public.localhost</literal> and
443                                         <literal>private.localhost</literal> that you added to the file
444                                         <filename>/etc/hosts</filename> in a previous step
445                                         (see <xref linkend="serversideinstallation-definedomains"/>).
446                                         The users include:</para>
447                                         <itemizedlist>
448                                                 <listitem>
449                                                         <para>the <systemitem class="username">router</systemitem> user,
450                                                         to whom all requests to connect to an OpenSRF service will be
451                                                         routed;</para>
452                                                 </listitem>
453                                                 <listitem>
454                                                         <para>the <systemitem class="username">opensrf</systemitem> user,
455                                                         which clients use to connect to OpenSRF services (you may name
456                                                         the user anything you like, but we use
457                                                         <literal>opensrf</literal> in these examples)</para>
458                                                 </listitem>
459                                         </itemizedlist>
460                                         <para>As the <systemitem class="username">root</systemitem> user, execute the
461                                         <command>ejabberdctl</command> utility as shown below to register and create passwords
462                                         for the users <systemitem class="username">router</systemitem> and
463                                         <systemitem class="username">opensrf</systemitem> on each domain (remember to replace
464                                         <emphasis>NEWPASSWORD</emphasis> with the appropriate password):</para>
465 <screen>
466         <userinput>
467         # as the root user:
468         # Note: the syntax for registering a user with ejabberdctl is:
469         #    ejabberdctl register USER DOMAIN PASSWORD
470         ejabberdctl register router  private.localhost NEWPASSWORD
471         ejabberdctl register router  public.localhost  NEWPASSWORD
472         ejabberdctl register opensrf private.localhost NEWPASSWORD
473         ejabberdctl register opensrf public.localhost  NEWPASSWORD</userinput>
474 </screen>
475                                         <para>Note that the users <systemitem class="username">router</systemitem> and
476                                         <systemitem class="username">opensrf</systemitem> and their respective passwords 
477                                         will be used again in <xref linkend="serversideinstallation-passwords"/> when
478                                         we modify the OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename> .</para>
479                                 </step>
480                                 <step xml:id="serversideinstallation-opensrf-createconfig">
481                                         <title>Create OpenSRF configuration files</title>
482                                         <para>As the <systemitem class="username">opensrf</systemitem> user, 
483                                         execute the following commands to create the new configuration files
484                                         <filename>/openils/conf/opensrf_core.xml</filename> and
485                                         <filename>/openils/conf/opensrf.xml</filename> from the example templates:</para>
486 <screen>
487         <userinput>
488         # as the opensrf user:
489         cd /openils/conf
490         cp opensrf.xml.example      opensrf.xml
491         cp opensrf_core.xml.example opensrf_core.xml</userinput>
492 </screen>
493                                 </step>
494                                 <step xml:id="serversideinstallation-passwords">
495                                         <title>Update usernames and passwords in the OpenSRF configuration file</title>
496                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
497                                         OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>
498                                         and update the usernames and passwords to match the values shown in the
499                                         following table. The left-hand side of <xref linkend="serversideinstallation-xpath-table-1"/>
500                                         shows common XPath syntax to indicate the approximate position within the XML
501                                         file that needs changes. The right-hand side of the table shows the replacement
502                                         values:</para>
503                                         <table xml:id="serversideinstallation-xpath-table-1">
504                                                 <?dbfo keep-together="always" ?>
505                                                 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>
506                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
507                                                         <colspec colname="Xpath" colnum="1" colwidth="1.6*"/>
508                                                         <colspec colname="Value" colnum="2" colwidth="2.0*"/>
509                                                         <thead>
510                                                                 <row>
511                                                                         <entry>XPath location</entry>
512                                                                         <entry>Value</entry>
513                                                                 </row>
514                                                         </thead>
515                                                         <tbody>
516                                                                 <row>
517                                                                         <entry>/config/opensrf/username</entry>
518                                                                         <entry>
519                                                                                 <systemitem class="username">opensrf</systemitem>
520                                                                         </entry>
521                                                                 </row>
522                                                                 <row>
523                                                                         <entry>/config/opensrf/passwd </entry>
524                                                                         <entry><systemitem class="domainname">private.localhost</systemitem>
525                                                                         password for
526                                                                         <systemitem class="username">opensrf</systemitem> user
527                                                                         </entry>
528                                                                 </row>
529                                                                 <row>
530                                                                         <entry>/config/gateway/username</entry>
531                                                                         <entry>
532                                                                                 <systemitem class="username">opensrf</systemitem>
533                                                                         </entry>
534                                                                 </row>
535                                                                 <row>
536                                                                         <entry>/config/gateway/passwd</entry>
537                                                                         <entry><systemitem class="domainname">public.localhost</systemitem>
538                                                                         password for
539                                                                         <systemitem class="username">opensrf</systemitem> user
540                                                                         </entry>
541                                                                 </row>
542                                                                 <row>
543                                                                         <entry>/config/routers/router/transport/username, 
544                                                                         first entry where server == public.localhost</entry>
545                                                                         <entry>
546                                                                                 <systemitem class="username">router</systemitem>
547                                                                         </entry>
548                                                                 </row>
549                                                                 <row>
550                                                                         <entry>/config/routers/router/transport/password,
551                                                                         first entry where server == public.localhost</entry>
552                                                                         <entry><systemitem class="domainname">public.localhost</systemitem>
553                                                                         password for
554                                                                         <systemitem class="username">router</systemitem> user
555                                                                         </entry>
556                                                                 </row>
557                                                                 <row>
558                                                                         <entry>/config/routers/router/transport/username,
559                                                                         second entry where server == private.localhost</entry>
560                                                                         <entry>
561                                                                                 <systemitem class="username">router</systemitem>
562                                                                         </entry>
563                                                                 </row>
564                                                                 <row>
565                                                                         <entry>/config/routers/router/transport/password,
566                                                                         second entry where server == private.localhost</entry>
567                                                                         <entry><systemitem class="domainname">private.localhost</systemitem>
568                                                                         password for
569                                                                         <systemitem class="username">router</systemitem> user
570                                                                         </entry>
571                                                                 </row>
572                                                         </tbody>
573                                                 </tgroup>
574                                         </table>
575                                         <para>You may also need to modify the file to specify the domains from which 
576                                         <systemitem class="service">OpenSRF</systemitem> will accept connections,
577                                         and to which it will make connections.
578                                         If you are installing <application>OpenSRF</application> on a single server
579                                         and using the <systemitem class="domainname">private.localhost</systemitem> and
580                                         <systemitem class="domainname">public.localhost</systemitem> domains, 
581                                         these will already be set to the correct values. Otherwise, search and replace
582                                         to match values for your own systems.</para>
583                                 </step>
584                                 <step>
585                                         <title>Set location of the persistent database</title>
586                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
587                                         file <filename>/openils/conf/opensrf.xml</filename>, then find and modify the 
588                                         element <literal>dbfile</literal> (near the end of the file) to set the 
589                                         location of the persistent database. Change the default line:</para>
590                                         <literal>/openils/var/persist.db</literal>
591                                         <para>to instead read:</para>
592                                         <literal>/tmp/persist.db</literal>
593                                         <para>Following is a sample modification of that portion of the file:</para>
594 <programlisting language="xml"><![CDATA[
595 <!-- Example of an app-specific setting override -->
596 <opensrf.persist>
597   <app_settings>
598     <dbfile>/tmp/persist.db</dbfile>
599   </app_settings>
600 </opensrf.persist>
601 ]]></programlisting>
602                                 </step>
603                                 <step xml:id="serversideinstallation-srfsh">
604                                         <title>Create configuration files for users needing <command>srfsh</command></title>
605                                         <para>In this section you will set up a special configuration file for each user
606                                         who will need to run the <command>srfsh</command> (pronounced <emphasis>surf
607                                         shell</emphasis>) utility.</para>
608                                         <indexterm>
609                                                 <primary>srfsh</primary>
610                                         </indexterm>
611                                         <para>The software installation will automatically create the utility
612                                         <command>srfsh</command> (surf shell), a command line diagnostic tool for
613                                         testing and interacting with <application>OpenSRF</application>. It will be used
614                                         in a future step to complete and test the Evergreen installation. See 
615                                         <xref linkend="serversideinstallation-testing"/> for further information.</para>
616                                         <para>As the <systemitem class="username">root</systemitem> user, copy the
617                                         sample configuration file <filename>/openils/conf/srfsh.xml.example</filename>
618                                         to the home directory of each user who will use <command>srfsh</command>. 
619                                         For instance, do the following for the 
620                                         <systemitem class="username">opensrf</systemitem> user:</para>
621 <screen>
622         <userinput>
623         # as the root user:
624         cp /openils/conf/srfsh.xml.example  /home/opensrf/.srfsh.xml</userinput>
625 </screen>
626                                         <para>Edit each user's file <filename>~/.srfsh.xml</filename> and make the
627                                         following changes:</para>
628                                         <itemizedlist>
629                                                 <listitem>
630                                                         <para>Modify <literal>domain</literal> to be the router hostname
631                                                         (following our domain examples,
632                                                         <systemitem class="domainname">private.localhost</systemitem> will give
633                                                         <command>srfsh</command> access to all OpenSRF services, while
634                                                         <systemitem class="domainname">public.localhost</systemitem>
635                                                         will only allow access to those OpenSRF services that are
636                                                         publicly exposed).</para>
637                                                 </listitem>
638                                                 <listitem>
639                                                         <para>Modify <literal>username</literal> and
640                                                         <literal>password</literal> to match the
641                                                         <literal>opensrf</literal> Jabber user for the chosen
642                                                         domain</para>
643                                                 </listitem>
644                                                 <listitem>
645                                                         <para>Modify <literal>logfile</literal> to be the full path for
646                                                         a log file to which the user has write access</para>
647                                                 </listitem>
648                                                 <listitem>
649                                                         <para>Modify <literal>loglevel</literal> as needed for testing</para>
650                                                 </listitem>
651                                                 <listitem>
652                                                         <para>Change the owner of the file to match the owner of the home directory</para>
653                                                 </listitem>
654                                         </itemizedlist>
655                                         <para>Following is a sample of the file:</para>
656 <programlisting language="xml"><![CDATA[
657 <?xml version="1.0"?>
658 <!-- This file follows the standard bootstrap config file layout -->
659 <!-- found in opensrf_core.xml -->
660 <srfsh>
661 <router_name>router</router_name>
662 <domain>private.localhost</domain>
663 <username>opensrf</username>
664 <passwd>SOMEPASSWORD</passwd>
665 <port>5222</port>
666 <logfile>/tmp/srfsh.log</logfile>
667 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
668 <loglevel>4</loglevel>
669 </srfsh>
670 ]]></programlisting>
671                                 </step>
672                                 <step>
673                                         <title>Modify the environmental variable <envar>PATH</envar> for the
674                                                 <systemitem class="username">opensrf</systemitem> user</title>
675                                         <para>As the <systemitem class="username">opensrf</systemitem> user, modify the
676                                         environmental variable <envar>PATH</envar> by adding a new file path to the
677                                         <systemitem class="username">opensrf</systemitem> user's shell configuration
678                                         file <filename>~/.bashrc</filename>:</para>
679 <screen>
680         <userinput>
681         # as the opensrf user:
682         echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc</userinput>
683 </screen>
684                                 </step>
685                                 <step>
686                                         <title>Start OpenSRF</title>
687                                         <para>As the <systemitem class="username">root</systemitem> user, start the
688                                         <systemitem class="service">ejabberd</systemitem> and 
689                                         <systemitem class="service">memcached</systemitem> services:</para>
690 <screen>
691         <userinput>
692         # as the root user:
693         /etc/init.d/ejabberd start
694         /etc/init.d/memcached start</userinput>
695 </screen>
696                                         <para>As the <systemitem class="username">opensrf</systemitem> user,
697                                         start OpenSRF as follows:</para>
698 <screen>
699         <userinput>
700         # as the opensrf user:
701         osrf_ctl.sh -l -a start_all</userinput>
702 </screen>
703                                         <para>The flag <option>-l</option> forces Evergreen to use 
704                                         <systemitem class="domainname">localhost</systemitem> (your current system) 
705                                         as the hostname. The flag <option>-a start_all</option>  starts the other 
706                                         OpenSRF <systemitem class="service">router</systemitem> , 
707                                         <systemitem class="service">Perl</systemitem> , and
708                                         <systemitem class="service">C</systemitem> services.</para>
709                                         <itemizedlist>
710                                                 <listitem>
711                                                         <para>You can also start Evergreen without the
712                                                         <option>-l</option> flag, but the <command>osrf_ctl.sh</command>
713                                                         utility must know the fully qualified domain name for the system
714                                                         on which it will execute. That hostname was probably specified
715                                                         in the configuration file <filename>opensrf.xml</filename> which
716                                                         you configured in a previous step.</para>
717                                                 </listitem>
718                                                 <listitem>
719                                                         <para>If you receive an error message similar to
720                                                         <emphasis>osrf_ctl.sh: command not found</emphasis>, then your
721                                                         environment variable <envar>PATH</envar> does not include the
722                                                         directory <filename class="directory">/openils/bin</filename>.
723                                                         As the <systemitem class="username">opensrf</systemitem> user,
724                                                         edit the configuration file <filename>~/.bashrc</filename> and
725                                                         add the following line: 
726                                                         <literal>export PATH=$PATH:/openils/bin</literal></para>
727                                                 </listitem>
728                                         </itemizedlist>
729                                 </step>
730                                 <step>
731                                         <title>Test connections to OpenSRF</title>
732                                         <para>Once you have installed and started OpenSRF, as the 
733                                         <systemitem class="username">root</systemitem> user, test your connection to 
734                                         <systemitem class="service">OpenSRF</systemitem> using the <command>srfsh</command> 
735                                         utility and trying to call the <command>add</command> method on the OpenSRF 
736                                         <systemitem class="service">math</systemitem> service:</para>
737 <screen>
738         <userinput>
739         # as the root user:
740         /openils/bin/srfsh</userinput>
741         <computeroutput>
742         srfsh# <userinput>request opensrf.math add 2 2</userinput></computeroutput>
743         <computeroutput>
744         Received Data: 4
745         ------------------------------------
746         Request Completed Successfully
747         Request Time in seconds: 0.007519
748         ------------------------------------</computeroutput>
749 </screen>
750                                         <para>For other <command>srfsh</command> commands, type in
751                                         <userinput>help</userinput> at the prompt.</para>
752                                 </step>
753                                 <step>
754                                         <title>Stop OpenSRF</title>
755                                         <para>After OpenSRF has started, you can stop it at any time by using the
756                                         <command>osrf_ctl.sh</command> again. As the 
757                                         <systemitem class="username">opensrf</systemitem> 
758                                         user, stop OpenSRF as follows:</para>
759 <screen>
760         <userinput>
761         # as the opensrf user:
762         osrf_ctl.sh -l -a stop_all</userinput>
763 </screen>
764                                 </step>
765                         </procedure>
766                 </section>
767                 <section xml:id="serversideinstallation-ubuntudebian">
768                         <title>Installing Evergreen 1.6.1.x On <systemitem class="osname">Ubuntu</systemitem> or
769                                 <systemitem class="osname">Debian</systemitem></title>
770                         <indexterm>
771                                 <primary>Linux</primary>
772                                 <secondary>Debian</secondary>
773                         </indexterm>
774                         <indexterm>
775                                 <primary>Linux</primary>
776                                 <secondary>Ubuntu</secondary>
777                         </indexterm>
778                         <para>This section outlines the installation process for the latest stable version of
779                         Evergreen.</para>
780                         <para>In this section you will download, unpack, install, configure and test the Evergreen
781                         system, including the Evergreen server and the PostgreSQL database system. You will make several
782                         configuration changes and adjustments to the software, including updates to configure the system
783                         for your own locale, and some updates needed to work around a few known issues.</para>
784                         <note>
785                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit)
786                                 architectures. There may be differences between the Desktop and Server editions of
787                                 <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server
788                                 edition.</para>
789                                 <para>In the following instructions, you are asked to perform certain steps as 
790                                 either the <systemitem class="username">root</systemitem> user, the 
791                                 <systemitem class="username">opensrf</systemitem> user, or the 
792                                 <systemitem class="username">postgres</systemitem> user.</para>
793                                 <itemizedlist>
794                                         <listitem>
795                                                 <para><systemitem class="osname">Debian</systemitem> -- To become the
796                                                 <systemitem class="username">root</systemitem> user, issue the command
797                                                 <command>su -</command> and enter the password of the 
798                                                 <systemitem class="username">root</systemitem> user.</para>
799                                         </listitem>
800                                         <listitem>
801                                                 <para><systemitem class="osname">Ubuntu</systemitem> -- To become the
802                                                 <systemitem class="username">root</systemitem> user, issue the command
803                                                 <command>sudo su -</command> and enter the password of the 
804                                                 <systemitem class="username">root</systemitem> user.</para>
805                                         </listitem>
806                                 </itemizedlist>
807                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a
808                                 different user, issue the command <command>su - USERNAME</command>. For example, to
809                                 switch from the <systemitem class="username">root</systemitem> user to the 
810                                 <systemitem class="username">opensrf</systemitem> user, issue the command 
811                                 <command>su - opensrf</command>. Once you have become a non-root user, to become the
812                                 <systemitem class="username">root</systemitem> user again, simply issue the command
813                                 <command>exit</command>.</para>
814                         </note>
815                         <procedure>
816                                 <step>
817                                         <title>Install OpenSRF</title>
818                                         <para>Evergreen software is integrated with and depends on the Open Service
819                                         Request Framework (OpenSRF) software system. For further information on
820                                         installing, configuring and testing OpenSRF, see 
821                                         <xref linkend="serversideinstallation-opensrf"/>.</para>
822                                         <para>Follow the steps outlined in that section and run the specified tests to
823                                         ensure that OpenSRF is properly installed and configured. Do 
824                                         <emphasis><emphasis role="bold">not</emphasis></emphasis> continue with
825                                         any further Evergreen installation steps until you have verified that OpenSRF
826                                         has been successfully installed and tested.</para>
827                                 </step>
828                                 <step>
829                                         <title>Download and Unpack Latest Evergreen Version</title>
830                                         <para>The latest version of Evergreen can be found here:
831                                         <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz"></ulink> .
832                                         As the <systemitem class="username">opensrf</systemitem> user, change to
833                                         the directory <filename class="directory">/home/opensrf</filename> then download
834                                         and extract Evergreen. The new subdirectory
835                                         <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.1.2</filename> will be created:</para>
836 <screen>
837         <userinput>
838         # as the opensrf user:
839         cd /home/opensrf
840         wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz
841         tar zxf Evergreen-ILS-1.6.1.2.tar.gz</userinput>
842 </screen>
843                                 </step>
844                                 <step xml:id="serversideinstallation-installprereq">
845                                         <title>Install Prerequisites to Build Evergreen</title>
846                                         <para>In this section you will install and configure a set of prerequisites that will be
847                                         used later in <xref linkend="serversideinstallation-configure"/> and 
848                                         <xref linkend="serversideinstallation-compile"/> to build the Evergreen software 
849                                         using the <command>make</command> utility.</para>
850                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show
851                                         below to build the prerequisites from the software distribution that you just downloaded
852                                         and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the following
853                                         example with the keyword corresponding to the name of one of the 
854                                         <systemitem class="osname">Linux</systemitem> distributions listed in the following
855                                         distribution keywords table <xref linkend="serversideinstallation-keywords-evergreen"/> .
856                                         For example, to install the prerequisites for Ubuntu version 9.10 (Karmic Koala) you would
857                                         enter this command: <command>make -f Open-ILS/src/extras/Makefile.install
858                                         ubuntu-karmic</command>.</para>
859 <screen>
860         <userinput>
861         # as the root user:
862         cd /home/opensrf/Evergreen-ILS-1.6.1.2
863         make -f Open-ILS/src/extras/Makefile.install [DISTRIBUTION]</userinput>
864 </screen>
865                                         <table xml:id="serversideinstallation-keywords-evergreen">
866                                                 <?dbfo keep-together="always" ?>
867                                                 <title>Keyword Targets for Evergreen <application>"make"</application> Command</title>
868                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
869                                                         <colspec colname="keyword" colnum="1" colwidth="1.0*"/>
870                                                         <colspec colname="linux_version" colnum="2" colwidth="3.0*"/>
871                                                         <thead>
872                                                                 <row>
873                                                                         <entry>Keyword</entry>
874                                                                         <entry>Linux Version</entry>
875                                                                 </row>
876                                                         </thead>
877                                                         <tbody>
878                                                                 <row>
879                                                                         <entry>debian-etch</entry>
880                                                                         <entry>Debian "Etch" (4.0)</entry>
881                                                                 </row>
882                                                                 <row>
883                                                                         <entry>debian-lenny</entry>
884                                                                         <entry>Debian "Lenny" (5.0)</entry>
885                                                                 </row>
886                                                                 <row>
887                                                                         <entry>ubuntu-hardy</entry>
888                                                                         <entry>Ubuntu "Hardy Heron" (8.04)</entry>
889                                                                 </row>
890                                                                 <row>
891                                                                         <entry>ubuntu-intrepid</entry>
892                                                                         <entry>Ubuntu "Intrepid Ibex" (8.10)</entry>
893                                                                 </row>
894                                                                 <row>
895                                                                         <entry>ubuntu-karmic</entry>
896                                                                         <entry>Ubuntu "Karmic Koala" (9.10)</entry>
897                                                                 </row>
898                                                                 <row>
899                                                                         <entry>ubuntu-karmic</entry>
900                                                                         <entry>Ubuntu "Lucid Lynx" (10.04)</entry>
901                                                                 </row>
902                                                                 <row>
903                                                                         <entry>centos</entry>
904                                                                         <entry>Centos</entry>
905                                                                 </row>
906                                                                 <row>
907                                                                         <entry>rhel</entry>
908                                                                         <entry>RHEL</entry>
909                                                                 </row>
910                                                                 <row>
911                                                                         <entry>gentoo</entry>
912                                                                         <entry>Gentoo</entry>
913                                                                 </row>
914                                                         </tbody>
915                                                 </tgroup>
916                                         </table>
917                                 </step>
918                                 <step performance="optional" xml:id="serversideinstallation-postgresql-default">
919                                         <title>(OPTIONAL) Install the PostgreSQL Server</title>
920                                         <indexterm>
921                                                 <primary>databases</primary>
922                                                 <secondary>PostgreSQL</secondary>
923                                         </indexterm>
924                                         <para>Since the PostgreSQL server is usually a standalone server in multi-server
925                                         production systems, the prerequisite installer Makefile in the previous section
926                                         (see <xref linkend="serversideinstallation-installprereq"/>)
927                                         does not automatically install PostgreSQL. You must install the PostgreSQL server
928                                         yourself, either on the same system as Evergreen itself or on another system.
929                                         If your PostgreSQL server is on a different system, just skip this step.
930                                         If your PostgreSQL server will be on the same system as your Evergreen
931                                         software, then install the required PostgreSQL server packages as follows.
932                                         For further information on manually installing PostgreSQL, visit the official
933                                         <link xl:href="http://www.postgresql.org/">PostgreSQL Site</link>.</para>
934                                         <para>For <systemitem class="osname">Debian Lenny</systemitem> and 
935                                         <systemitem class="osname">Ubuntu Hardy (8.04)</systemitem>, execute these commands:</para>
936 <screen>
937         <userinput>
938         # as the root user:
939         cd /home/opensrf/Evergreen-ILS-1.6.1.2
940         make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83</userinput>
941 </screen>
942                                         <para>For <systemitem class="osname">Ubuntu Karmic (9.10)</systemitem> and
943                                         <systemitem class="osname">Ubuntu Lucid (10.04)</systemitem>, execute these commands:</para>
944 <screen>
945         <userinput>
946         # as the root user:
947         cd /home/opensrf/Evergreen-ILS-1.6.1.2
948         make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84</userinput>
949 </screen>
950                                         <note>
951                                                 <para>PostgreSQL versions 8.3 or 8.4 are the recommended versions to work 
952                                                 with Evergreen 1.6.1.2 . If you have an older version of PostgreSQL, you 
953                                                 should upgrade before installing Evergreen. To find the running version of
954                                                 PostgreSQL, as the <systemitem class="username">postgres</systemitem> 
955                                                 user execute the command <command>psql</command>, then type 
956                                                 <userinput>SELECT version();</userinput> to get detailed information 
957                                                 about your version of PostgreSQL.</para>
958                                         </note>
959                                 </step>
960                                 <step performance="optional">
961                                         <title>Install Perl Modules on PostgreSQL Server</title>
962                                         <para>If PostgreSQL is running on the same system as your Evergreen software,
963                                         then the Perl modules will automatically be available. Just skip this step.
964                                         Otherwise, continue if your PostgreSQL server is running on another system.</para>
965                                         <para>You will need to install several Perl modules on the other system. As the
966                                         <systemitem class="username">root</systemitem> user install the following Perl
967                                         modules:</para>
968 <screen>
969         <userinput>
970         # as the root user:
971         # first, ensure the gcc compiler is installed:
972         apt-get install gcc
973
974         # then install the Perl modules:
975         perl -MCPAN -e shell</userinput>
976         <computeroutput>
977         cpan> <userinput>install JSON::XS</userinput>
978         cpan> <userinput>install MARC::Record</userinput>
979         cpan> <userinput>install MARC::File::XML</userinput></computeroutput>
980 </screen>
981                                         <para>For more information on installing Perl Modules vist the official
982                                         <link xl:href="http://www.cpan.org/">CPAN</link> site.</para>
983                                         <indexterm>
984                                                 <primary>Perl</primary>
985                                                 <secondary>CPAN</secondary>
986                                         </indexterm>
987                                 </step>
988                                 <step>
989                                         <title>Update the System Dynamic Library Path</title>
990                                         <para>You must update the system dynamic library path to force your system to recognize
991                                         the newly installed libraries. As the <systemitem class="username">root</systemitem> user,
992                                         do this by creating the new file <filename>/etc/ld.so.conf.d/osrf.conf</filename>
993                                         containing a new library path, then run the command <command>ldconfig</command> to
994                                         automatically read the file and modify the system dynamic library path:</para>
995 <screen>
996         <userinput>
997         # as the root user:
998         echo "/usr/local/lib"     >> /etc/ld.so.conf.d/osrf.conf
999         echo "/usr/local/lib/dbd" >> /etc/ld.so.conf.d/osrf.conf
1000         ldconfig</userinput>
1001 </screen>
1002                                 </step>
1003                                 <step performance="optional">
1004                                         <title>Restart the PostgreSQL Server</title>
1005                                         <para>If PostgreSQL is running on the same system as the rest of Evergreen, as
1006                                         the <systemitem class="username">root</systemitem> user you must restart
1007                                         PostgreSQL to re-read the new library paths just configured. If PostgreSQL is
1008                                         running on another system, you may skip this step.
1009                                         As the <systemitem class="username">opensrf</systemitem> user,
1010                                         execute the following command (remember to replace
1011                                         <emphasis>PGSQL_VERSION</emphasis> with your installed PostgreSQL version,
1012                                         for example <literal>8.3</literal>):</para>
1013 <screen>
1014         <userinput>
1015         # as the opensrf user:
1016         /etc/init.d/postgresql-PGSQL_VERSION restart</userinput>
1017 </screen>
1018                                 </step>
1019                                 <step xml:id="serversideinstallation-configure">
1020                                         <title>Configure Evergreen</title>
1021                                         <para>In this step you will use the <command>configure</command> and
1022                                         <command>make</command> utilities to configure Evergreen so it can be compiled
1023                                         and linked later in <xref linkend="serversideinstallation-compile"/>.</para>
1024                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to
1025                                         the Evergreen build directory and execute these commands:</para>
1026 <screen>
1027         <userinput>
1028         # as the opensrf user:
1029         cd /home/opensrf/Evergreen-ILS-1.6.1.2
1030         ./configure --prefix=/openils --sysconfdir=/openils/conf
1031         make</userinput>
1032 </screen>
1033                                 </step>
1034                                 <step xml:id="serversideinstallation-compile">
1035                                         <title>Compile, Link and Install Evergreen</title>
1036                                         <para>In this step you will actually compile, link and install Evergreen and the 
1037                                         default Evergreen Staff Client.</para>
1038                                         <para>As the <systemitem class="username">root</systemitem> user, return to the
1039                                         Evergreen build directory and use the <command>make</command> utility as shown below:</para>
1040 <screen>
1041         <userinput>
1042         # as the root user:
1043         cd /home/opensrf/Evergreen-ILS-1.6.1.2
1044         make STAFF_CLIENT_BUILD_ID=rel_1_6_1_2 install</userinput>
1045 </screen>
1046                                         <para>The Staff Client will also be automatically built, but you must remember
1047                                         to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the 
1048                                         Staff Client you will use to connect to the Evergreen server.</para>
1049                                         <para>The above commands will create a new subdirectory
1050                                         <filename class="directory">/openils/var/web/xul/rel_1_6_1_2</filename> 
1051                                         containing the Staff Client.</para>
1052                                         <para>To complete the Staff Client installation, as the
1053                                         <systemitem class="username">root</systemitem> user execute the following commands to
1054                                         create a symbolic link named <emphasis>server</emphasis> in the head of the Staff Client
1055                                         directory <filename class="directory">/openils/var/web/xul</filename> that points to the
1056                                         subdirectory <filename class="directory">/server</filename> of the new Staff Client
1057                                         build:</para>
1058 <screen>
1059         <userinput>
1060         # as the root user:
1061         cd /openils/var/web/xul
1062         ln -sf rel_1_6_1_2/server server</userinput>
1063 </screen>
1064                                 </step>
1065                                 <step>
1066                                         <title>Copy the OpenSRF Configuration Files</title>
1067                                         <para>In this step you will replace some OpenSRF configuration files that you set up in
1068                                         <xref linkend="serversideinstallation-opensrf-createconfig"/> when you installed and
1069                                         tested OpenSRF.</para>
1070                                         <para>You must copy several example OpenSRF configuration files into place after first
1071                                         creating backup copies for troubleshooting purposes, then change all the file ownerships
1072                                         to <systemitem class="username">opensrf</systemitem>.
1073                                         As the <systemitem class="username">root</systemitem> user, execute the following
1074                                         commands:</para>
1075 <screen>
1076         <userinput>
1077         # as the root user:
1078         cd /openils/conf
1079         cp opensrf.xml        opensrf.xml.BAK
1080         cp opensrf_core.xml      opensrf_core.xml.BAK
1081         cp opensrf.xml.example      opensrf.xml
1082         cp opensrf_core.xml.example opensrf_core.xml
1083         cp oils_web.xml.example     oils_web.xml
1084         chown -R opensrf:opensrf /openils/</userinput>
1085 </screen>
1086                                 </step>
1087                                 <step>
1088                                         <title>Create and Configure PostgreSQL Database</title>
1089                                         <indexterm>
1090                                                 <primary>databases</primary>
1091                                                 <secondary>PostgreSQL</secondary>
1092                                         </indexterm>
1093                                         <para>In this step you will create the Evergreen database. In the commands
1094                                         below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis>
1095                                         repository to match your PostgreSQL server
1096                                         layout. For example, if you built PostgreSQL from source the path would be
1097                                         <filename class="directory">/usr/local/share/contrib</filename> , and if you
1098                                         installed the PostgreSQL 8.3 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>,
1099                                         the path would be 
1100                                         <systemitem class="directory">/usr/share/postgresql/8.3/contrib/</systemitem> .</para>
1101                                         <substeps>
1102                                                 <step>
1103                                                         <para>
1104                                                                 <emphasis role="bold">Create and configure the database</emphasis>
1105                                                         </para>
1106                                                         <para>As the <systemitem class="username">postgres</systemitem>
1107                                                         user on the PostgreSQL system create the PostgreSQL database,
1108                                                         then set some internal paths:</para>
1109 <screen>
1110         <userinput>
1111         # as the postgres user:
1112         createdb evergreen -E UTF8 -T template0
1113         createlang plperl   evergreen
1114         createlang plperlu  evergreen
1115         createlang plpgsql  evergreen</userinput>
1116 </screen>
1117                                                         <para>Continue as the <systemitem class="username">postgres</systemitem> user
1118                                                         and execute the SQL scripts as shown below (remember to adjust the paths as needed,
1119                                                         where <emphasis>PGSQL_VERSION</emphasis> is your installed PostgreSQL
1120                                                         version, for example <literal>8.3</literal>).</para>
1121 <screen>
1122         <userinput>
1123         # as the postgres user:
1124         psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen
1125         psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen
1126         psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen</userinput>
1127 </screen>
1128                                                 </step>
1129                                                 <step xml:id="serversideinstallation-postgresqlcreateuser">
1130                                                         <title>Create <systemitem class="username">evergreen</systemitem> PostgreSQL user</title>
1131                                                         <para>As the <systemitem class="username">postgres</systemitem>
1132                                                         user on the PostgreSQL system, create a new PostgreSQL user
1133                                                         named <systemitem class="username">evergreen</systemitem> and
1134                                                         assign a password (remember to replace <emphasis>NEWPASSWORD</emphasis>
1135                                                         with an appropriate new password):</para>
1136 <screen>
1137         <userinput>
1138         # as the postgres user:
1139         createuser -P -s evergreen</userinput>
1140         <computeroutput>
1141         Enter password for new role: <userinput>NEWPASSWORD</userinput>
1142         Enter it again: <userinput>NEWPASSWORD</userinput></computeroutput>
1143 </screen>
1144                                                 </step>
1145                                                 <step>
1146                                                         <title>Create database schema</title>
1147                                                         <para>In this step you will create the database schema and configure your
1148                                                         system with the corresponding database authentication details for the
1149                                                         <emphasis>evergreen</emphasis> database user that you just created in
1150                                                         <xref linkend="serversideinstallation-postgresqlcreateuser"/>.</para>
1151                                                         <para>As the <systemitem class="username">root</systemitem> user, enter
1152                                                         the following commands and replace <emphasis>HOSTNAME, PORT,
1153                                                         PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate
1154                                                         values:</para>
1155 <screen>
1156         <userinput>
1157         # as the root user:
1158         cd /home/opensrf/Evergreen-ILS-1.6.1.2
1159         perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
1160           --service all --create-schema --create-bootstrap --create-offline \
1161           --hostname HOSTNAME --port PORT \
1162           --user evergreen --password PASSWORD --database DATABASENAME</userinput>
1163 </screen>
1164                                                         <para>On most systems, <emphasis>HOSTNAME</emphasis> will be
1165                                                         <emphasis role="bold">localhost</emphasis> and
1166                                                         <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>.
1167                                                         Of course, values for <emphasis>PASSWORD</emphasis> and
1168                                                         <emphasis>DATABASENAME</emphasis> must match the values you used in 
1169                                                         <xref linkend="serversideinstallation-postgresqlcreateuser"/>.</para>
1170                                                         <para>As the command executes, you may see warnings similar to:
1171                                                         <literal>ERROR: schema SOMENAME does not exist</literal> (in fact,
1172                                                         you may see one warning per schema) but they can be safely ignored.</para>
1173                                                         <note>If you are entering the above command on a single line, do not
1174                                                         include the <literal>\</literal> (backslash) characters. If you are using
1175                                                         the <command>bash</command> shell, these should only be used at the end of
1176                                                         a line at a <command>bash</command> prompt to indicate that the command is
1177                                                         continued on the next line.</note>
1178                                                 </step>
1179                                         </substeps>
1180                                 </step>
1181                                 <step>
1182                                         <title>Configure the Apache web server</title>
1183                                         <indexterm>
1184                                                 <primary>web server</primary>
1185                                                 <secondary>Apache</secondary>
1186                                         </indexterm>
1187                                         <para>In this step you will configure the Apache web server to support Evergreen
1188                                         software.</para>
1189                                         <para>First, you must enable some built-in Apache modules and install some
1190                                         additional Apache configuration files. Then you will create a new Security
1191                                         Certificate. Finally, you must make several changes to the Apache configuration
1192                                         file.</para>
1193                                         <substeps>
1194                                                 <step>
1195                                                         <title>Enable the required Apache Modules</title>
1196                                                         <para>As the <systemitem class="username">root</systemitem>
1197                                                         user, enable some modules in the Apache server, then copy the
1198                                                         new configuration files to the Apache server directories:</para>
1199                                                         <indexterm>
1200                                                                 <primary>Apache modules</primary>
1201                                                         </indexterm>
1202 <screen>
1203         <userinput>
1204         # as the root user:
1205         a2enmod ssl     # enable mod_ssl
1206         a2enmod rewrite # enable mod_rewrite
1207         a2enmod expires # enable mod_expires</userinput>
1208 </screen>
1209                                                         <para>As the commands execute, you may see warnings similar to:
1210                                                         <literal>Module SOMEMODULE already enabled</literal> but you can
1211                                                         safely ignore them.</para>
1212                                                 </step>
1213                                                 <step>
1214                                                         <title>Copy Apache configuration files</title>
1215                                                         <para>You must copy the Apache configuration files from the
1216                                                         Evergreen installation directory to the Apache directory. As the
1217                                                         <systemitem class="username">root</systemitem> user, perform the
1218                                                         following commands:</para>
1219 <screen>
1220         <userinput>
1221         # as the root user:
1222         cd /home/opensrf/Evergreen-ILS-1.6.1.2
1223         cp Open-ILS/examples/apache/eg.conf     /etc/apache2/sites-available/
1224         cp Open-ILS/examples/apache/eg_vhost.conf  /etc/apache2/
1225         cp Open-ILS/examples/apache/startup.pl     /etc/apache2/</userinput>
1226 </screen>
1227                                                 </step>
1228                                                 <step xml:id="serversideinstallation-createsslcertificate">
1229                                                         <title>Create a Security Certificate</title>
1230                                                         <para>In this step you will create a new Security Certificate (SSL Key)
1231                                                         for the Apache server using the <command>openssl</command> command. For a
1232                                                         public production server you must configure or purchase a signed SSL
1233                                                         certificate, but for now you can just use a self-signed certificate and
1234                                                         accept the warnings in the Staff Client and browser during testing and
1235                                                         development. As the <systemitem class="username">root</systemitem> user,
1236                                                         perform the following commands:</para>
1237 <screen>
1238         <userinput>
1239         # as the root user:
1240         mkdir /etc/apache2/ssl
1241         cd /etc/apache2/ssl
1242         openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key</userinput>
1243 </screen>
1244                                                         <para>You will be prompted for several items of information; enter
1245                                                         the appropriate information for each item. The new files
1246                                                         <filename>server.crt</filename> and <filename>server.key</filename> will
1247                                                         be created in the directory 
1248                                                         <filename class="directory">/etc/apache2/ssl</filename> .</para>
1249                                                         <note>This step generates a self-signed SSL certificate. You must install
1250                                                         a proper SSL certificate for a public production system to avoid warning
1251                                                         messages when users login to their account through the OPAC or when staff
1252                                                         login through the Staff Client. For further information on
1253                                                         installing a proper SSL certificate, see 
1254                                                         <xref linkend="serversideinstallation-ssl"/>.</note>
1255                                                 </step>
1256                                                 <step xml:id="serversideinstallation-modify-apache">
1257                                                         <title>Update Apache configuration file</title>
1258                                                         <para>You must make several changes to the new Apache
1259                                                         configuration file
1260                                                         <filename>/etc/apache2/sites-available/eg.conf</filename> . 
1261                                                         As the <systemitem class="username">root</systemitem> user,
1262                                                         edit the file and make the following changes:</para>
1263                                                         <itemizedlist>
1264                                                                 <listitem>
1265                                                                         <para>In the section
1266                                                                         <literal>&lt;Directory "/openils/var/cgi-bin"></literal>
1267                                                                         replace the line:</para>
1268                                                                         <literal>Allow from 10.0.0.0/8</literal> 
1269                                                                         <para>with the line:</para>
1270                                                                         <literal>Allow from all</literal>
1271                                                                         <warning>This change allows access to your configuration
1272                                                                         CGI scripts from any workstation on any network. This is
1273                                                                         only a temporary change to expedite testing and should be
1274                                                                         removed after you have finished and successfully tested
1275                                                                         the Evergreen installation. See 
1276                                                                         <xref linkend="serversideinstallation-postinstallation"/> 
1277                                                                         for further details on removing this change after the
1278                                                                         Evergreen installation is complete.
1279                                                                         </warning>
1280                                                                 </listitem>
1281                                                                 <listitem>
1282                                                                         <para>Comment out the line:</para>
1283                                                                         <literal>Listen 443</literal>
1284                                                                         <para>since it conflicts with the same declaration in 
1285                                                                         the configuration file:
1286                                                                         <filename>/etc/apache2/ports.conf</filename>. Note that
1287                                                                         <systemitem class="osname">Debian </systemitem> users
1288                                                                         should not do this since the conflict does not apply to
1289                                                                         that operating system.</para>
1290                                                                 </listitem>
1291                                                                 <listitem>
1292                                                                         <para>The following updates are needed to allow the logs
1293                                                                         to function properly, but it may break other Apache
1294                                                                         applications on your server:</para>
1295                                                                         <para>For the 
1296                                                                         <systemitem class="osname">Linux</systemitem> distributions
1297                                                                         <systemitem class="osname">Ubuntu Hardy</systemitem> or
1298                                                                         <systemitem class="osname">Debian Etch</systemitem>, as
1299                                                                         the <systemitem class="username">root</systemitem> user,
1300                                                                         edit the Apache configuration file
1301                                                                         <filename>/etc/apache2/apache2.conf</filename> and change
1302                                                                         the line <literal>User www-data</literal> to <literal>User
1303                                                                         opensrf</literal>.</para>
1304                                                                         <para>For the
1305                                                                         <systemitem class="osname">Linux</systemitem> distributions
1306                                                                         <systemitem class="osname">Ubuntu Karmic</systemitem>,
1307                                                                         <systemitem class="osname">Ubuntu Lucid</systemitem> or
1308                                                                         <systemitem class="osname">Debian Lenny</systemitem>, as
1309                                                                         the <systemitem class="username">root</systemitem> user,
1310                                                                         edit the Apache configuration file and change the lines:</para>
1311 <screen>
1312         <userinput>
1313         export APACHE_RUN_USER=www-data
1314         export APACHE_RUN_GROUP=www-data</userinput>
1315 </screen>
1316                                                                         <para>to instead read:</para>
1317 <screen>
1318         <userinput>
1319         export APACHE_RUN_USER=opensrf
1320         export APACHE_RUN_GROUP=opensrf</userinput>
1321 </screen>
1322                                                                 </listitem>
1323                                                                 <listitem>
1324                                                                         <para>As the 
1325                                                                         <systemitem class="username">root</systemitem> user,
1326                                                                         edit the Apache configuration file
1327                                                                         <filename>/etc/apache2/apache2.conf</filename> and
1328                                                                         modify the value for <literal>KeepAliveTimeout</literal>
1329                                                                         and <literal>MaxKeepAliveRequests</literal> to match
1330                                                                         the following:</para>
1331 <screen>
1332         <userinput>
1333         KeepAliveTimeout       1
1334         MaxKeepAliveRequests 100</userinput>
1335 </screen>
1336                                                                 </listitem>
1337                                                                 <listitem>
1338                                                                         <para>Further configuration changes to Apache may be
1339                                                                         necessary for busy systems. These changes increase the
1340                                                                         number of Apache server processes that are started to
1341                                                                         support additional browser connections.</para>
1342                                                                         <para>As the 
1343                                                                         <systemitem class="username">root</systemitem> user, 
1344                                                                         edit the Apache configuration file
1345                                                                         <filename>/etc/apache2/apache2.conf</filename>, locate 
1346                                                                         and modify the section related to <emphasis>prefork
1347                                                                         configuration</emphasis> to suit the load on your
1348                                                                         system:</para>
1349 <programlisting language="xml"><![CDATA[
1350 <IfModule mpm_prefork_module>
1351    StartServers    20
1352    MinSpareServers       5
1353    MaxSpareServers      15
1354    MaxClients       150
1355    MaxRequestsPerChild 10000
1356 </IfModule>
1357 ]]></programlisting>
1358                                                                 </listitem>
1359                                                         </itemizedlist>
1360                                                 </step>
1361                                                 <step>
1362                                                         <title>Enable the Evergreen web site</title>
1363                                                         <para>Finally, you must enable the Evergreen web site. As the
1364                                                         <systemitem class="username">root</systemitem> user, execute the
1365                                                         following Apache configuration commands to disable the default
1366                                                         <emphasis>It Works</emphasis> web page and enable the Evergreen
1367                                                         web site, and then restart the Apache server:</para>
1368 <screen>
1369         <userinput>
1370         # as the root user:
1371         # disable/enable web sites
1372         a2dissite default
1373         a2ensite eg.conf
1374         # restart the server
1375         /etc/init.d/apache2 reload</userinput>
1376 </screen>
1377                                                 </step>
1378                                         </substeps>
1379                                 </step>
1380                                 <step xml:id="serversideinstallation-opensrf-config">
1381                                         <title>Update the OpenSRF Configuration File</title>
1382                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
1383                                         OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>
1384                                         to update the Jabber usernames and passwords, and to specify the domain from
1385                                         which we will accept and to which we will make connections.</para>
1386                                         <para>If you are installing Evergreen on a single server and using the
1387                                         <systemitem class="domainname">private.localhost</systemitem> / 
1388                                         <systemitem class="domainname">public.localhost</systemitem> domains, 
1389                                         these will already be set to the correct values. Otherwise, search and replace
1390                                         to match your customized values.</para>
1391                                         <para>The left-hand side of  <xref linkend="serversideinstallation-xpath-table-2"/>
1392                                         shows common XPath syntax to indicate the approximate position within the XML
1393                                         file that needs changes. The right-hand side of the table shows the replacement
1394                                         values:</para>
1395                                         <table xml:id="serversideinstallation-xpath-table-2">
1396                                                 <?dbfo keep-together="always" ?>
1397                                                 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>
1398                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1399                                                         <colspec colname="Xpath" colnum="1" colwidth="1.6*"/>
1400                                                         <colspec colname="Value" colnum="2" colwidth="2.0*"/>
1401                                                         <thead>
1402                                                                 <row>
1403                                                                         <entry>XPath location</entry>
1404                                                                         <entry>Value</entry>
1405                                                                 </row>
1406                                                         </thead>
1407                                                         <tbody>
1408                                                                 <row>
1409                                                                         <entry>/config/opensrf/username</entry>
1410                                                                         <entry>
1411                                                                                 <systemitem class="username">opensrf</systemitem>
1412                                                                         </entry>
1413                                                                 </row>
1414                                                                 <row>
1415                                                                         <entry>/config/opensrf/passwd </entry>
1416                                                                         <entry><systemitem class="domainname">private.localhost</systemitem>
1417                                                                         password for
1418                                                                         <systemitem class="username">opensrf</systemitem> user
1419                                                                         </entry>
1420                                                                 </row>
1421                                                                 <row>
1422                                                                         <entry>/config/gateway/username</entry>
1423                                                                         <entry>
1424                                                                                 <systemitem class="username">opensrf</systemitem>
1425                                                                         </entry>
1426                                                                 </row>
1427                                                                 <row>
1428                                                                         <entry>/config/gateway/passwd</entry>
1429                                                                         <entry><systemitem class="domainname">public.localhost</systemitem>
1430                                                                         password for
1431                                                                         <systemitem class="username">opensrf</systemitem> user
1432                                                                         </entry>
1433                                                                 </row>
1434                                                                 <row>
1435                                                                         <entry>/config/routers/router/transport/username,
1436                                                                         first entry where server == public.localhost</entry>
1437                                                                         <entry>
1438                                                                                 <systemitem class="username">router</systemitem>
1439                                                                         </entry>
1440                                                                 </row>
1441                                                                 <row>
1442                                                                         <entry>/config/routers/router/transport/password,
1443                                                                         first entry where server == public.localhost</entry>
1444                                                                         <entry><systemitem class="domainname">public.localhost</systemitem>
1445                                                                         password for
1446                                                                         <systemitem class="username">router</systemitem> user
1447                                                                         </entry>
1448                                                                 </row>
1449                                                                 <row>
1450                                                                         <entry>/config/routers/router/transport/username,
1451                                                                         second entry where server == private.localhost</entry>
1452                                                                         <entry>
1453                                                                                 <systemitem class="username">router</systemitem>
1454                                                                         </entry>
1455                                                                 </row>
1456                                                                 <row>
1457                                                                         <entry>/config/routers/router/transport/password,
1458                                                                         second entry where server == private.localhost</entry>
1459                                                                         <entry><systemitem class="domainname">private.localhost</systemitem>
1460                                                                         password for
1461                                                                         <systemitem class="username">router</systemitem> user
1462                                                                         </entry>
1463                                                                 </row>
1464                                                         </tbody>
1465                                                 </tgroup>
1466                                         </table>
1467                                 </step>
1468                                 <step performance="optional">
1469                                         <title>(OPTIONAL) Create Configuration Files for Users Needing <command>srfsh</command></title>
1470                                         <para>When OpenSRF was installed in <xref linkend="serversideinstallation-opensrf"/>, the
1471                                         software installation automatically created a utility named <command>srfsh</command> (surf
1472                                         shell). This is a command line diagnostic tool for testing and interacting with
1473                                         OpenSRF. It will be used in a future step to complete and test the Evergreen installation.
1474                                         Earlier in <xref linkend="serversideinstallation-srfsh"/> you also created a configuration 
1475                                         file <filename>~/.srfsh.xml</filename> for each user that might need to use the utility.
1476                                         See <xref linkend="serversideinstallation-testing"/> for further information.</para>
1477                                 </step>
1478                                 <step xml:id="serversideinstallation-opensrf-env">
1479                                         <title>Modify the OpenSRF Environment</title>
1480                                         <para>In this step you will make some minor modifications to the OpenSRF environment:</para>
1481                                         <itemizedlist>
1482                                                 <listitem>
1483                                                         <para>Modify the permissions in the directory 
1484                                                         <filename class="directory">/openils/var/cgi-bin</filename> 
1485                                                         to make the files executable:</para>
1486 <screen>
1487         <userinput>
1488         # as the opensrf user:
1489         chmod 755 /openils/var/cgi-bin/*.cgi</userinput>
1490 </screen>
1491                                                 </listitem>
1492                                                 <listitem>
1493                                                         <para>As the <systemitem class="username">opensrf</systemitem> user,
1494                                                         modify the shell configuration file <filename>~/.bashrc</filename> for
1495                                                         user <systemitem class="username">opensrf</systemitem> by adding a Perl
1496                                                         environmental variable, then execute the shell configuration file to load
1497                                                         the new variables into your current environment.</para>
1498                                                         <note>In a multi-server environment, you must add any
1499                                                         modifications to <filename>~/.bashrc</filename> to the top of the file
1500                                                         <emphasis>before</emphasis> the line <literal>[ -z "$PS1" ] &amp;&amp;
1501                                                         return </literal>. This will allow headless (scripted) logins to load the
1502                                                         correct environment.</note>
1503 <screen>
1504         <userinput>
1505         # as the opensrf user:
1506         echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
1507         . ~/.bashrc</userinput>
1508 </screen>
1509                                                 </listitem>
1510                                         </itemizedlist>
1511                                 </step>
1512                                 <step performance="optional">
1513                                         <title>(OPTIONAL) Enable and Disable Language Localizations</title>
1514                                         <para>You can load translations such as Armenian (hy-AM), Canadian French
1515                                         (fr-CA), and others into the database to complete the translations available in
1516                                         the OPAC and Staff Client. For further information, see
1517                                         <xref linkend="enabling_and_disabling_localization"/>.</para>
1518                                 </step>
1519                         </procedure>
1520                 </section>
1521                 <section xml:id="serversideinstallation-starting">
1522                         <title>Starting Evergreen</title>
1523                         <para>In this section you will learn how to start the Evergreen services. 
1524                         For completeness, instructions for stopping Evergreen can be found later in 
1525                         <xref linkend="serversideinstallation-stopping"/>.</para>
1526                         <procedure>
1527                                 <step>
1528                                         <para>As the <systemitem class="username">root</systemitem>
1529                                         user, start the <systemitem class="service">ejabberd</systemitem> and 
1530                                         <systemitem class="service">memcached</systemitem> services as follows:</para>
1531 <screen>
1532         <userinput>
1533         # as the root user:
1534         /etc/init.d/ejabberd start
1535         /etc/init.d/memcached start</userinput>
1536 </screen>
1537                                 </step>
1538                                 <step>
1539                                         <para>As the <systemitem class="username">opensrf</systemitem> user,
1540                                         start Evergreen as follows:</para>
1541 <screen>
1542         <userinput>
1543         # as the opensrf user:
1544         osrf_ctl.sh -l -a start_all</userinput>
1545 </screen>
1546                                         <para>The flag <option>-l</option> forces Evergreen to use 
1547                                         <systemitem class="domainname">localhost</systemitem> (your current system) 
1548                                         as the hostname. The flag <option>-a start_all</option>  starts the other 
1549                                         OpenSRF <systemitem class="service">router</systemitem> , 
1550                                         <systemitem class="service">Perl</systemitem> , and
1551                                         <systemitem class="service">C</systemitem> services.</para>
1552                                         <itemizedlist>
1553                                                 <listitem>
1554                                                         <para>You can also start Evergreen without the
1555                                                         <option>-l</option> flag, but the <command>osrf_ctl.sh</command>
1556                                                         utility must know the fully qualified domain name for the system
1557                                                         on which it will execute. That hostname was probably specified
1558                                                         in the configuration file <filename>opensrf.xml</filename> which
1559                                                         you configured in a previous step.</para>
1560                                                 </listitem>
1561                                                 <listitem>
1562                                                         <para>If you receive an error message similar to
1563                                                         <emphasis>osrf_ctl.sh: command not found</emphasis>, then your
1564                                                         environment variable <envar>PATH</envar> does not include the
1565                                                         directory <filename class="directory">/openils/bin</filename>.
1566                                                         As the <systemitem class="username">opensrf</systemitem> user,
1567                                                         edit the configuration file <filename>~/.bashrc</filename> and
1568                                                         add the following line: 
1569                                                         <literal>export PATH=$PATH:/openils/bin</literal></para>
1570                                                 </listitem>
1571                                                 <listitem>
1572                                                         <para>If you receive an error message similar to <emphasis>Can't
1573                                                         locate OpenSRF/System.pm in @INC ... BEGIN failed--compilation
1574                                                         aborted</emphasis>, then your environment variable 
1575                                                         <emphasis role="bold">PERL5LIB</emphasis> does not include the 
1576                                                         directory <filename class="directory">/openils/lib/perl5</filename>.
1577                                                         As the <systemitem class="username">opensrf</systemitem> user, 
1578                                                         edit the configuration file <filename>~/.bashrc</filename> and
1579                                                         add the following line: 
1580                                                         <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>
1581                                                 </listitem>
1582                                         </itemizedlist>
1583                                 </step>
1584                                 <step>
1585                                         <para>In this step you will generate the Web files needed by the Staff Client
1586                                         and catalog, and update the proximity of locations in the Organizational Unit
1587                                         tree (which allows <emphasis>Holds</emphasis> to work properly).</para>
1588                                         <para>You must do this the first time you start Evergreen and after making any
1589                                         changes to the library hierarchy.</para>
1590                                         <para>As the <systemitem class="username">opensrf</systemitem> user, execute the
1591                                         following command and review the results:</para>
1592 <screen>
1593         <userinput>
1594         # as the opensrf user:
1595         cd /openils/bin
1596         ./autogen.sh -c /openils/conf/opensrf_core.xml -u</userinput>
1597         <computeroutput>
1598         Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
1599         Updating fieldmapper
1600         Updating web_fieldmapper
1601         Updating OrgTree
1602         removing OrgTree from the cache for locale hy-AM...
1603         removing OrgTree from the cache for locale cs-CZ...
1604         removing OrgTree from the cache for locale en-CA...
1605         removing OrgTree from the cache for locale en-US...
1606         removing OrgTree from the cache for locale fr-CA...
1607         removing OrgTree from the cache for locale ru-RU...
1608         Updating OrgTree HTML
1609         Updating locales selection HTML
1610         Updating Search Groups
1611         Refreshing proximity of org units
1612         Successfully updated the organization proximity
1613         Done</computeroutput>
1614 </screen>
1615                                 </step>
1616                                 <step>
1617                                         <para>As the <systemitem class="username">root</systemitem> user, restart the
1618                                         Apache Web server:</para>
1619 <screen>
1620         <userinput>
1621         # as the root user:
1622         /etc/init.d/apache2 restart</userinput>
1623 </screen>
1624                                         <note>If the Apache Web server was running when you started the OpenSRF
1625                                         services, you might not be able to successfully log into the OPAC or Staff
1626                                         Client until the Apache Web server has been restarted.</note>
1627                                 </step>
1628                         </procedure>
1629                 </section>
1630                 <section xml:id="serversideinstallation-testing">
1631                         <title>Testing Your Evergreen Installation</title>
1632                         <para>This section describes several simple tests you can perform to verify that the Evergreen
1633                         server-side software has been installed and configured properly and is running as
1634                         expected.</para>
1635                         <simplesect xml:id="serversideinstallation-testing-connections">
1636                                 <title>Testing Connections to Evergreen</title>
1637                                 <para>Once you have installed and started Evergreen, test your connection to Evergreen. Start the
1638                                 <command>srfsh</command> application and try logging onto the Evergreen server using the default
1639                                 administrator username and password. Following is sample output generated by executing
1640                                 <command>srfsh</command> after a successful Evergreen installation. For help with
1641                                 <command>srfsh</command> commands, type <userinput>help</userinput> at the prompt.
1642                                 As the <systemitem class="username">opensrf</systemitem> user,
1643                                 execute the following commands to test your Evergreen connection:</para>
1644 <screen>
1645         <userinput>
1646         # as the opensrf user:
1647         /openils/bin/srfsh</userinput>
1648         <computeroutput>
1649         srfsh% <userinput>login admin open-ils</userinput>
1650         Received Data: "250bf1518c7527a03249858687714376"
1651         ------------------------------------
1652         Request Completed Successfully
1653         Request Time in seconds: 0.045286
1654         ------------------------------------
1655         Received Data: {
1656            "ilsevent":0,
1657            "textcode":"SUCCESS",
1658            "desc":" ",
1659            "pid":21616,
1660            "stacktrace":"oils_auth.c:304",
1661            "payload":{
1662               "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
1663               "authtime":420
1664            }
1665         }
1666         ------------------------------------
1667         Request Completed Successfully
1668         Request Time in seconds: 1.336568
1669         ------------------------------------
1670         </computeroutput>
1671 </screen>
1672                                 <para>If this does not work, try the following:</para>
1673                                 <itemizedlist>
1674                                         <listitem>
1675                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the
1676                                                 <filename>settings-tester.pl</filename> utility to review your Evergreen
1677                                                 installation for any system configuration problems:</para>
1678 <screen>
1679         <userinput>
1680         # as the opensrf user:
1681         cd /home/opensrf
1682         ./Evergreen-ILS-1.6.1.2/Open-ILS/src/support-scripts/settings-tester.pl</userinput>
1683 </screen>
1684                                                 <para>If the output of <command>settings-tester.pl</command> does not help you
1685                                                 find the problem, please do not make any significant changes to your
1686                                                 configuration.</para>
1687                                         </listitem>
1688                                         <listitem>
1689                                                 <para>Follow the steps in the troubleshooting guide in 
1690                                                 <xref linkend="troubleshooting"/>.</para>
1691                                         </listitem>
1692                                         <listitem>
1693                                                 <para>If you have followed the entire set of installation steps listed here
1694                                                 closely, you are probably extremely close to a working system. Gather your
1695                                                 configuration files and log files and contact the 
1696                                                 <ulink url="http://open-ils.org/listserv.php">Evergreen Development Mailing List</ulink>
1697                                                 list for assistance before making any drastic changes to your system
1698                                                 configuration.</para>
1699                                         </listitem>
1700                                 </itemizedlist>
1701                         </simplesect>
1702                         <simplesect xml:id="serversideinstallation-running-staffclient">
1703                                 <title>Testing the Staff Client on Linux</title>
1704                                 <para>In this section you will confirm that a basic login on the Staff Client works
1705                                 properly.</para>
1706                                 <para>Run the Evergreen Staff Client on a Linux system by using the application
1707                                 <emphasis>XULRunner</emphasis> (installed automatically and by default with Firefox
1708                                 version 3.0 and later on Ubuntu and Debian distributions).</para>
1709                                 <para>As the <systemitem class="username">root</systemitem> user, start the Staff Client
1710                                 as shown:</para>
1711 <screen>
1712         <userinput>
1713         # as the root user:
1714         xulrunner /home/opensrf/Evergreen-ILS-1.6.1.2/Open-ILS/xul/staff_client/build/application.ini</userinput>
1715 </screen>
1716                                 <para>The login screen for the Staff Client should appear:</para>
1717                                 <mediaobject>
1718                                         <alt>Logging into the Staff Client</alt>
1719                                         <imageobject>
1720                                                 <imagedata fileref="../media/serversideinstallation-staffclient-running-1.png" format="PNG" scalefit="1" width="70%"/>
1721                                         </imageobject>
1722                                 </mediaobject>
1723                                 <para>First, add the name of your Evergreen server to the field
1724                                 <literal>Hostname</literal> in the <literal>Server</literal> section. You will probably
1725                                 want to use <literal>127.0.0.1</literal>. After adding the server name, click Re-Test
1726                                 Server. You should now see the messages <literal>200:OK</literal> in the fields
1727                                 <literal>Status</literal> and <literal>Version</literal>.</para>
1728                                 <para>Because this is the initial run of the Staff Client, you will see a warning in the
1729                                 upper-right saying: <emphasis role="bold">Not yet configured for the specified
1730                                 server</emphasis>. To continue, you must assign a workstation name. Refer to
1731                                 <xref linkend="staffclientinstallation-workstationnames"/> for further details.</para>
1732                                 <para>Try to log into the Staff Client with the username <literal>admin</literal> and
1733                                 the password <literal>open-ils</literal>. If the login is successful, you will see the
1734                                 following screen:</para>
1735                                 <mediaobject>
1736                                         <alt>Logging into the Staff Client</alt>
1737                                         <imageobject>
1738                                                 <imagedata fileref="../media/serversideinstallation-staffclient-running-4.png" format="PNG" scalefit="1" width="70%"/>
1739                                         </imageobject>
1740                                 </mediaobject>
1741                                 <para>Otherwise, you may need to click <guibutton>'Add SSL Exception'</guibutton> in the
1742                                 main window. You should see a popup window titled <literal>Add Security Exception</literal>:</para>
1743                                 <mediaobject>
1744                                         <alt>Adding an SSL Exception in the Staff Client</alt>
1745                                         <imageobject>
1746                                                 <imagedata fileref="../media/serversideinstallation-staffclient-running-2.png" format="PNG" scalefit="1" width="70%"/>
1747                                         </imageobject>
1748                                 </mediaobject>
1749                                 <para>Click <guibutton>'Get Certificate'</guibutton>, then click <guibutton>'Confirm
1750                                 Security Exception'</guibutton>, then click <guibutton>'Re-Test Server'</guibutton> in the
1751                                 main window and try to log in again.</para>
1752                         </simplesect>
1753                         <simplesect xml:id="serversideinstallation-starting-apache-server">
1754                                 <title>Testing the Apache Web Server</title>
1755                                 <para>In this section you will test the Apache configuration file(s), then restart the
1756                                 Apache web server.</para>
1757                                 <para>As the <emphasis role="bold">root</emphasis> user, execute the following
1758                                 commands. Note the use of <emphasis>restart</emphasis> to force the new Evergreen
1759                                 modules to be reloaded even if the Apache server is already running. Any problems found
1760                                 with your configuration files should be displayed:</para>
1761 <screen>
1762         <userinput>
1763         # as the root user:
1764         apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart</userinput>
1765 </screen>
1766                         </simplesect>
1767                         <simplesect xml:id="serversideinstallation-stopping">
1768                                 <title>Stopping Evergreen</title>
1769                                 <para>In <xref linkend="serversideinstallation-starting"/> you learned how to start the
1770                                 Evergreen services. For completeness, following are instructions for stopping the
1771                                 Evergreen services.</para>
1772                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all Evergreen
1773                                 services by using the following command:</para>
1774 <screen>
1775         <userinput>
1776         # as the opensrf user
1777         #   stop the server; use "-l" to force hostname to be "localhost"
1778         osrf_ctl.sh -l -a stop_all</userinput>
1779 </screen>
1780                                 <note>You can also stop Evergreen services <emphasis role="bold">without</emphasis> the
1781                                 <option>-l</option> flag, but the <command>osrf_ctl.sh</command> utility must know the
1782                                 fully qualified domain name for the system on which it will execute. That hostname may
1783                                 have been specified in the configuration file <filename>opensrf.xml</filename>, which
1784                                 you configured in a previous step.</note>
1785                         </simplesect>
1786                 </section>
1787                 <section xml:id="serversideinstallation-postinstallation">
1788                         <title>Post-Installation Chores</title>
1789                         <para>There are several additional steps you may need to complete after Evergreen has been
1790                         successfully installed and tested. Some steps may not be needed (e.g., setting up support for
1791                         Reports).</para>
1792                         <section>
1793                                 <title>Remove temporary Apache configuration changes</title>
1794                                 <para>You modified the Apache configuration file
1795                                 <filename>/etc/apache2/sites-available/eg.conf</filename> in an earlier step as a
1796                                 temporary measure to expedite testing (see 
1797                                 <xref linkend="serversideinstallation-modify-apache"/> for further information).
1798                                 Those changes must now be reversed in order to deny unwanted access to your 
1799                                 CGI scripts from users on other public networks.</para>
1800                                 <warning>
1801                                         <para>
1802                                                 <emphasis>This temporary network update was done to expedite
1803                                                 testing. You <emphasis role="bold">must</emphasis> correct
1804                                                 this for a public production system.</emphasis>
1805                                         </para>
1806                                 </warning>
1807                                 <para>As the <systemitem class="username">root</systemitem> user, edit the configuration
1808                                 file again and comment out the line <literal>Allow from all</literal> and uncomment the
1809                                 line <literal>Allow from 10.0.0.0/8</literal>, then change it to match your network
1810                                 address scheme.</para>
1811                         </section>
1812                         <section xml:id="serversideinstallation-ssl">
1813                                 <title>Configure a permanent SSL key</title>
1814                                 <para>In a previous step (see <xref linkend="serversideinstallation-createsslcertificate"/>)
1815                                 you used the command <command>openssl</command> to temporarily
1816                                 create a new SSL key for the Apache server. This self-signed security certificate was adequate
1817                                 during testing and development, but will continue to generate warnings in the Staff Client 
1818                                 and browser. For a public production server you should configure or purchase a signed SSL
1819                                 certificate.</para>
1820                                 <para>There are several open source software solutions that provide schemes to generate and
1821                                 maintain public key security certificates for your library system. Some popular projects are
1822                                 listed below; please review them for background information on why you need such a system and 
1823                                 how you can provide it:</para>
1824                                 <itemizedlist>
1825                                         <listitem>
1826                                                 <ulink url="http://www.openca.org/projects/openca/">http://www.openca.org/projects/openca/</ulink>
1827                                         </listitem>
1828                                         <listitem>
1829                                                 <ulink url="http://sourceforge.net/projects/ejbca/">http://sourceforge.net/projects/ejbca/</ulink>
1830                                         </listitem>
1831                                         <listitem>
1832                                                 <ulink url="http://pki.fedoraproject.org">http://pki.fedoraproject.org</ulink>
1833                                         </listitem>
1834                                 </itemizedlist>
1835                                 <warning>
1836                                         <para>
1837                                                 <emphasis>The temporary SSL key was only created to expedite
1838                                                 testing. You should install a proper SSL certificate for a public
1839                                                 production system.</emphasis>
1840                                         </para>
1841                                 </warning>
1842                         </section>
1843                         <section>
1844                                 <title>(OPTIONAL) Set Up Support For Reports</title>
1845                                 <para>Evergreen reports are extremely powerful but require some simple configuration.
1846                                 This section describes starting and stopping the Reporter daemon processes.</para>
1847                                 <itemizedlist>
1848                                         <listitem>
1849                                                 <para>Starting the Reporter Daemon</para>
1850                                                 <para>Once the <systemitem class="daemon">open-ils.reporter</systemitem>
1851                                                 process is running and enabled on the gateway, you can start the
1852                                                 Reporter daemon. That process periodically checks for requests for new
1853                                                 or scheduled reports, then starts them as required.</para>
1854                                                 <para>As the <systemitem class="username">opensrf</systemitem> user,
1855                                                 start the Reporter daemon using the following command:</para>
1856 <screen>
1857         <userinput>
1858         # as the opensrf user:
1859         cd /home/opensrf/Evergreen-ILS-1.6.1.2/Open-ILS/src/reporter
1860         ./clark-kent.pl --daemon</userinput>
1861 </screen>
1862                                                 <para>You can control how the <command>clark-kent.pl</command> utility behaves
1863                                                 by specifying any of several command-line options:</para>
1864                                                 <itemizedlist>
1865                                                         <listitem><option>--sleep=interval</option> : number of seconds
1866                                                         to sleep between checks for new reports to run; defaults to
1867                                                         <literal>10</literal></listitem>
1868                                                         <listitem><option>--lockfile=filename</option> : where to place
1869                                                         the lockfile for the process; defaults to
1870                                                         <filename>/tmp/reporter-LOCK</filename></listitem>
1871                                                         <listitem><option>--concurrency=integer</option> : number of
1872                                                         Reporter daemon processes to run; defaults to
1873                                                         <literal>1</literal></listitem>
1874                                                         <listitem><option>--bootstrap=filename</option> : OpenSRF
1875                                                         bootstrap configuration file; defaults to
1876                                                         <filename>/openils/conf/opensrf_core.xml</filename></listitem>
1877                                                 </itemizedlist>
1878                                         </listitem>
1879                                         <listitem>
1880                                                 <para>Stopping the Reporter Daemon</para>
1881                                                 <para>To stop the Reporter daemon, you must kill the process and remove
1882                                                 the lockfile. The daemon may have just a single associated process or
1883                                                 there may be several processes if the daemon was started with the optional
1884                                                 <literal>--concurrency</literal> switch. It will also have a lockfile
1885                                                 in the default location.</para>
1886                                                 <para>As the <systemitem class="username">opensrf</systemitem> user,
1887                                                 execute the following shell commands:</para>
1888 <screen>
1889         <userinput>
1890         # as the root user:
1891         # find and kill the process ID number(s)
1892         kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
1893         # remove the lock file
1894         rm /tmp/reporter-LOCK</userinput>
1895 </screen>
1896                                         </listitem>
1897                                 </itemizedlist>
1898                         </section>
1899                 </section>
1900                 <section xml:id="serversideinstallation-virtual">
1901                         <title>Installing In Virtualized <systemitem class="osname">Linux</systemitem> Environments</title>
1902                         <para>This section describes the installation of Evergreen software in so-called "virtualized"
1903                         software environments. Evergreen software runs as a native application on any of several
1904                         well-known x86 (32-bit) and x86-64 (64-bit) <systemitem class="osname">Linux</systemitem>
1905                         distributions including <systemitem class="osname">Ubuntu</systemitem> and 
1906                         <systemitem class="osname">Debian</systemitem> but it does not run as a native application 
1907                         on the <systemitem class="osname">Microsoft Windows</systemitem> operating system. 
1908                         However, it is possible to execute Evergreen on a <systemitem class="osname">Windows</systemitem> 
1909                         host system by running it within a virtual Linux-guest installation, which itself executes 
1910                         on the <systemitem class="osname">Windows</systemitem> system. 
1911                         The <systemitem class="osname">Linux</systemitem> environment is fully emulated and acts 
1912                         (within limits) just as if it were executing on a real standalone system.</para>
1913                         <para>This technique of emulating a <systemitem class="osname">Linux</systemitem> environment on
1914                         a <systemitem class="osname">Windows</systemitem> host is a practical way to install and run an
1915                         Evergreen system if it is not possible to dedicate a physical machine solely as a 
1916                         <systemitem class="osname">Linux</systemitem> host for Evergreen. This architecture is not
1917                         recommended for large scale systems since there are performance limitations to running Evergreen
1918                         in a virtualized environment. However, it is a reasonable architecture for smaller experimental
1919                         systems, as a proof of concept, or as a conference-room pilot.</para>
1920                         <simplesect>
1921                                 <title>Installing Virtualization Software</title>
1922                                 <para>As described above, Evergreen can be installed on top of an emulated
1923                                 <systemitem class="osname">Linux</systemitem> environment. The 
1924                                 <systemitem class="osname">Linux</systemitem> environment, in turn, is installed 
1925                                 on top of a software application such as <application>"VirtualBox"</application>,
1926                                 <application>"VMware"</application> or <application>"VirtualPC"</application> which must
1927                                 first be installed on the <systemitem class="osname">Windows</systemitem> system. This
1928                                 section contains step-by-step examples that show installing popular virtualization
1929                                 applications on a <systemitem class="osname">Windows</systemitem> host system. Following
1930                                 this section are further descriptions of installing 
1931                                 <systemitem class="osname">Linux</systemitem> and Evergreen systems using that 
1932                                 virtualization software.</para>
1933                                 <section>
1934                                         <title>Installing <application>"VirtualBox"</application> Virtualization Software</title>
1935                                         <para>This section reviews installation of the
1936                                         <application>"VirtualBox"</application> application on 
1937                                         <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. 
1938                                         Download the latest edition of <application>VirtualBox</application> from their official website: 
1939                                         <link xl:href="http://virtualbox.org" xl:title="virtual box">http://virtualbox.org</link>
1940                                         and follow the on screen instructions to install the software.</para>
1941                                 </section>
1942                                 <section>
1943                                         <title>Installing VMware Virtualization Software</title>
1944                                         <indexterm>
1945                                                 <primary>virtualization software</primary>
1946                                                 <secondary>VMware</secondary>
1947                                         </indexterm>
1948                                         <para>This section reviews installation of the
1949                                         <application>"VMware"</application> application on
1950                                         <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. 
1951                                         Find and Download the free virtual machine software of from the VMware
1952                                         official website:
1953                                         <ulink url="http://downloads.vmware.com">http://downloads.vmware.com</ulink> 
1954                                         and follow the on-screen instructions.</para>
1955                                 </section>
1956                         </simplesect>
1957                         <simplesect xml:id="serversideinstallation-virtual-install-linux-ev">
1958                                 <title>Installing <systemitem class="osname">Linux</systemitem> / 
1959                                                 Evergreen on Virtualization Software</title>
1960                                 <para>After the virtualization software is installed and running, there are two ways to
1961                                 continue with installing <systemitem class="osname">Linux</systemitem> and Evergreen
1962                                 software in the new virtualized environment:</para>
1963                                 <orderedlist>
1964                                         <listitem>
1965                                                 <para>Download and install a prebuilt software image that contains a
1966                                                 working <systemitem class="osname">Linux</systemitem> / Evergreen system
1967                                                 (see <xref linkend="serversideinstall-virtual-prebuilt"/> for
1968                                                 details)</para>
1969                                         </listitem>
1970                                         <listitem>
1971                                                 <para>Manually install a <systemitem class="osname">Linux</systemitem>
1972                                                 guest system, then manually install Evergreen on it.</para>
1973                                         </listitem>
1974                                 </orderedlist>
1975                                 <para>We review each method in the following sections.</para>
1976                                 <section xml:id="serversideinstall-virtual-prebuilt">
1977                                         <title>Download and install a prebuilt software image</title>
1978                                         <para>You can download a prebuilt software image that, when installed with your
1979                                         virtualization software, emulates a 
1980                                         <systemitem class="osname">Linux</systemitem> guest system containing a running 
1981                                         Evergreen distribution. The image is essentially a snapshot of a hard disk from
1982                                         a fully configured, functional <systemitem class="osname">Linux</systemitem>
1983                                         system with Evergreen already installed.</para>
1984                                         <para>We recommend this approach if you wish to get Evergreen running quickly
1985                                         with minimal attention to configuration. After reviewing only a few
1986                                         configuration details you can have a working Evergreen system that integrates
1987                                         smoothly with the rest of your network. See 
1988                                         <xref linkend="serversideinstall-virtual-versions"/> for a list of prebuilt 
1989                                         software images that are currently available to download and install</para>
1990                                         <note>DISCLAIMER: The following virtual images have been contributed by members
1991                                         of the Evergreen community for the purposes of testing, evaluation, training,
1992                                         and development.</note>
1993                                         <table xml:id="serversideinstall-virtual-versions">
1994                                                 <?dbfo keep-together="always" ?>
1995                                                 <title>Linux / Evergreen Virtual Images</title>
1996                                                 <tgroup align="left" cols="4" colsep="1" rowsep="1">
1997                                                         <colspec colname="linux_version" colnum="1" colwidth="1.0*"/>
1998                                                         <colspec colname="evergreen_version" colnum="2" colwidth="1.0*"/>
1999                                                         <colspec colname="image" colnum="3" colwidth="3.0*"/>
2000                                                         <colspec colname="comments" colnum="4" colwidth="1.0*"/>
2001                                                         <thead>
2002                                                                 <row>
2003                                                                         <entry>Linux Version</entry>
2004                                                                         <entry>Evergreen Version</entry>
2005                                                                         <entry>Image</entry>
2006                                                                         <entry>Comments</entry>
2007                                                                 </row>
2008                                                         </thead>
2009                                                         <tbody>
2010                                                                 <row>
2011                                                                         <entry>Debian lenny (5.0)</entry>
2012                                                                         <entry>1.6.0.1</entry>
2013                                                                         <entry>
2014                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen1601_DebianLenny.zip"> download </ulink>
2015                                                                         </entry>
2016                                                                         <entry>VirtualBox image</entry>
2017                                                                 </row>
2018                                                                 <row>
2019                                                                         <entry>Ubuntu karmic koala (9.10)</entry>
2020                                                                         <entry>1.6.0.0</entry>
2021                                                                         <entry>
2022                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen-1600-Karmic.zip"> download </ulink>
2023                                                                         </entry>
2024                                                                         <entry>VirtualBox image</entry>
2025                                                                 </row>
2026                                                         </tbody>
2027                                                 </tgroup>
2028                                         </table>
2029                                         <procedure>
2030                                                 <title>VirtualBox Example</title>
2031                                                 <indexterm>
2032                                                         <primary>virtualization software</primary>
2033                                                         <secondary>VirtualBox</secondary>
2034                                                 </indexterm>
2035                                                 <step>
2036                                                         <para>Start VirtualBox for the first time and select
2037                                                         <menuchoice><guimenu>File</guimenu><guimenuitem>VirtualBox Media Manager</guimenuitem><guimenuitem>Add</guimenuitem></menuchoice>
2038                                                         to locate the prebuilt software image just downloaded (the
2039                                                         example shows it was extracted from the original
2040                                                         <filename class="extension">zip</filename> file into a temporary directory
2041                                                         <filename class="directory">C:\temp</filename>).</para>
2042                                                 </step>
2043                                                 <step>
2044                                                         <para>After selecting the file, click <guibutton>'Open'</guibutton> to import it.</para>
2045                                                 </step>
2046                                                 <step>
2047                                                         <para>Then click <guibutton>'OK'</guibutton> to save the selection
2048                                                         and return to the VirtualBox Media Manager</para>
2049                                                 </step>
2050                                                 <step>
2051                                                         <para>Click <guibutton>'New'</guibutton>, then <guibutton>'Next'</guibutton> 
2052                                                         to continue and create a new virtual machine (VM).</para>
2053                                                 </step>
2054                                                 <step>
2055                                                         <para>Create a new name for the VM and set the operating system
2056                                                         type, then click <guibutton>'Next'</guibutton>.</para>
2057                                                 </step>
2058                                                 <step>
2059                                                         <para>Set the memory size (at least 512Mb),
2060                                                         then click <guibutton>'Next'</guibutton>.</para>
2061                                                 </step>
2062                                                 <step>
2063                                                         <para>Edit the Virtual Hard Disk configuration settings; click
2064                                                         the radio boxes <guilabel>Boot Hard Disk</guilabel> and
2065                                                         <guilabel>Use existing hard disk</guilabel>
2066                                                         and ensure that the disk name <guilabel>Evergreen1601_DebianLenny.vmdk</guilabel>
2067                                                         is selected. Click <guibutton>'Finish'</guibutton> to finish the
2068                                                         setup.</para>
2069                                                 </step>
2070                                                 <step>
2071                                                         <para>Install the <application>VirtualBox Guest
2072                                                         Additions</application> (really a required upgrade to
2073                                                         VirtualBox)</para>
2074                                                 </step>
2075                                                 <step>
2076                                                         <para>Return to VirtualBox and see the summary of the VM just
2077                                                         created. Click <guibutton>'Start'</guibutton> to boot the new VM.</para>
2078                                                 </step>
2079                                                 <step>
2080                                                         <para>See the start of the <systemitem class="osname">Linux</systemitem>
2081                                                         boot sequence. Choose <guimenuitem>Debian Gnu/Linux, kernel
2082                                                         2.6.26-2-686</guimenuitem> from the startup menu and click
2083                                                         <guibutton>'Enter'</guibutton> to start 
2084                                                         <systemitem class="osname">Linux</systemitem> and Evergreen. 
2085                                                         After some delay you should see the command line prompt 
2086                                                         <prompt>debian-lenny login:</prompt>. Log in with username
2087                                                         <userinput>root </userinput> and password <userinput>evergreen</userinput>
2088                                                         to continue.</para>
2089                                                 </step>
2090                                         </procedure>
2091                                 </section>
2092                         </simplesect>
2093                 </section>
2094         </section>
2095 </chapter>