]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/serversideinstallation.xml
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 the 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>gentoo</entry>
226                                                                         <entry>for Gentoo</entry>
227                                                                 </row>
228                                                         </tbody>
229                                                 </tgroup>
230                                         </table>
231                                         <para>This will install a number of packages on the system that are required by OpenSRF,
232                                         including some Perl modules from CPAN. You can say <literal>No</literal> to the initial
233                                         CPAN configuration prompt to allow it to automatically configure itself to download and
234                                         install Perl modules from CPAN. The CPAN installer will ask you a number of times whether
235                                         it should install prerequisite modules - say <literal>Yes</literal>.</para>
236                                 </step>
237                                 <step>
238                                         <title>Build OpenSRF</title>
239                                         <para>In this section you will configure and build the OpenSRF
240                                         components that support other Evergreen services.</para>
241                                         <substeps>
242                                                 <step>
243                                                         <title>Configure OpenSRF</title>
244                                                         <indexterm>
245                                                                 <primary>OpenSRF</primary>
246                                                                 <secondary>configure</secondary>
247                                                         </indexterm>
248                                                         <para>As the <systemitem class="username">opensrf</systemitem>
249                                                         user, return to the OpenSRF build directory and use the
250                                                         <command>configure</command> utility to prepare for the next
251                                                         step of compiling and linking the software. If you wish to
252                                                         include support for Python and Java, add the configuration
253                                                         options <option>--enable-python</option> and
254                                                         <option>--enable-java</option>, respectively:</para>
255                                                         <screen>
256                                                                 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
257                                                                 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>
258                                                                 <userinput>make</userinput>
259                                                         </screen>
260                                                 </step>
261                                                 <step>
262                                                         <title>Compile, Link and Install OpenSRF</title>
263                                                         <para>As the <systemitem class="username">root</systemitem>
264                                                         user, return to the OpenSRF build directory and use the
265                                                         <command>make</command> utility to compile, link and install
266                                                         OpenSRF:</para>
267                                                         <screen>
268                                                                 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
269                                                                 <userinput>make install</userinput>
270                                                         </screen>
271                                                 </step>
272                                                 <step>
273                                                         <title>Update the System Dynamic Library Path</title>
274                                                         <para>You must update the system dynamic library path to force
275                                                         your system to recognize the newly installed libraries. As the
276                                                         <systemitem class="username">root</systemitem> user, do this by
277                                                         creating the new file
278                                                         <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a
279                                                         new library path, then run the command
280                                                         <command>ldconfig</command> to automatically read the file and
281                                                         modify the system dynamic library path:</para>
282                                                         <screen>
283                                                                 <userinput>echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf</userinput>
284                                                                 <userinput>ldconfig</userinput>
285                                                         </screen>
286                                                 </step>
287                                                 <step>
288                                                         <title>Define Public and Private OpenSRF Domains</title>
289                                                         <para>For security purposes, OpenSRF uses Jabber domains to separate services
290                                                         into public and private realms. On a single-server system the easiest way to
291                                                         define public and private OpenSRF domains is to define separate host names by 
292                                                         adding entries to the file <filename>/etc/hosts</filename>.</para>
293                                                         <para>In the following steps we will use the example domains
294                                                         <systemitem class="domainname">public.localhost</systemitem> for the public
295                                                         domain and <systemitem class="domainname">private.localhost</systemitem> 
296                                                         for the private domain. In an upcoming step, you will configure two special
297                                                         <systemitem class="service">ejabberd</systemitem> users
298                                                         to handle communications for these two domains.</para>
299                                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file
300                                                         <filename>/etc/hosts</filename> and add the following example domains:</para>
301                                                         <indexterm>
302                                                                 <primary>Jabber</primary>
303                                                         </indexterm>
304                                                         <screen>
305                                                                 <userinput>127.0.1.2    public.localhost        public</userinput>
306                                                                 <userinput>127.0.1.3    private.localhost       private</userinput>
307                                                         </screen>
308                                                 </step>
309                                                 <step>
310                                                         <title>Change File Ownerships</title>
311                                                         <para>Finally, as the <systemitem class="username">root</systemitem>
312                                                         user, change the ownership of all files installed in the
313                                                         directory <filename class="directory">/openils</filename> to the
314                                                         user <systemitem class="username">opensrf</systemitem>:</para>
315                                                         <screen>
316                                                                 <userinput>chown -R opensrf:opensrf /openils</userinput>
317                                                         </screen>
318                                                 </step>
319                                         </substeps>
320                                 </step>
321                                 <step>
322                                         <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>
323                                         <indexterm>
324                                                 <primary>ejabberd</primary>
325                                         </indexterm>
326                                         <para>Before continuing with configuration of <systemitem class="service">ejabberd</systemitem>
327                                         you must stop that service. As the <systemitem class="username">root</systemitem> user,
328                                         execute the following command to stop the service:</para>
329                                         <screen>
330                                                 <userinput>/etc/init.d/ejabberd stop</userinput>
331                                         </screen>
332                                         <para>If <systemitem class="service">ejabberd</systemitem> reports that it 
333                                         is already stopped, there may have been a problem when it started back
334                                         in the installation step. If there are any remaining daemon processes such as
335                                         <systemitem class="daemon">beam</systemitem> or
336                                         <systemitem class="daemon">epmd</systemitem> 
337                                         you may need to perform the following commands to kill them:</para>
338                                         <screen>
339                                                 <userinput>epmd -kill</userinput>
340                                                 <userinput>killall beam; killall beam.smp</userinput>
341                                                 <userinput>rm /var/lib/ejabberd/*</userinput>
342                                                 <userinput>echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd</userinput>
343                                         </screen>
344                                 </step>
345                                 <step>
346                                         <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>
347                                         <para>You must make several configuration changes for the
348                                         <systemitem class="service">ejabberd</systemitem> service before
349                                         it is started again.
350                                         As the <systemitem class="username">root</systemitem> user, edit the file
351                                         <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>
352                                         <itemizedlist>
353                                                 <listitem>
354                                                         <para>Change the line:
355                                                         <screen><userinput>{hosts, ["localhost"]}.</userinput></screen>
356                                                         to:
357                                                         <screen><userinput>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</userinput></screen></para>
358                                                 </listitem>
359                                                 <listitem>
360                                                         <para>Change the line:
361                                                         <screen><userinput>{max_user_sessions, 10}.</userinput></screen> to:
362                                                         <screen><userinput>{max_user_sessions, 10000}.</userinput></screen></para>
363                                                         <para>If the line looks something like this:
364                                                         <screen><userinput>{access, max_user_sessions, [{10, all}]}.</userinput></screen>
365                                                         then change it to:
366                                                         <screen><userinput>{access, max_user_sessions, [{10000, all}]}</userinput></screen></para>
367                                                 </listitem>
368                                                 <listitem>
369                                                         <para>Change all three occurrences of: <literal>max_stanza_size</literal>
370                                                         to: <literal>2000000</literal>.</para>
371                                                 </listitem>
372                                                 <listitem>
373                                                         <para>Change both occurrences of: <literal>maxrate</literal> to:
374                                                         <literal>500000</literal>.</para>
375                                                 </listitem>
376                                                 <listitem>
377                                                         <para>Comment out the line <literal>{mod_offline, []}</literal> 
378                                                         by placing two <literal>%</literal> comment signs in front.</para>
379                                                 </listitem>
380                                         </itemizedlist>
381                                 </step>
382                                 <step xml:id="serversideinstallation-opensrf-continued">
383                                         <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>
384                                         <para>As the <systemitem class="username">root</systemitem> user, restart the
385                                         <systemitem class="service">ejabberd</systemitem> service to test the
386                                         configuration changes and to register your users:</para>
387                                         <screen>
388                                                 <userinput>/etc/init.d/ejabberd start</userinput>
389                                         </screen>
390                                 </step>
391                                 <step>
392                                         <title>Register <systemitem class="username">router</systemitem> and
393                                                 <systemitem class="username">ejabberd</systemitem> users</title>
394                                         <para>The two <systemitem class="service">ejabberd</systemitem> users 
395                                         <systemitem class="username">router</systemitem> and 
396                                         <systemitem class="username">opensrf</systemitem> must be registered 
397                                         and configured to manage OpenSRF router service and communications 
398                                         for the two domains <literal>public.localhost</literal> and
399                                         <literal>private.localhost</literal>
400                                         that you added to the file <filename>/etc/hosts</filename>
401                                         in a previous step:</para>
402                                         <itemizedlist>
403                                                 <listitem>
404                                                         <para>the <systemitem class="username">router</systemitem> user,
405                                                         to whom all requests to connect to an OpenSRF service will be
406                                                         routed;</para>
407                                                 </listitem>
408                                                 <listitem>
409                                                         <para>the <systemitem class="username">opensrf</systemitem> user,
410                                                         which clients use to connect to OpenSRF services (you may name
411                                                         the user anything you like, but we use
412                                                         <literal>opensrf</literal> in these examples)</para>
413                                                 </listitem>
414                                         </itemizedlist>
415                                         <para>As the <systemitem class="username">root</systemitem> user, execute the
416                                         <command>ejabberdctl</command> utility as shown below to register and create passwords
417                                         for the two users on each domain. Note that the users correspond to those configured
418                                         in the file <filename>/openils/conf/opensrf_core.xml</filename>  in the next steps.</para>
419                                         <programlisting language="xml"><![CDATA[
420 # The syntax for registering a user with ejabberdctl is:
421 #    ejabberdctl register <user> <domain> <password>
422 #
423 ejabberdctl register router  private.localhost <password #1>
424 ejabberdctl register router  public.localhost  <password #1>
425 ejabberdctl register opensrf private.localhost <password #2>
426 ejabberdctl register opensrf public.localhost  <password #2>
427 ]]></programlisting>
428                                 </step>
429                                 <step>
430                                         <title>Create configuration files</title>
431                                         <para>As the <systemitem class="username">opensrf</systemitem> user, execute
432                                         the following commands to create the new configuration files
433                                         <filename>/openils/conf/opensrf_core.xml</filename> and
434                                         <filename>/openils/conf/opensrf.xml</filename> from the example templates:</para>
435                                         <screen>
436                                                 <userinput>cd /openils/conf</userinput>
437                                                 <userinput>cp opensrf.xml.example      opensrf.xml</userinput>
438                                                 <userinput>cp opensrf_core.xml.example opensrf_core.xml</userinput>
439                                         </screen>
440                                 </step>
441                                 <step>
442                                         <title>Change Jabber usernames and passwords</title>
443                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
444                                         OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>
445                                         and update the Jabber usernames and passwords to match the values shown in the
446                                         following table. The left-hand side of <xref linkend="serversideinstallation-xpath-table-1"/>
447                                         shows common XPath syntax to indicate the approximate position within the XML
448                                         file that needs changes. The right-hand side of the table shows the replacement
449                                         values:</para>
450                                         <table xml:id="serversideinstallation-xpath-table-1">
451                                                 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>
452                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
453                                                         <colspec colname="Xpath" colnum="1" colwidth="1.5*"/>
454                                                         <colspec colname="Value" colnum="2" colwidth="2.0*"/>
455                                                         <thead>
456                                                                 <row>
457                                                                         <entry>XPath location</entry>
458                                                                         <entry>Value</entry>
459                                                                 </row>
460                                                         </thead>
461                                                         <tbody>
462                                                                 <row>
463                                                                         <entry>/config/opensrf/username</entry>
464                                                                         <entry>
465                                                                                 <systemitem class="username">opensrf</systemitem>
466                                                                         </entry>
467                                                                 </row>
468                                                                 <row>
469                                                                         <entry>/config/opensrf/passwd </entry>
470                                                                         <entry>password for
471                                                                         <systemitem class="domainname">private.localhost</systemitem>
472                                                                         <systemitem class="username">opensrf</systemitem> user
473                                                                         </entry>
474                                                                 </row>
475                                                                 <row>
476                                                                         <entry>/config/gateway/username</entry>
477                                                                         <entry>
478                                                                                 <systemitem class="username">opensrf</systemitem>
479                                                                         </entry>
480                                                                 </row>
481                                                                 <row>
482                                                                         <entry>/config/gateway/passwd</entry>
483                                                                         <entry>password for
484                                                                         <systemitem class="domainname">public.localhost</systemitem>
485                                                                         <systemitem class="username">opensrf</systemitem> user
486                                                                         </entry>
487                                                                 </row>
488                                                                 <row>
489                                                                         <entry>/config/routers/router/transport, 
490                                                                         first entry where transport/server == public.localhost: 
491                                                                         username</entry>
492                                                                         <entry>
493                                                                                 <systemitem class="username">router</systemitem>
494                                                                         </entry>
495                                                                 </row>
496                                                                 <row>
497                                                                         <entry>/config/routers/router/transport,
498                                                                         first entry where transport/server == public.localhost: 
499                                                                         password</entry>
500                                                                         <entry>password for 
501                                                                         <systemitem class="domainname">public.localhost</systemitem>
502                                                                         <systemitem class="username">router</systemitem> user
503                                                                         </entry>
504                                                                 </row>
505                                                                 <row>
506                                                                         <entry>/config/routers/router/transport,
507                                                                         second entry where transport/server == private.localhost:
508                                                                         username</entry>
509                                                                         <entry>
510                                                                                 <systemitem class="username">router</systemitem>
511                                                                         </entry>
512                                                                 </row>
513                                                                 <row>
514                                                                         <entry>/config/routers/router/transport,
515                                                                         second entry where transport/server == private.localhost:
516                                                                         password</entry>
517                                                                         <entry>password for 
518                                                                         <systemitem class="domainname">private.localhost</systemitem>
519                                                                         <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 example with the keyword
758                                         corresponding to the name of the <systemitem class="osname">Linux</systemitem>
759                                         distribution listed in the distribution keywords table 
760                                         <xref linkend="serversideinstallation-keywords-evergreen"/> .</para>
761                                         <screen>
762                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
763                                                 <userinput>make -f Open-ILS/src/extras/Makefile.install [DISTRIBUTION]</userinput>
764                                         </screen>
765                                         <table xml:id="serversideinstallation-keywords-evergreen">
766                                                 <title>Keyword Targets for Evergreen <application>"make"</application> Command</title>
767                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
768                                                         <colspec colnum="1" colwidth="1.0*"/>
769                                                         <colspec colnum="2" colwidth="3.0*"/>
770                                                         <thead>
771                                                                 <row>
772                                                                         <entry>Keyword</entry>
773                                                                         <entry>Description</entry>
774                                                                 </row>
775                                                         </thead>
776                                                         <tbody>
777                                                                 <row>
778                                                                         <entry>debian-etch</entry>
779                                                                         <entry>for Debian Etch (4.0)</entry>
780                                                                 </row>
781                                                                 <row>
782                                                                         <entry>debian-lenny</entry>
783                                                                         <entry>for Debian Lenny (5.0)</entry>
784                                                                 </row>
785                                                                 <row>
786                                                                         <entry>ubuntu-hardy</entry>
787                                                                         <entry>for Ubuntu Hardy Heron (8.04)</entry>
788                                                                 </row>
789                                                                 <row>
790                                                                         <entry>ubuntu-karmic</entry>
791                                                                         <entry>for Ubuntu Karmic Koala (9.10)</entry>
792                                                                 </row>
793                                                                 <row>
794                                                                         <entry>ubuntu-karmic</entry>
795                                                                         <entry>for Ubuntu Lucid Lynx (10.04)</entry>
796                                                                 </row>
797                                                         </tbody>
798                                                 </tgroup>
799                                         </table>
800                                 </step>
801                                 <step performance="optional" xml:id="serversideinstallation-postgresql-default">
802                                         <title>(OPTIONAL) Install the PostgreSQL Server</title>
803                                         <indexterm>
804                                                 <primary>databases</primary>
805                                                 <secondary>PostgreSQL</secondary>
806                                         </indexterm>
807                                         <para>Since the PostgreSQL server is usually a standalone server in multi-server
808                                         production systems, the prerequisite installer Makefile in the previous step
809                                         does not automatically install PostgreSQL. You must install the PostgreSQL server
810                                         yourself, either on the same system as Evergreen itself or on another system.
811                                         If your PostgreSQL server is on a different system, just skip this step.</para>
812                                         <para>For further information on manually installing PostgreSQL, visit the official
813                                         <link xl:href="http://www.postgresql.org/">PostgreSQL Site</link>.</para>
814                                         <para>If your PostgreSQL server will be on the same system as your Evergreen
815                                         software, then as the <systemitem class="username">root</systemitem> user
816                                         install the required PostgreSQL server packages:</para>
817                                         <para>For <systemitem class="osname">Debian Lenny</systemitem> and 
818                                         <systemitem class="osname">Ubuntu Hardy (8.04)</systemitem>:</para>
819                                         <screen>
820                                                 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83</userinput>
821                                         </screen>
822                                         <para>For <systemitem class="osname">Ubuntu Karmic (9.10)</systemitem> and
823                                         <systemitem class="osname">Ubuntu Lucid (10.04)</systemitem>:</para>
824                                         <screen>
825                                                 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84</userinput>
826                                         </screen>
827                                         <note>
828                                                 <para>PostgreSQL versions 8.3 or 8.4 are the recommended versions to work 
829                                                 with Evergreen 1.6. If you have an older version of PostgreSQL, you should
830                                                 upgrade before installing Evergreen. To find the running version of
831                                                 PostgreSQL, as the <systemitem class="username">postgres</systemitem> 
832                                                 user, run the <command>psql</command>. Then type <userinput>SELECT
833                                                 version();</userinput> to get detailed information about your version 
834                                                 of PostgreSQL.</para>
835                                         </note>
836                                 </step>
837                                 <step performance="optional">
838                                         <title>Install Perl Modules on PostgreSQL Server</title>
839                                         <para>If PostgreSQL is running on the same system as your Evergreen software,
840                                         then the Perl modules will automatically be available. Just skip this step.
841                                         Otherwise, continue if your PostgreSQL server is running on another system.</para>
842                                         <para>You will need to install several Perl modules on the other system. As the
843                                         <systemitem class="username">root</systemitem> user install the following Perl
844                                         modules:</para>
845                                         <screen>
846                                                 <userinput># first, ensure the gcc compiler is installed:</userinput>
847                                                 <userinput>apt-get install gcc</userinput>
848                                                 <userinput># then install the Perl modules:</userinput>
849                                                 <userinput>perl -MCPAN -e shell</userinput>
850                                                 <prompt>cpan></prompt>
851                                                 <userinput>install JSON::XS</userinput>
852                                                 <prompt>cpan></prompt>
853                                                 <userinput>install MARC::Record</userinput>
854                                                 <prompt>cpan></prompt>
855                                                 <userinput>install MARC::File::XML</userinput>
856                                         </screen>
857                                         <para>For more information on installing Perl Modules vist the official
858                                         <link xl:href="http://www.cpan.org/">CPAN</link> site.</para>
859                                         <indexterm>
860                                                 <primary>Perl</primary>
861                                                 <secondary>CPAN</secondary>
862                                         </indexterm>
863                                 </step>
864                                 <step>
865                                         <title>Update the System Dynamic Library Path</title>
866                                         <para>You must update the system dynamic library path to force your system to
867                                         recognize the newly installed libraries. As the <systemitem class="username">root</systemitem>
868                                         user, create a file named /etc/ld.so.conf.d/eg.conf containing the new library paths:</para>
869                                         <programlisting>
870 /usr/local/lib
871 /usr/local/lib/dbd
872 </programlisting>
873                                         <para>Then run the command <command>ldconfig</command> to automatically read the
874                                         file and modify the system dynamic library path:</para>
875                                         <screen>
876                                                 <userinput>ldconfig</userinput>
877                                         </screen>
878                                 </step>
879                                 <step performance="optional">
880                                         <title>Restart the PostgreSQL Server</title>
881                                         <para>If PostgreSQL is running on the same system as the rest of Evergreen, as
882                                         the <systemitem class="username">root</systemitem> user you must restart
883                                         PostgreSQL to re-read the new library paths just configured. If PostgreSQL is
884                                         running on another system, you may skip this step. As the <systemitem class="username">opensrf</systemitem>
885                                         user, execute the following command, where
886                                         <literal>[PGSQL_VERSION]</literal> is your installed PostgreSQL version
887                                         (e.g. <literal>8.3</literal>):</para>
888                                         <screen>
889                                                 <userinput>/etc/init.d/postgresql-[PGSQL_VERSION] restart</userinput>
890                                         </screen>
891                                 </step>
892                                 <step xml:id="serversideinstallation-configure">
893                                         <title>Configure Evergreen</title>
894                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to
895                                         the Evergreen build directory and use the <command>configure</command> and
896                                         <command>make</command> utilities to configure Evergreen so it can be compiled
897                                         and linked in the next step:</para>
898                                         <screen>
899                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
900                                                 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>
901                                                 <userinput>make</userinput>
902                                         </screen>
903                                 </step>
904                                 <step xml:id="serversideinstallation-compilingevergreen"><title>Compile, Link and Install Evergreen</title><para>In this step you will actually compile, link and install Evergreen and the default
905                                         Evergreen Staff Client.</para><para>As the <systemitem class="username">root</systemitem>
906                                         user, return to the Evergreen build directory and use the <command>make</command> utility
907                                         as shown below. The Staff Client will also be automatically built, but you must remember
908                                         to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the Staff
909                                         Client you will use to connect to the Evergreen server.</para><para>For further information on manually building the Staff Client, see 
910                                         <xref linkend="staffclientinstallation-building-staffclient"/>.</para><screen><userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput><userinput>make STAFF_CLIENT_BUILD_ID=rel_1_6_1_2 install</userinput></screen><para>The above commands will create a new subdirectory
911                                         <filename class="directory">/openils/var/web/xul/rel_1_6_1_2</filename> 
912                                         containing the Staff Client.</para> <para>To complete the Staff Client installation, 
913                                         as the <systemitem class="username">root</systemitem> user create a symbolic link 
914                                         named <emphasis>server</emphasis> in the head of the Staff Client directory 
915                                         <filename class="directory">/openils/var/web/xul</filename> that points to the
916                                         subdirectory <filename class="directory">/server</filename> of the new Staff
917                                         Client build:</para><screen><userinput>cd /openils/var/web/xul</userinput><userinput>ln -sf rel_1_6_1_2/server server</userinput></screen></step>
918                                 <step>
919                                         <title>Copy the OpenSRF Configuration Files</title>
920                                         <para>As the <systemitem class="username">root</systemitem> user, copy the
921                                         example OpenSRF configuration files into place. This replaces the configuration
922                                         files that you set up in a previous step when you installed and tested
923                                         OpenSRF. You should also create backup copies of the old files for
924                                         troubleshooting purposes. Finally, change the ownership on the installed files
925                                         to the <systemitem class="username">opensrf</systemitem> user:</para>
926                                         <screen>
927                                                 <userinput>cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml</userinput>
928                                                 <userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput>
929                                                 <userinput>cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml</userinput>
930                                                 <userinput>chown -R opensrf:opensrf /openils/</userinput>
931                                         </screen>
932                                 </step>
933                                 <step>
934                                         <title>Create and Configure PostgreSQL Database</title>
935                                         <indexterm>
936                                                 <primary>databases</primary>
937                                                 <secondary>PostgreSQL</secondary>
938                                         </indexterm>
939                                         <para>In this step you will create the Evergreen database. In the commands
940                                         below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis>
941                                         repository to match your PostgreSQL server
942                                         layout. For example, if you built PostgreSQL from source the path would be
943                                         <filename class="directory">/usr/local/share/contrib</filename>; if you
944                                         installed the PostgreSQL 8.3 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>,
945                                         the path would be 
946                                         <systemitem class="directory">/usr/share/postgresql/8.3/contrib/</systemitem>.</para>
947                                         <substeps>
948                                                 <step>
949                                                         <para>
950                                                                 <emphasis role="bold">Create and configure the database</emphasis>
951                                                         </para>
952                                                         <para>As the <systemitem class="username">postgres</systemitem>
953                                                         user on the PostgreSQL system create the PostgreSQL database,
954                                                         then set some internal paths:</para>
955                                                         <para>Create the database:</para>
956                                                         <screen>
957                                                                 <userinput>createdb -E UNICODE evergreen</userinput>
958                                                                 <userinput>createlang plperl   evergreen</userinput>
959                                                                 <userinput>createlang plperlu  evergreen</userinput>
960                                                                 <userinput>createlang plpgsql  evergreen</userinput>
961                                                         </screen>
962                                                         <para>Adjust the paths as shown, where
963                                                         <literal>[PGSQL_VERSION]</literal> is your installed PostgreSQL
964                                                         version (e.g. <literal>8.3</literal>).</para>
965                                                         <screen>
966                                                                 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/tablefunc.sql evergreen</userinput>
967                                                                 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/tsearch2.sql  evergreen</userinput>
968                                                                 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/pgxml.sql     evergreen</userinput>
969                                                         </screen>
970                                                 </step>
971                                                 <step>
972                                                         <title>Create <systemitem class="username">evergreen</systemitem> PostgreSQL user</title>
973                                                         <para>As the <systemitem class="username">postgres</systemitem>
974                                                         user on the PostgreSQL system, create a new PostgreSQL user
975                                                         named <systemitem class="username">evergreen</systemitem> and
976                                                         assign a password:</para>
977                                                         <screen>
978                                                                 <userinput>createuser -P -s evergreen</userinput>
979                                                                 <prompt>Enter password for new role: MYNEWPASSWORD</prompt>
980                                                                 <prompt>Enter it again: MYNEWPASSWORD</prompt>
981                                                         </screen>
982                                                 </step>
983                                                 <step>
984                                                         <title>Create Database Schema</title>
985                                                         <para>As the <systemitem class="username">root</systemitem>
986                                                         user, create the database schema and configure your system with
987                                                         the corresponding database authentication details for the
988                                                         <emphasis>evergreen</emphasis> database user that you created in
989                                                         the previous step.</para>
990                                                         <para>Enter the following commands and replace
991                                                         <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and
992                                                         <emphasis>DATABASENAME</emphasis> with appropriate
993                                                         values:</para>
994                                                         <screen>
995                                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
996                                                                 <userinput>perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \</userinput>
997                                                                 <userinput>  --service all --create-schema --create-bootstrap --create-offline \</userinput>
998                                                                 <userinput>  --hostname HOSTNAME --port PORT \</userinput>
999                                                                 <userinput>  --user evergreen --password PASSWORD --database DATABASENAME</userinput>
1000                                                         </screen>
1001                                                         <para>On most systems, <emphasis>HOSTNAME</emphasis> will be
1002                                                         <emphasis role="bold">localhost</emphasis>,
1003                                                         <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>,
1004                                                         and <emphasis>PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> 
1005                                                         will be <emphasis role="bold">evergreen</emphasis>.</para>
1006                                                         <note>
1007                                                                 <para>If you are entering the above command on a single
1008                                                                 line, do not include the <literal>\</literal>
1009                                                                 (backslash) characters. If you are using the
1010                                                                 <command>bash</command> shell, these should only be used
1011                                                                 at the end of a line at a bash prompt to indicate that
1012                                                                 the command is continued on the next line.</para>
1013                                                         </note>
1014                                                 </step>
1015                                                 <step>
1016                                                         <title>Configure the Apache web server</title>
1017                                                         <indexterm>
1018                                                                 <primary>web server</primary>
1019                                                                 <secondary>Apache</secondary>
1020                                                         </indexterm>
1021                                                         <para>In this step you will configure the Apache web server to
1022                                                         support Evergreen software.</para>
1023                                                         <para>First, you must enable some built-in Apache modules and install
1024                                                         some additional Apache configuration files. Then you will create a new
1025                                                         Security Certificate. Finally, you must make several changes to the Apache
1026                                                         configuration file.</para>
1027                                                         <substeps>
1028                                                                 <step>
1029                                                                         <title>Enable the required Apache Modules</title>
1030                                                                         <para>As the <systemitem class="username">root</systemitem> user, enable
1031                                                                         some modules in the Apache server, then copy the
1032                                                                         new configuration files to the Apache server
1033                                                                         directories:</para>
1034                                                                         <screen>
1035                                                                                 <userinput>a2enmod ssl     # enable mod_ssl</userinput>
1036                                                                                 <userinput>a2enmod rewrite # enable mod_rewrite</userinput>
1037                                                                                 <userinput>a2enmod expires # enable mod_expires</userinput>
1038                                                                         </screen>
1039                                                                 </step>
1040                                                                 <step>
1041                                                                         <title>Copy Apache configuration files</title>
1042                                                                         <para>You must copy the Apache configuration
1043                                                                         files from the Evergreen installation dierectory
1044                                                                         to the Apache directory. As the 
1045                                                                         <systemitem class="username">root</systemitem> 
1046                                                                         user, perform the following commands:</para>
1047                                                                         <screen>
1048                                                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
1049                                                                                 <userinput>cp Open-ILS/examples/apache/eg.conf  /etc/apache2/sites-available/</userinput>
1050                                                                                 <userinput>cp Open-ILS/examples/apache/eg_vhost.conf  /etc/apache2/</userinput>
1051                                                                                 <userinput>cp Open-ILS/examples/apache/startup.pl     /etc/apache2/</userinput>
1052                                                                         </screen>
1053                                                                 </step>
1054                                                                 <step>
1055                                                                         <title>Create a Security Certificate</title>
1056                                                                         <para>You must create a new Security Certificate (SSL Key)
1057                                                                         for the Apache server using the <command>openssl</command>
1058                                                                         command. For a public production server you must configure
1059                                                                         or purchase a signed SSL certificate, but for now you can
1060                                                                         just use a self-signed certificate and accept the warnings
1061                                                                         in the Staff Client and browser during testing and
1062                                                                         development. As the
1063                                                                         <systemitem class="username">root</systemitem> user, 
1064                                                                         perform the following commands:</para>
1065                                                                         <screen>
1066                                                                                 <userinput>mkdir /etc/apache2/ssl</userinput>
1067                                                                                 <userinput>cd /etc/apache2/ssl</userinput>
1068                                                                                 <userinput>openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key</userinput>
1069                                                                         </screen>
1070                                                                         <note>
1071                                                                                 <para>This step generates a self-signed SSL
1072                                                                                 certificate. You must install a proper SSL
1073                                                                                 certificate for a public production system to
1074                                                                                 avoid warning messages when users login to their
1075                                                                                 account through the OPAC or when staff login
1076                                                                                 through the staff client.</para>
1077                                                                                 <para>For further information on getting a proper
1078                                                                                 SSL certificate, see
1079                                                                                 <xref linkend="serversideinstallation-ssl"/>.</para>
1080                                                                         </note>
1081                                                                 </step>
1082                                                                 <step xml:id="serversideinstallation-modify-apache">
1083                                                                         <title>Update Apache configuration file</title>
1084                                                                         <para>You must make several changes to the new Apache
1085                                                                         configuration file
1086                                                                         <filename>/etc/apache2/sites-available/eg.conf</filename>. As
1087                                                                         the <systemitem class="username">root</systemitem> user,
1088                                                                         edit the file and make the following changes:</para>
1089                                                                         <itemizedlist>
1090                                                                                 <listitem>
1091                                                                                         <para>Comment out the line <literal>Allow
1092                                                                                         from 10.0.0.0/8</literal> and uncomment
1093                                                                                         the line <literal>Allow from
1094                                                                                         all</literal>.</para>
1095                                                                                         <para>This change allows access to your
1096                                                                                         configuration CGI scripts from 
1097                                                                                         <emphasis role="bold">any</emphasis> workstation on
1098                                                                                         <emphasis role="bold">any</emphasis>
1099                                                                                         network. This is only a temporary change
1100                                                                                         to expedite testing and should be removed
1101                                                                                         after you have finished and successfully
1102                                                                                         tested the Evergreen installation.</para>
1103                                                                                         <warning>
1104                                                                                                 <para>
1105                                                                                                         <emphasis>You must remove these changes
1106                                                                                                 after testing is completed. See 
1107                                                                                                 <xref linkend="serversideinstallation-postinstallation"/>
1108                                                                                                 for further details on removing this change 
1109                                                                                                 after the Evergreen installation is
1110                                                                                                 complete.</emphasis>
1111                                                                                                 </para>
1112                                                                                         </warning>
1113                                                                                 </listitem>
1114                                                                                 <listitem>
1115                                                                                         <para>Comment out the line <literal>Listen
1116                                                                                         443</literal>, since it conflicts with the
1117                                                                                         same declaration in the configuration file:
1118                                                                                         <filename>/etc/apache2/ports.conf</filename>.
1119                                                                                         Note that <systemitem class="osname">Debian
1120                                                                                         </systemitem> users should not do this
1121                                                                                         since the conflict does not apply to that
1122                                                                                         operating system.</para>
1123                                                                                 </listitem>
1124                                                                                 <listitem>
1125                                                                                         <para>The following updates are needed to allow
1126                                                                                         the logs to function properly, but it may break
1127                                                                                         other Apache applications on your server:</para>
1128                                                                                         <para>For the <systemitem class="osname">Linux</systemitem> 
1129                                                                                         distributions <systemitem class="osname">Ubuntu
1130                                                                                         Hardy</systemitem> or
1131                                                                                         <systemitem class="osname">Debian Etch</systemitem>, 
1132                                                                                         as the <systemitem class="username">root</systemitem>
1133                                                                                         user, edit the Apache configuration file
1134                                                                                         <filename>/etc/apache2/apache2.conf</filename> and
1135                                                                                         change the line <literal>User www-data</literal>
1136                                                                                         to <literal>User opensrf</literal>.</para>
1137                                                                                         <para>For the <systemitem class="osname">Linux</systemitem> 
1138                                                                                         distributions <systemitem class="osname">Ubuntu
1139                                                                                         Karmic</systemitem> or 
1140                                                                                         <systemitem class="osname">Ubuntu Lucid</systemitem> 
1141                                                                                         or <systemitem class="osname">Debian
1142                                                                                         Lenny</systemitem>, as the 
1143                                                                                         <systemitem class="username">root</systemitem> 
1144                                                                                         user, edit the Apache configuration file
1145                                                                                         <filename>/etc/apache2/envvars</filename> and
1146                                                                                         change the line <literal>export
1147                                                                                         APACHE_RUN_USER=www-data</literal> to
1148                                                                                         <literal>export
1149                                                                                         APACHE_RUN_USER=opensrf</literal>.</para>
1150                                                                                 </listitem>
1151                                                                         </itemizedlist>
1152                                                                 </step>
1153                                                                 <step>
1154                                                                         <title>Enable the Evergreen web site</title>
1155                                                                         <para>Finally, you must enable the Evergreen web site. As the 
1156                                                                         <systemitem class="username">root</systemitem> user, execute
1157                                                                         the following Apache configuration commands to disable the default
1158                                                                         <emphasis>It Works</emphasis> web page and enable the
1159                                                                         Evergreen web site:</para>
1160                                                                         <screen>
1161                                                                                 <userinput>a2dissite default</userinput>
1162                                                                                 <userinput>a2ensite eg.conf</userinput>
1163                                                                         </screen>
1164                                                                 </step>
1165                                                         </substeps>
1166                                                 </step>
1167                                         </substeps>
1168                                 </step>
1169                                 <step xml:id="serversideinstallation-opensrf-config">
1170                                         <title>Modify the OpenSRF Configuration File</title>
1171                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
1172                                         OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>
1173                                         to update the Jabber usernames and passwords, and to specify the domain from
1174                                         which we will accept and to which we will make connections.</para>
1175                                         <para>If you are installing Evergreen on a single server and using the
1176                                         <systemitem class="domainname">private.localhost</systemitem> / 
1177                                         <systemitem class="domainname">public.localhost</systemitem> domains, 
1178                                         these will already be set to the correct values. Otherwise, search and replace
1179                                         to match your customized values.</para>
1180                                         <para>The left-hand side of  <xref linkend="serversideinstallation-xpath-table-2"/>
1181                                         shows common XPath syntax to indicate the approximate position within the XML
1182                                         file that needs changes. The right-hand side of the table shows the replacement
1183                                         values:</para>
1184                                         <table xml:id="serversideinstallation-xpath-table-2">
1185                                                 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>
1186                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1187                                                         <colspec colname="Xpath" colnum="1" colwidth="1.5*"/>
1188                                                         <colspec colname="Value" colnum="2" colwidth="2.0*"/>
1189                                                         <thead>
1190                                                                 <row>
1191                                                                         <entry>XPath location</entry>
1192                                                                         <entry>Value</entry>
1193                                                                 </row>
1194                                                         </thead>
1195                                                         <tbody>
1196                                                                 <row>
1197                                                                         <entry>/config/opensrf/username</entry>
1198                                                                         <entry>
1199                                                                                 <systemitem class="username">opensrf</systemitem>
1200                                                                         </entry>
1201                                                                 </row>
1202                                                                 <row>
1203                                                                         <entry>/config/opensrf/passwd </entry>
1204                                                                         <entry>password for
1205                                                                         <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">opensrf</systemitem> user
1206                                                                         </entry>
1207                                                                 </row>
1208                                                                 <row>
1209                                                                         <entry>/config/gateway/username</entry>
1210                                                                         <entry>
1211                                                                                 <systemitem class="username">opensrf</systemitem>
1212                                                                         </entry>
1213                                                                 </row>
1214                                                                 <row>
1215                                                                         <entry>/config/gateway/passwd</entry>
1216                                                                         <entry>password for
1217                                                                         <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">opensrf</systemitem> user
1218                                                                         </entry>
1219                                                                 </row>
1220                                                                 <row>
1221                                                                         <entry>/config/routers/router/transport, 
1222                                                                         first entry where transport/server == public.localhost: 
1223                                                                         username</entry>
1224                                                                         <entry>
1225                                                                                 <systemitem class="username">router</systemitem>
1226                                                                         </entry>
1227                                                                 </row>
1228                                                                 <row>
1229                                                                         <entry>/config/routers/router/transport,
1230                                                                         first entry where transport/server == public.localhost: 
1231                                                                         password</entry>
1232                                                                         <entry>password for 
1233                                                                         <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">router</systemitem> user
1234                                                                         </entry>
1235                                                                 </row>
1236                                                                 <row>
1237                                                                         <entry>/config/routers/router/transport,
1238                                                                         second entry where transport/server == private.localhost:
1239                                                                         username</entry>
1240                                                                         <entry>
1241                                                                                 <systemitem class="username">router</systemitem>
1242                                                                         </entry>
1243                                                                 </row>
1244                                                                 <row>
1245                                                                         <entry>/config/routers/router/transport,
1246                                                                         second entry where transport/server == private.localhost:
1247                                                                         password</entry>
1248                                                                         <entry>password for 
1249                                                                         <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">router</systemitem> user
1250                                                                         </entry>
1251                                                                 </row>
1252                                                         </tbody>
1253                                                 </tgroup>
1254                                         </table>
1255                                 </step>
1256                                 <step xml:id="serversideinstallation-srfsh">
1257                                         <title>Create Configuration Files for Users Needing <command>srfsh</command></title>
1258                                         <para>The software installation will automatically create a utility named
1259                                         <command>srfsh</command> (surf shell). This is a command line diagnostic tool
1260                                         for testing and interacting with the OpenSRF network software. It will be used
1261                                         in a future step to complete and test the Evergreen installation. See 
1262                                         <xref linkend="serversideinstallation-testing"/> for further information.</para>
1263                                         <para>In this section you will set up a special configuration file for each user
1264                                         who will need to run the utility. Copy the short sample configuration file
1265                                         <filename>/openils/conf/srfsh.xml.example</filename> to the file
1266                                         <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of
1267                                         each user who will use <command>srfsh</command>. Finally, edit each user's
1268                                         <filename>.srfsh.xml</filename> file and make the following changes:</para>
1269                                         <substeps>
1270                                                 <step>
1271                                                         <para>Modify <emphasis role="bold">domain</emphasis> to be the
1272                                                         router hostname (following our domain examples, 
1273                                                         <systemitem class="domainname">private.localhost</systemitem>>
1274                                                          will give <command>srfsh</command> access to all OpenSRF services,
1275                                                         while <systemitem class="domainname">public.localhost</systemitem>
1276                                                         will only allow access to those OpenSRF services that are
1277                                                         publicly exposed).</para>
1278                                                 </step>
1279                                                 <step>
1280                                                         <para>Modify <emphasis role="bold">username</emphasis> and
1281                                                         <emphasis role="bold">password</emphasis> to match the
1282                                                         <systemitem class="username">opensrf</systemitem> Jabber user
1283                                                         for the chosen domain.</para>
1284                                                 </step>
1285                                                 <step>
1286                                                         <para>Modify <emphasis role="bold">logfile</emphasis> to be the
1287                                                         full path for a log file to which the user has write
1288                                                         access.</para>
1289                                                 </step>
1290                                                 <step>
1291                                                         <para>Modify <emphasis role="bold">loglevel</emphasis> as needed
1292                                                         for testing.</para>
1293                                                 </step>
1294                                         </substeps>
1295                                         <programlisting language="xml"><![CDATA[
1296 <?xml version="1.0"?>
1297 <!-- This file follows the standard bootstrap config file layout -->
1298 <!-- found in opensrf_core.xml -->
1299 <srfsh>
1300 <router_name>router</router_name>
1301 <domain>private.localhost</domain>
1302 <username>opensrf</username>
1303 <passwd>evergreen</passwd>
1304 <port>5222</port>
1305 <logfile>/tmp/srfsh.log</logfile>
1306 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
1307 <loglevel>4</loglevel>
1308 </srfsh>
1309 ]]></programlisting>
1310                                 </step>
1311                                 <step xml:id="serversideinstallation-opensrf-env">
1312                                         <title>Modify the OpenSRF Environment</title>
1313                                         <para>Modify the shell configuration file <filename>~/.bashrc</filename> for
1314                                         user <systemitem class="username">opensrf</systemitem> by adding a Perl environmental
1315                                         variable, then execute the shell configuration file to load the new variables into
1316                                         your current environment.</para>
1317                                         <note>
1318                                                 <para>
1319                                                         <emphasis>In a multi-server environment, you must add any
1320                                                         modifications to <filename>~/.bashrc</filename> to the top of
1321                                                         the file <emphasis>before</emphasis> the line 
1322                                                         <literal>[ -z "$PS1" ] &amp;&amp; return </literal>.
1323                                                         This will allow headless (scripted) logins to load the correct
1324                                                         environment.</emphasis>
1325                                                 </para>
1326                                         </note>
1327                                         <screen>
1328                                                 <userinput>echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc</userinput>
1329                                                 <userinput>. ~/.bashrc</userinput>
1330                                         </screen>
1331                                 </step>
1332                                 <step>
1333                                         <title>(OPTIONAL) Enable and Disable Language Localizations</title>
1334                                         <para>You can load translations such as Armenian (hy-AM), Canadian French
1335                                         (fr-CA), and others into the database to complete the translations available in
1336                                         the OPAC and staff client. For further information, see <xref linkend="localization"/>.</para>
1337                                 </step>
1338                         </procedure>
1339                 </section>
1340                 <section xml:id="serversideinstallation-starting">
1341                         <title>Starting Evergreen</title>
1342                         <procedure>
1343                                 <step>
1344                                         <para>As the <systemitem class="username">root</systemitem>
1345                                         user, start the <systemitem class="service">ejabberd</systemitem> and 
1346                                         <systemitem class="service">memcached</systemitem> services
1347                                          (if they are not already running):</para>
1348                                         <screen>
1349                                                 <userinput>/etc/init.d/ejabberd start</userinput>
1350                                                 <userinput>/etc/init.d/memcached start</userinput>
1351                                         </screen>
1352                                 </step>
1353                                 <step>
1354                                         <para>As the <systemitem class="username">opensrf</systemitem>
1355                                         user, start Evergreen.</para>
1356                                         <para>Use the flag <option>-l</option> to force Evergreen to use
1357                                         <systemitem class="domainname">localhost</systemitem> (your
1358                                         current system) as the hostname. Using the
1359                                         <option>start_all</option> option will start the OpenSRF
1360                                         <systemitem class="service">router</systemitem> , 
1361                                         <systemitem class="service">Perl</systemitem> , and
1362                                         <systemitem class="service">C</systemitem> services:</para>
1363                                         <screen>
1364                                                 <userinput>$ osrf_ctl.sh -l -a start_all</userinput>
1365                                         </screen>
1366                                         <note>
1367                                                 <para>
1368                                                         <emphasis>You can also start Evergreen 
1369                                                         <emphasis role="bold">without</emphasis> 
1370                                                         the <option>-l</option> flag, but the
1371                                                         <command>osrf_ctl.sh</command> utility must know
1372                                                         the fully qualified domain name for the system
1373                                                         on which it will execute. That hostname may have
1374                                                         been specified in the configuration file
1375                                                         <filename>opensrf.xml</filename>, which you
1376                                                         configured in a previous step.</emphasis>
1377                                                 </para>
1378                                                 <para>Use the <command>hostname</command> command to
1379                                                 determine the fully qualified domain name of your
1380                                                 system.</para>
1381                                         </note>
1382                                         <itemizedlist>
1383                                                 <listitem>
1384                                                         <para>If you receive an error message similar to
1385                                                         <emphasis>osrf_ctl.sh: command not found</emphasis>,
1386                                                         then your environment variable
1387                                                         <envar>PATH</envar> does not include the directory
1388                                                         <filename class="directory">/openils/bin</filename>.
1389                                                         As the                                                          
1390                                                         <systemitem class="username">opensrf</systemitem>
1391                                                         user, edit the configuration file
1392                                                         <filename>/home/opensrf/.bashrc</filename> and
1393                                                         add the following line:
1394                                                         <literal>export PATH=$PATH:/openils/bin</literal></para>
1395                                                 </listitem>
1396                                                 <listitem>
1397                                                         <para>If you receive an error message similar to
1398                                                         <emphasis>Can't locate OpenSRF/System.pm in
1399                                                         @INC ... BEGIN failed--compilation
1400                                                         aborted</emphasis>, then your environment variable
1401                                                         <emphasis role="bold">PERL5LIB</emphasis> does not
1402                                                          include the directory
1403                                                         <filename class="directory">/openils/lib/perl5</filename>.
1404                                                         As the
1405                                                         <systemitem class="username">opensrf</systemitem> 
1406                                                         user, edit the configuration file
1407                                                         <filename>/home/opensrf/.bashrc</filename> and
1408                                                         add the following line:
1409                                                         <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>
1410                                                 </listitem>
1411                                         </itemizedlist>
1412                                 </step>
1413                                 <step>
1414                                         <para>As the <systemitem class="username">opensrf</systemitem>
1415                                         user, generate the Web files needed by the Staff Client and
1416                                         catalog, and calculate the proximity of locations in the
1417                                         Organizational Unit tree (which allows
1418                                         <emphasis>Holds</emphasis> to work properly):</para>
1419                                         <screen>
1420                                                 <userinput>cd /openils/bin</userinput>
1421                                                 <userinput>./autogen.sh -c /openils/conf/opensrf_core.xml -u</userinput>
1422                                                 <computeroutput>
1423 Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
1424 Updating fieldmapper
1425 </computeroutput>
1426                                         </screen>
1427                                         <para>You must do this the first time you start Evergreen, and
1428                                         after making any changes to the library hierarchy.</para>
1429                                 </step>
1430                                 <step>
1431                                         <para>As the <systemitem class="username">root</systemitem>
1432                                         user, restart the Apache Web server:</para>
1433                                         <screen>
1434                                                 <userinput>/etc/init.d/apache2 restart</userinput>
1435                                         </screen>
1436                                         <note>
1437                                                 <para>If the Apache Web server was running when you
1438                                                 started the OpenSRF services, you might not be able to
1439                                                 successfully log in to the OPAC or Staff Client until
1440                                                 the Apache Web server is restarted.</para>
1441                                         </note>
1442                                 </step>
1443                         </procedure>
1444                 </section>
1445                 <section xml:id="serversideinstallation-testing">
1446                         <title>Testing the Installation</title>
1447                         <para>This section describes several simple tests you can perform to verify that the Evergreen
1448                         server-side software has been installed and configured properly and is running as
1449                         expected.</para>
1450                         <simplesect xml:id="serversideinstallation-testing-connections">
1451                                 <title>Testing Connections to Evergreen</title>
1452                                 <para>Once you have installed and started Evergreen, test your connection to
1453                                 Evergreen. As the <systemitem class="username">opensrf</systemitem> user start the
1454                                 <command>srfsh</command> application and try logging onto the Evergreen server using the
1455                                 default administrator username and password. Following is sample output generated by
1456                                 executing <command>srfsh</command> after a successful Evergreen installation.
1457                                 For help with <command>srfsh</command> commands, type <userinput>help</userinput>
1458                                 at the prompt:</para>
1459                                 <screen>
1460                                         <userinput>/openils/bin/srfsh</userinput>
1461                                         <prompt>srfsh%</prompt>
1462                                         <userinput>login admin open-ils</userinput>
1463                                         <prompt>Received Data: "250bf1518c7527a03249858687714376"</prompt>
1464                                         <prompt>------------------------------------</prompt>
1465                                         <prompt>Request Completed Successfully</prompt>
1466                                         <prompt>Request Time in seconds: 0.045286</prompt>
1467                                         <prompt>------------------------------------</prompt>
1468                                         <prompt>Received Data: {</prompt>
1469                                         <prompt>   "ilsevent":0,</prompt>
1470                                         <prompt>   "textcode":"SUCCESS",</prompt>
1471                                         <prompt>   "desc":" ",</prompt>
1472                                         <prompt>   "pid":21616,</prompt>
1473                                         <prompt>   "stacktrace":"oils_auth.c:304",</prompt>
1474                                         <prompt>   "payload":{</prompt>
1475                                         <prompt>      "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",</prompt>
1476                                         <prompt>      "authtime":420</prompt>
1477                                         <prompt>   }</prompt>
1478                                         <prompt>}</prompt>
1479                                         <prompt>------------------------------------</prompt>
1480                                         <prompt>Request Completed Successfully</prompt>
1481                                         <prompt>Request Time in seconds: 1.336568</prompt>
1482                                         <prompt>------------------------------------</prompt>
1483                                 </screen>
1484                                 <para>If this does not work, try the following:</para>
1485                                 <itemizedlist>
1486                                         <listitem>As the <systemitem class="username">opensrf</systemitem> user, run the
1487                                         script <filename>Open-ILS/src/support-scripts/settings-tester.pl</filename> to
1488                                         see if it finds any system configuration problems. If the output of
1489                                         <command>settings-tester.pl</command> does not help you find the problem, please
1490                                         do not make any significant changes to your configuration.</listitem>
1491                                         <listitem>Follow the steps in the troubleshooting guide in 
1492                                         <xref linkend="troubleshooting"/>.</listitem>
1493                                         <listitem>If you have followed the entire set of installation steps listed here
1494                                         closely, you are probably extremely close to a working system. Gather your
1495                                         configuration files and log files and contact the 
1496                                         <ulink url="http://open-ils.org/listserv.php">Evergreen Development Mailing List</ulink>
1497                                         list for assistance before making any drastic changes to your
1498                                         system configuration.</listitem>
1499                                 </itemizedlist>
1500                         </simplesect>
1501                 </section>
1502                 <section xml:id="serversideinstallation-virtual">
1503                         <title>Installing In Virtualized <systemitem class="osname">Linux</systemitem> Environments</title>
1504                         <para>This section describes the installation of Evergreen software in so-called "virtualized"
1505                         software environments. Evergreen software runs as a native application on any of several
1506                         well-known x86 (32-bit) and x86-64 (64-bit) <systemitem class="osname">Linux</systemitem>
1507                         distributions including <systemitem class="osname">Ubuntu</systemitem> and 
1508                         <systemitem class="osname">Debian</systemitem> but it does not run as a native application 
1509                         on the <systemitem class="osname">Microsoft Windows</systemitem> operating system. 
1510                         However, it is possible to execute Evergreen on a <systemitem class="osname">Windows</systemitem> 
1511                         host system by running it within a virtual Linux-guest installation, which itself executes 
1512                         on the <systemitem class="osname">Windows</systemitem> system. 
1513                         The <systemitem class="osname">Linux</systemitem> environment is fully emulated and acts 
1514                         (within limits) just as if it were executing on a real standalone system.</para>
1515                         <para>This technique of emulating a <systemitem class="osname">Linux</systemitem> environment on
1516                         a <systemitem class="osname">Windows</systemitem> host is a practical way to install and run an
1517                         Evergreen system if it is not possible to dedicate a physical machine solely as a 
1518                         <systemitem class="osname">Linux</systemitem> host for Evergreen. This architecture is not
1519                         recommended for large scale systems since there are performance limitations to running Evergreen
1520                         in a virtualized environment. However, it is a reasonable architecture for smaller experimental
1521                         systems, as a proof of concept, or as a conference-room pilot.</para>
1522                         <simplesect>
1523                                 <title>Installing Virtualization Software</title>
1524                                 <para>As described above, Evergreen can be installed on top of an emulated
1525                                 <systemitem class="osname">Linux</systemitem> environment. The 
1526                                 <systemitem class="osname">Linux</systemitem> environment, in turn, is installed 
1527                                 on top of a software application such as <application>"VirtualBox"</application>,
1528                                 <application>"VMware"</application> or <application>"VirtualPC"</application> which must
1529                                 first be installed on the <systemitem class="osname">Windows</systemitem> system. This
1530                                 section contains step-by-step examples that show installing popular virtualization
1531                                 applications on a <systemitem class="osname">Windows</systemitem> host system. Following
1532                                 this section are further descriptions of installing 
1533                                 <systemitem class="osname">Linux</systemitem> and Evergreen systems using that 
1534                                 virtualization software.</para>
1535                                 <simplesect>
1536                                         <title>Installing <application>"VirtualBox"</application> Virtualization Software</title>
1537                                         <para>This section reviews installation of the
1538                                         <application>"VirtualBox"</application> application on 
1539                                         <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. 
1540                                         Download the latest edition of <application>VirtualBox</application> from their official website: 
1541                                         <link xl:href="http://virtualbox.org" xl:title="virtual box">http://virtualbox.org</link>
1542                                         and follow the on screen instructions to install the software.</para>
1543                                 </simplesect>
1544                                 <simplesect>
1545                                         <title>Installing VMware Virtualization Software</title>
1546                                         <indexterm>
1547                                                 <primary>virtualization software</primary>
1548                                                 <secondary>VMware</secondary>
1549                                         </indexterm>
1550                                         <para>This section reviews installation of the
1551                                         <application>"VMware"</application> application on
1552                                         <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. 
1553                                         Find and Download the free virtual machine software of from the VMware
1554                                         official website:
1555                                         <ulink url="http://downloads.vmware.com">http://downloads.vmware.com</ulink> 
1556                                         and follow the on-screen instructions.</para>
1557                                 </simplesect>
1558                         </simplesect>
1559                         <simplesect xml:id="serversideinstallation-virtual-install-linux-ev">
1560                                 <title>Installing <systemitem class="osname">Linux</systemitem> / 
1561                                                 Evergreen on Virtualization Software</title>
1562                                 <para>After the virtualization software is installed and running, there are two ways to
1563                                 continue with installing <systemitem class="osname">Linux</systemitem> and Evergreen
1564                                 software in the new virtualized environment:</para>
1565                                 <orderedlist>
1566                                         <listitem>
1567                                                 <para>Download and install a prebuilt software image that contains a
1568                                                 working <systemitem class="osname">Linux</systemitem> / Evergreen system
1569                                                 (see <xref linkend="serversideinstall-virtual-prebuilt"/> for
1570                                                 details)</para>
1571                                         </listitem>
1572                                         <listitem>
1573                                                 <para>Manually install a <systemitem class="osname">Linux</systemitem>
1574                                                 guest system, then manually install Evergreen on it (see 
1575                                                 <xref linkend="serversideinstall-virtual-manual"/> for details)</para>
1576                                         </listitem>
1577                                 </orderedlist>
1578                                 <para>We review each method in the following sections.</para>
1579                                 <simplesect xml:id="serversideinstall-virtual-prebuilt">
1580                                         <title>Download and install a prebuilt software image</title>
1581                                         <para>You can download a prebuilt software image that, when installed with your
1582                                         virtualization software, emulates a 
1583                                         <systemitem class="osname">Linux</systemitem> guest system containing a running 
1584                                         Evergreen distribution. The image is essentially a snapshot of a hard disk from
1585                                         a fully configured, functional <systemitem class="osname">Linux</systemitem>
1586                                         system with Evergreen already installed.</para>
1587                                         <para>We recommend this approach if you wish to get Evergreen running quickly
1588                                         with minimal attention to configuration. After reviewing only a few
1589                                         configuration details you can have a working Evergreen system that integrates
1590                                         smoothly with the rest of your network. See 
1591                                         <xref linkend="serversideinstall-virtual-versions"/> for a list of prebuilt 
1592                                         software images that are currently available to download and install</para>
1593                                         <note>DISCLAIMER: The following virtual images have been contributed by members
1594                                         of the Evergreen community for the purposes of testing, evaluation, training,
1595                                         and development.</note>
1596                                         <table xml:id="serversideinstall-virtual-versions">
1597                                                 <title>Linux / Evergreen Virtual Images</title>
1598                                                 <tgroup align="left" cols="4" colsep="1" rowsep="1">
1599                                                         <colspec colnum="1" colwidth="1.0*"/>
1600                                                         <colspec colnum="2" colwidth="1.0*"/>
1601                                                         <colspec colnum="3" colwidth="3.0*"/>
1602                                                         <colspec colnum="4" colwidth="1.0*"/>
1603                                                         <thead>
1604                                                                 <row>
1605                                                                         <entry>Linux Version</entry>
1606                                                                         <entry>Evergreen Version</entry>
1607                                                                         <entry>Image</entry>
1608                                                                         <entry>Comments</entry>
1609                                                                 </row>
1610                                                         </thead>
1611                                                         <tbody>
1612                                                                 <row>
1613                                                                         <entry>Debian lenny (5.0)</entry>
1614                                                                         <entry>1.6.0.1</entry>
1615                                                                         <entry>
1616                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen1601_DebianLenny.zip"> download </ulink>
1617                                                                         </entry>
1618                                                                         <entry>VirtualBox image</entry>
1619                                                                 </row>
1620                                                                 <row>
1621                                                                         <entry>Ubuntu karmic koala (9.10)</entry>
1622                                                                         <entry>1.6.0.0</entry>
1623                                                                         <entry>
1624                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen-1600-Karmic.zip"> download </ulink>
1625                                                                         </entry>
1626                                                                         <entry>VirtualBox image</entry>
1627                                                                 </row>
1628                                                         </tbody>
1629                                                 </tgroup>
1630                                         </table>
1631                                         <procedure>
1632                                                 <title>VirtualBox Example</title>
1633                                                 <indexterm>
1634                                                         <primary>virtualization software</primary>
1635                                                         <secondary>VirtualBox</secondary>
1636                                                 </indexterm>
1637                                                 <step>
1638                                                         <para>Start VirtualBox for the first time and select
1639                                                         <menuchoice><guimenu>File</guimenu><guimenuitem>VirtualBox Media
1640                                                         Manager</guimenuitem><guimenuitem>Add</guimenuitem></menuchoice>
1641                                                         to locate the prebuilt software image just downloaded (the
1642                                                         example shows it was extracted from the original
1643                                                         <filename class="extension">zip</filename> file into a temporary directory
1644                                                         <filename class="directory">C:\temp</filename>).</para>
1645                                                 </step>
1646                                                 <step>
1647                                                         <para>After selecting the file, click <guibutton>Open</guibutton> to import it.</para>
1648                                                 </step>
1649                                                 <step>
1650                                                         <para>Then click <guibutton>OK</guibutton> to save the selection
1651                                                         and return to the VirtualBox Media Manager</para>
1652                                                 </step>
1653                                                 <step>
1654                                                         <para>Click <guibutton>New</guibutton>, then <guibutton>Next</guibutton> to continue
1655                                                         and create a new virtual machine (VM).</para>
1656                                                 </step>
1657                                                 <step>
1658                                                         <para>Create a new name for the VM and set the operating system
1659                                                         type, then click <guibutton>Next</guibutton>.</para>
1660                                                 </step>
1661                                                 <step>
1662                                                         <para>Set the memory size (at least 512Mb),
1663                                                         then click <guibutton>Next</guibutton>.</para>
1664                                                 </step>
1665                                                 <step>
1666                                                         <para>Edit the Virtual Hard Disk configuration settings; click
1667                                                         the radio boxes <guilabel>Boot Hard Disk</guilabel> and
1668                                                         <guilabel>Use existing hard disk</guilabel>
1669                                                         and ensure that the disk name <guilabel>Evergreen1601_DebianLenny.vmdk</guilabel>
1670                                                         is selected. Click <guibutton>Finish</guibutton> to finish the
1671                                                         setup.</para>
1672                                                 </step>
1673                                                 <step>
1674                                                         <para>Install the <application>VirtualBox Guest
1675                                                         Additions</application> (really a required upgrade to
1676                                                         VirtualBox)</para>
1677                                                 </step>
1678                                                 <step>
1679                                                         <para>Return to VirtualBox and see the summary of the VM just
1680                                                         created. Click <guibutton>Start</guibutton> to boot the new VM.</para>
1681                                                 </step>
1682                                                 <step>
1683                                                         <para>See the start of the <systemitem class="osname">Linux</systemitem>
1684                                                         boot sequence. Choose <guimenuitem>Debian Gnu/Linux, kernel
1685                                                         2.6.26-2-686</guimenuitem> from the startup menu and click
1686                                                         <guibutton>Enter</guibutton> to start 
1687                                                         <systemitem class="osname">Linux</systemitem> and Evergreen. 
1688                                                         After some delay you should see the command line prompt 
1689                                                         <prompt>debian-lenny login:</prompt>. Log in with username
1690                                                         <userinput>root</userinput> and password <userinput>evergreen</userinput>
1691                                                         to continue.</para>
1692                                                 </step>
1693                                         </procedure>
1694                                 </simplesect>
1695                         </simplesect>
1696                 </section>
1697         </section>
1698 </chapter>