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