replace image in section "Testing with" with <programlisting/...
[working/Evergreen.git] / 1.6 / admin / ServersideInstallation.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter xml:id="ServersideInstallation" xmlns="" xmlns:xi="" xmlns:xl="">
3         <info>
4                 <title>Server-side Installation of Evergreen Software</title>
5                 <abstract>
6                         <para>This section describes installation of the Evergreen server-side software and its associated components. Installation, configuration, testing and verification of the software is straightforward if you follow some simple directions.</para>
7                 </abstract>
8         </info>
9         <section xml:id="serversideinstallation-overview">
10                 <title>Overview</title>
11                 <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current stable software release. See <xref linkend="serversideinstallation-all"/> for instructions tailored to installing on some particular distributions of the <systemitem class="osname">Linux</systemitem> operating system. Earlier software distributions are described in <xref linkend="serversideinstallation-previousversions"/>.</para>
12                 <para>The current version of the Evergreen server-side software runs as a native application on any of several well-known <systemitem class="osname">Linux</systemitem> distributions (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). It does not currently run as a native application on the <systemitem class="osname">Microsoft Windows</systemitem> operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can still be installed and run on <systemitem class="osname">Windows</systemitem> via a so-called <emphasis>virtualized</emphasis> Unix-guest Operating System (using, for example, <application>VirtualBox</application>, or <application>VMware</application>, or <application>VirtualPC</application> to emulate a <systemitem class="osname">Linux</systemitem> environment). It can also be installed to run on other <systemitem class="osname">Linux</systemitem> systems via virtualized environments (using, for example, <application>VirtualBox</application> or <application>VMware</application>). More information on virtualized environments can be found in <xref linkend="serversideinstallation-virtual"/>.</para>
13                 <para>Installation of some sub-components of the Evergreen server-side software is mentioned only in abbreviated form in this section. More detailed information is available in <xref linkend="serversideinstallation-postgresql"/> and <xref linkend="serversideinstallation-apache"/>.</para>
14                 <para>Finally, installation of the Evergreen Staff Client software is reviewed in <xref linkend="serversideinstallation-staffclient"/>. </para>
15                 <section>
16                         <title>Evergreen Software Dependencies</title>
17                         <para>The Evergreen server-side software has dependencies on particular versions of certain major software sub-components. Successful installation of Evergreen software requires that software versions agree with those listed here:</para>
18                         <table>
19                                 <title>Evergreen Software Dependencies</title>
20                                 <tgroup align="left" cols="3" colsep="1" rowsep="1">
21                                         <thead>
22                                                 <row>
23                                                         <entry>Evergreen</entry>
24                                                         <entry>OpenSRF</entry>
25                                                         <entry>PostgreSQL</entry>
26                                                 </row>
27                                         </thead>
28                                         <tbody>
29                                                 <row>
30                                                         <entry>1.6.x</entry>
31                                                         <entry>1.2</entry>
32                                                         <entry>8.2 / 8.3</entry>
33                                                 </row>
34                                                 <row>
35                                                         <entry>1.4.x</entry>
36                                                         <entry>1.0</entry>
37                                                         <entry>8.1 / 8.2</entry>
38                                                 </row>
39                                                 <row>
40                                                         <entry>1.2.x</entry>
41                                                         <entry>0.9</entry>
42                                                         <entry>8.1 / 8.2</entry>
43                                                 </row>
44                                         </tbody>
45                                 </tgroup>
46                         </table>
47                 </section>
48                 <section>
49                         <title>Current Stable Software Release</title>
50                         <para>The current stable release of Evergreen is version <emphasis><emphasis role="bold"></emphasis></emphasis>. Instructions for installing, configuring and testing that version on the <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> <systemitem class="osname">Linux</systemitem> systems are found in <xref linkend="serversideinstallation-ubuntudebian"/>.</para>
51                         <para>This release of Evergreen software is dependent on the Open Service Request Framework (OpenSRF). The current stable release of OpenSRF is version <emphasis><emphasis role="bold">1.2.2</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in <xref linkend="serversideinstallation-opensrf"/>.</para>
52                 </section>
53                 <section>
54                         <title>Previous Software Releases</title>
55                         <para>Earlier releases of Evergreen are also available. Instructions for installing, configuring and testing earlier versions are found in <xref linkend="serversideinstallation-previousversions"/>.</para>
56                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold"></emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in <xref linkend="serversideinstallation-ubuntudebian-previous"/>.</para>
57                         <para>The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in <xref linkend="serversideinstallation-opensrf-previous"/>.</para>
58                 </section>
59         </section>
60         <section xml:id="serversideinstallation-all">
61                 <title>Installing Server-Side Software</title>
62                 <para>This section describes the installation of the major components of Evergreen server-side software.</para>
63                 <para>As far as possible, you should perform the following steps in the exact order given since the success of many steps relies on the successful completion of earlier steps. You should make backup copies of files and environments when you are instructed to do so. In the event of installation problems those copies can allow you to back out of a step gracefully and resume the installation from a known state. See <xref linkend="adminmisc-backingup"/> for further information.</para>
64                 <para>Of course, after you successfully complete and test the entire Evergreen installation you should take a final snapshot backup of your system(s). This can be the first in the series of regularly scheduled system backups that you should probably also begin.</para>
65                 <section xml:id="serversideinstallation-opensrf">
66                         <title>Installing OpenSRF 1.2.x On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>
67                         <para>This section describes the installation of the latest version of the Open Service Request Framework (OpenSRF), a major component of the Evergreen server-side software, on <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> systems. Evergreen software is integrated with and depends on the OpenSRF software system.</para>
68                         <para>Follow the steps outlined here and run the specified tests to ensure that OpenSRF is properly installed and configured. Do not continue with any further Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>
69                         <note>
70                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) platforms. OpenSRF 1.2.2 has been tested on <systemitem class="osname">Debian Etch (4.0)</systemitem>, <systemitem class="osname">Debian Lenny</systemitem>, <systemitem class="osname">Ubuntu Hardy Heron (8.04)</systemitem>, and <systemitem class="osname">Ubuntu Intrepid Ibex (8.10)</systemitem>.</para>
71                                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>
72                                 <itemizedlist>
73                                         <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>
74                                         <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>
75                                 </itemizedlist>
76                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue the command <command>exit"</command>.</para>
77                         </note>
78                         <section>
79                                 <title>Add the OpenSRF User</title>
80                                 <para>As the <systemitem class="username">root</systemitem> user, add the opensrf user to the system. The default shell for the new user is automatically set to <command>/bin/bash</command> to inherit a reasonable environment:</para>
81                                 <figure>
82                                         <title>Commands to add <systemitem class="username">opensrf</systemitem> user</title>
83                                         <screen>
84                                         $ su - opensrf
85                                         $ useradd -m -s /bin/bash opensrf
86                                         $ passwd opensrf
87                                         Enter new UNIX password: ******
88                                         Retype new UNIX password: ******
89                                         passwd: password updated successfully
90                                         $
91                                         </screen>
92                                 </figure>
93                         </section>
94                         <section>
95                                 <title>Download and Unpack Latest OpenSRF Version</title>
96                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of OpenSRF. The latest version can be found here: <ulink url=""></ulink></para>
97                                 <figure>
98                                         <title>Commands to download and unpack OpenSRF</title>
99                                         <screen>
100                                         $ su - opensrf
101                                         $ wget
102                                         $ tar zxf OpenSRF-1.2.2.tar.gz
103                                         </screen>
104                                 </figure>
105                                 <para>The new directory <filename class="directory">/home/opensrf/OpenSRF-1.2.2</filename> will be created.</para>
106                         </section>
107                         <section>
108                                 <title>Install Prerequisites to Build OpenSRF</title>
109                                 <para>In this section you will install and configure a set of prerequisites that will be used to build OpenSRF. In a following step you will actually build the software using the <command>make</command> utility.</para>
110                                 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-1">"Keywords"</link> figure below.</para>
111                                 <figure>
112                                         <title>Commands to install prerequisites for OpenSRF</title>
113                                         <screen>
114                                         $ su - root
115                                         $ cd /home/opensrf/OpenSRF-1.2.2
116                                         $ make -f src/extras/Makefile.install [DISTRIBUTION]
117                                         ...
118                                         </screen>
119                                 </figure>
120                                 <table xml:id="serversideinstallation-keywords-figure-1">
121                                         <title>Keywords Targets for <application>make</application></title>
122                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
123                                                 <colspec colnum="1" colwidth="1*"/>
124                                                 <colspec colnum="2" colwidth="3*"/>
125                                                 <thead>
126                                                         <row>
127                                                                 <entry>Keyword</entry>
128                                                                 <entry>Description</entry>
129                                                         </row>
130                                                 </thead>
131                                                 <tbody>
132                                                         <row>
133                                                                 <entry>debian-lenny</entry>
134                                                                 <entry>for Debian Lenny (5.0)</entry>
135                                                         </row>
136                                                         <row>
137                                                                 <entry>debian-etch</entry>
138                                                                 <entry>for Debian Etch (4.0)</entry>
139                                                         </row>
140                                                         <row>
141                                                                 <entry>ubuntu-karmic</entry>
142                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
143                                                         </row>
144                                                         <row>
145                                                                 <entry>ubuntu-intrepid</entry>
146                                                                 <entry>for Ubuntu Jaunty (9.04) or Intrepid (8.10)</entry>
147                                                         </row>
148                                                         <row>
149                                                                 <entry>ubuntu-hardy</entry>
150                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
151                                                         </row>
152                                                 </tbody>
153                                         </tgroup>
154                                 </table>
155                                 <indexterm>
156                                         <primary>ZZZ-REVIEW</primary>
157                                         <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>
158                                 </indexterm>
159                                 <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
160                                 <para>This will install a number of packages on the system that are required by OpenSRF, including some Perl modules from CPAN. You can say <literal>No</literal> to the initial CPAN configuration prompt to allow it to automatically configure itself to download and install Perl modules from CPAN. The CPAN installer will ask you a number of times whether it should install prerequisite modules - say <literal>Yes</literal>.</para>
161                         </section>
162                         <section>
163                                 <title>Configure OpenSRF</title>
164                                 <para>As the <systemitem class="username">opensrf</systemitem> user, return to the OpenSRF build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software. You can include the <option>--enable-python</option> and <option>--enable-java</option> configuration options if you wish to include support for Python and Java, respectively:</para>
165                                 <figure>
166                                         <title>Commands to configure OpenSRF</title>
167                                         <screen>
168                                         $ su - opensrf
169                                         $ cd /home/opensrf/OpenSRF-1.2.2
170                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
171                                         $ make
172                                         ...
173                                         </screen>
174                                 </figure>
175                         </section>
176                         <section>
177                                 <title>Compile, Link and Install OpenSRF</title>
178                                 <para>As the <systemitem class="username">root</systemitem> user, return to the OpenSRF build directory and use the <command>make</command> utility to compile, link and install OpenSRF:</para>
179                                 <figure>
180                                         <title>Commands to build, link and install OpenSRF</title>
181                                         <screen>
182                                         $ su - opensrf
183                                         $ cd /home/opensrf/OpenSRF-1.2.2
184                                         $ make install
185                                         ...
186                                         </screen>
187                                 </figure>
188                         </section>
189                         <section>
190                                 <title>Update the System Dynamic Library Path</title>
191                                 <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/</filename> containing a new library path, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>
192                                 <figure>
193                                         <title>Commands to modify system dynamic library path</title>
194                                         <screen>
195                                         $ su - root
196                                         $ echo "/openils/lib" > /etc/
197                                         $ ldconfig
198                                         </screen>
199                                 </figure>
200                         </section>
201                         <section>
202                                 <title>Define Public and Private OpenSRF Domains</title>
203                                 <para>Define your public and private OpenSRF domains. For security purposes, OpenSRF uses Jabber domains to separate services into public and private realms. Throughout these instructions, we will use the example domains <systemitem class="domainname">public.localhost</systemitem> for the public domain and <systemitem class="domainname">private.localhost</systemitem> for the private domain. On a single-server system, the easiest way to define public and private domains is to define separate hostnames by adding entries to the file <filename>/etc/hosts</filename>.</para>
204                                 <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/hosts</filename> and add the following entries for our example domains:</para>
205                                 <figure>
206                                         <title>Example public and private domains in /etc/hosts</title>
207                                         <screen>
208                                      public.localhost        public
209                                      private.localhost       private
210                                         </screen>
211                                 </figure>
212                         </section>
213                         <section>
214                                 <title>Change File Ownerships</title>
215                                 <para>As the <systemitem class="username">root</systemitem> user, change the ownership of files installed in the directory <filename class="directory">/openils</filename> to the <systemitem class="username">opensrf</systemitem> user:</para>
216                                 <figure>
217                                         <title>Commands to change file ownerships</title>
218                                         <screen>
219                                         $ chown -R opensrf:opensrf /openils
220                                         </screen>
221                                 </figure>
222                         </section>
223                         <section>
224                                 <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>
225                                 <para>As the <systemitem class="username">root</systemitem> user, stop the <systemitem class="service">ejabberd</systemitem> service:</para>
226                                 <figure>
227                                         <title>Commands to stop the <systemitem class="service">ejabberd</systemitem> service</title>
228                                         <screen>
229                                         $ /etc/init.d/ejabberd stop
230                                         </screen>
231                                 </figure>
232                                 <para>If <systemitem class="service">ejabberd</systemitem> reports that it is already stopped, it may have run into a problem starting back at the installation stage. One possible fix is to kill any remaining <systemitem class="daemon">beam</systemitem> and <systemitem class="daemon">epmd</systemitem> processes, then edit the configuration file <filename>/etc/ejabberd/ejabberd.cfg</filename> to hardcode a domain:</para>
233                                 <figure>
234                                         <title>Commands to recover from <systemitem class="service">ejabberd</systemitem> errors</title>
235                                         <screen>
236                                         $ su - root
237                                         $ epmd -kill
238                                         $ killall beam; killall beam.smp
239                                         $ rm /var/lib/ejabberd/*
240                                         $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd
241                                         </screen>
242                                 </figure>
243                         </section>
244                         <section>
245                                 <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>
246                                 <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>
247                                 <itemizedlist>
248                                         <listitem>Change <literal>{hosts, ["localhost"]}.</literal> to <literal>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</literal></listitem>
249                                         <listitem>Change <literal>{max_user_sessions, 10}.</literal> to <literal>{max_user_sessions, 10000}.</literal> If you see something like this instead: <literal>{access, max_user_sessions, [{10, all}]}.</literal>, then change it to <literal>{access, max_user_sessions, [{10000, all}]}.</literal></listitem>
250                                         <listitem>Change all three occurrences of <literal>max_stanza_size</literal> to <literal>2000000</literal>.</listitem>
251                                         <listitem>Change both occurrences of <literal>maxrate</literal> to <literal>500000</literal>.</listitem>
252                                         <listitem>Comment out the line <literal>{mod_offline, []}</literal> by placing two <literal>%</literal> comment signs in front.</listitem>
253                                 </itemizedlist>
254                         </section>
255                         <section>
256                                 <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>
257                                 <para>As the <systemitem class="username">root</systemitem> user, restart the <systemitem class="service">ejabberd</systemitem> service to test the configuration changes and to register your users:</para>
258                                 <figure>
259                                         <title>Commands to restart the <systemitem class="service">ejabberd</systemitem> service</title>
260                                         <screen>
261                                         $ /etc/init.d/ejabberd start
262                                         </screen>
263                                 </figure>
264                         </section>
265                         <section>
266                                 <title>Register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>
267                                 <para>On each domain, you need two <systemitem class="service">ejabberd</systemitem> users to manage the OpenSRF communications:</para>
268                                 <itemizedlist>
269                                         <listitem>a <systemitem class="username">router</systemitem> user, to whom all requests to connect to an OpenSRF service will be routed; this <systemitem class="service">ejabberd</systemitem> user must be named <systemitem class="username">router</systemitem></listitem>
270                                         <listitem>an <systemitem class="username">opensrf</systemitem> user, which clients use to connect to OpenSRF services; this user can be named anything you like, but we will use <literal>opensrf</literal> in our examples</listitem>
271                                 </itemizedlist>
272                                 <para>As the <systemitem class="username">root</systemitem> user, use the <command>ejabberdctl</command> utility to register your ejabber users <emphasis>router</emphasis> and <emphasis>opensrf</emphasis> for the OpenSRF router service on each domain. The users should have different passwords on each domain. These users will correspond to those configured in the file <filename>/openils/conf/opensrf_core.xml</filename>:</para>
273                                 <figure>
274                                         <title>Commands to register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>
275                                         <programlisting language="xml"><![CDATA[
276 # Syntax for registering a user with ejabberdctl:
277 #    ejabberdctl register <user> <domain> <password>
278 #
279 $ ejabberdctl register router private.localhost  <password>
280 $ ejabberdctl register opensrf private.localhost <password>
281 $ ejabberdctl register router public.localhost   <password>
282 $ ejabberdctl register opensrf public.localhost  <password>
283 ]]></programlisting>
284                                 </figure>
285                         </section>
286                         <section>
287                                 <title>Create configuration files</title>
288                                 <para>As the <systemitem class="username">opensrf</systemitem> user, use the example templates to create the configuration files <filename>/openils/conf/opensrf_core.xml</filename> and <filename>/openils/conf/opensrf.xml</filename>:</para>
289                                 <figure>
290                                         <title>Commands to create configuration files</title>
291                                         <screen>
292                                         $ su - root
293                                         $ cd /openils/conf
294                                         $ cp opensrf.xml.example      opensrf.xml
295                                         $ cp opensrf_core.xml.example opensrf_core.xml
296                                         </screen>
297                                 </figure>
298                         </section>
299                         <section>
300                                 <title>Edit opensrf_core.xml</title>
301                                 <para>Edit the file <filename>/openils/conf/opensrf_core.xml</filename> to change the <systemitem class="service">ejabberd</systemitem> usernames and passwords as follows.</para>
302                                 <note>
303                                         <para>
304                                                 <emphasis>The following example uses common XPath syntax on the left-hand side to indicate the aproximage position needing changes within the XML file.</emphasis>
305                                         </para>
306                                 </note>
307                                 <figure>
308                                         <title>Updates needed in the file <filename>/openils/conf/opensrf_core.xml</filename></title>
309                                         <screen>
310                                         /config/opensrf/username = opensrf
312                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
314                                         /config/gateway/username = opensrf
316                                         /config/gateway/passwd = password for "public.localhost" opensrf user
318                                         # first entry, where "transport/server" == "public.localhost" :
319                                         /config/routers/router/transport 
320                                             username = router
321                                             password = password for "public.localhost" router user
323                                         # second entry, where "transport/server" == "private.localhost" :
324                                         /config/routers/router/transport
325                                             username = router
326                                             password = password for "private.localhost" router user
327                                         </screen>
328                                 </figure>
329                                 <para>You also need to specify the domains from which OpenSRF will accept and to which OpenSRF will make connections. If you are installing OpenSRF on a single server and using the <systemitem class="domainname">private.localhost</systemitem> / <systemitem class="domainname">public.localhost</systemitem> domains, these will already be set to the correct values. Otherwise, search and replace to match your values.</para>
330                         </section>
331                         <section>
332                                 <title>Modify the file <filename>opensrf.xml</filename></title>
333                                 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the file <filename>/openils/conf/opensrf.xml</filename> to set the location of the persistent database in the <literal>dbfile</literal> element near the end of the file:</para>
334                                 <figure>
335                                         <title>Example of the file <filename>opensrf.xml</filename></title>
336                                         <programlisting language="xml"><![CDATA[
337 <!-- Example of an app-specific setting override -->
338 <opensrf.persist>
339   <app_settings>
340     <dbfile>/tmp/persist.db</dbfile>
341   </app_settings>
342 </opensrf.persist>
343 ]]></programlisting>
344                                 </figure>
345                         </section>
346                         <section>
347                                 <title>Create Configuration Files for Users Needing <application>srfsh</application></title>
348                                 <para>In this section you will set up a special configuration file for each user who will need to run the <application>srfsh</application> (pronounced <emphasis>surf shell</emphasis>) utility.</para>
349                                 <para>The software installation will automatically create <application>srfsh</application>. This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See <xref linkend="serversideinstallation-testing"/> for further information.</para>
350                                 <para>As the <systemitem class="username">root</systemitem> user, copy the short sample configuration file <filename>/openils/conf/srfsh.xml.example</filename> to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of each user who will use <application>srfsh</application>. Finally, edit each file <filename>.srfsh.xml</filename> and make the following changes. When you finish, remember to change the owner of the file to match the owner of the home directory.</para>
351                                 <itemizedlist>
352                                         <listitem>Modify <literal>domain</literal> to be the router hostname (following our domain examples, <systemitem class="domainname">private.localhost</systemitem> will give <application>srfsh</application> access to all OpenSRF services, while <systemitem class="domainname">public.localhost</systemitem> will only allow access to those OpenSRF services that are publicly exposed).</listitem>
353                                         <listitem>Modify <literal>username</literal> and <literal>password</literal> to match the <literal>opensrf</literal> Jabber user for the chosen domain</listitem>
354                                         <listitem>Modify <literal>logfile</literal> to be the full path for a log file to which the user has write access</listitem>
355                                         <listitem>Modify <literal>loglevel</literal> as needed for testing</listitem>
356                                 </itemizedlist>
357                                 <figure>
358                                         <title>Example of the file <filename>/openils/conf/srfsh.xml.example</filename></title>
359                                         <programlisting language="xml"><![CDATA[
360 <?xml version="1.0"?>
361 <!-- This file follows the standard bootstrap config file layout -->
362 <!-- found in opensrf_core.xml -->
363 <srfsh>
364 <router_name>router</router_name>
365 <domain>private.localhost</domain>
366 <username>opensrf</username>
367 <passwd>privsrf</passwd>
368 <port>5222</port>
369 <logfile>/tmp/srfsh.log</logfile>
370 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
371 <loglevel>4</loglevel>
372 </srfsh>
373 ]]></programlisting>
374                                 </figure>
375                         </section>
376                         <section>
377                                 <title>Modify Environmental Variable PATH for <systemitem class="username">opensrf</systemitem> User</title>
378                                 <para>As the <systemitem class="username">opensrf</systemitem> user, modify the environmental variable <envar>PATH</envar> by adding a new file path to the <systemitem class="username">opensrf</systemitem> user's shell configuration file <filename>.bashrc</filename>:</para>
379                                 <figure>
380                                         <title>Commands to add path to <filename>.bashrc</filename> configuration file</title>
381                                         <screen>
382                                         $ su - opensrf
383                                         $ echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc
384                                         </screen>
385                                 </figure>
386                         </section>
387                         <section>
388                                 <title>Starting OpenSRF</title>
389                                 <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services:</para>
390                                 <figure>
391                                         <title>Commands to start <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services</title>
392                                         <screen>
393                                         $ su - root
394                                         $ /etc/init.d/ejabberd start
395                                         $ /etc/init.d/memcached start
396                                         </screen>
397                                 </figure>
398                                 <para/>
399                                 <para>Finally, as the <systemitem class="username">opensrf</systemitem> user, start OpenSRF:</para>
400                                 <figure>
401                                         <title>Commands to start OpenSRF</title>
402                                         <screen>
403                                         $ su - opensrf
405                                         # ensure you have the needed path
406                                         $ export PATH=$PATH:/openils/bin
408                                         # start the OpenSRF service:
409                                         # use "-l" to force hostname to be "localhost"
410                                         $ -l -a start_all     
411                                         </screen>
412                                 </figure>
413                                 <note>
414                                         <para>
415                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but <emphasis></emphasis> must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>
416                                         </para>
417                                 </note>
418                         </section>
419                         <section>
420                                 <title>Testing connections to OpenSRF</title>
421                                 <para>Once you have installed and started OpenSRF, as the <systemitem class="username">root</systemitem> user, test your connection to OpenSRF using the <application>srfsh</application> utility and trying to call the <emphasis>add</emphasis> method on the OpenSRF <systemitem class="service">math</systemitem> service:</para>
422                                 <figure>
423                                         <title>Commands to test OpenSRF with <application>srfsh</application></title>
424                                         <screen>
425                                         $ su - opensrf
426                                         $ /openils/bin/srfsh
427                                         srfsh#  request opensrf.math add 2 2
428                                         Received Data: 4
429                                         ------------------------------------
430                                         Request Completed Successfully
431                                         Request Time in seconds: 0.007519
432                                         ------------------------------------
433                                         srfsh#
434                                         </screen>
435                                 </figure>
436                                 <indexterm>
437                                         <primary>ZZZ-REVIEW</primary>
438                                         <secondary>VERIFY THIS TEST </secondary>
439                                 </indexterm>
440                                 <caution>VERIFY THIS TEST </caution>
441                                 <para>For other <application>srfsh</application> commands, type <userinput>help</userinput> in at the prompt.</para>
442                         </section>
443                         <section>
444                                 <title>Stopping OpenSRF</title>
445                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop OpenSRF:</para>
446                                 <figure>
447                                         <title>Commands to stop OpenSRF</title>
448                                         <screen>
449                                         $ su - opensrf
450                                         $ -l -a stop_all
451                                         </screen>
452                                 </figure>
453                         </section>
454                 </section>
455                 <section xml:id="serversideinstallation-ubuntudebian">
456                         <title>Installing Evergreen 1.6.x.x On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>
457                         <para>This section outlines the installation process for the latest stable version of Evergreen.</para>
458                         <para>In this section you will download, unpack, install, configure and test the Evergreen system, including the Evergreen server and the PostgreSQL database system. You will make several configuration changes and adjustments to the software, including updates to configure the system for your own locale, and some updates needed to work around a few known issues.</para>
459                         <note>
460                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) architectures. There may be differences between the Desktop and Server editions of Ubuntu. These instructions assume the Server edition.</para>
461                                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>
462                                 <itemizedlist>
463                                         <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>
464                                         <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>
465                                 </itemizedlist>
466                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue the command <command>exit</command>.</para>
467                         </note>
468                         <section xml:id="serversideinstallation-opensrf-overview">
469                                 <title>Installing OpenSRF</title>
470                                 <para>Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see <xref linkend="serversideinstallation-opensrf"/>.</para>
471                                 <para>Follow the steps outlined in that section and run the specified tests to ensure that OpenSRF is properly installed and configured. Do not continue with any further Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>
472                         </section>
473                         <section>
474                                 <title>Download and Unpack Latest Evergreen Version</title>
475                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of Evergreen. The latest version can be found here: <ulink url=""></ulink></para>
476                                 <figure>
477                                         <title>Commands to download and unpack Evergreen</title>
478                                         <screen>
479                                         $ su - opensrf
480                                         $ wget
481                                         $ tar zxf Evergreen-ILS-
482                                         </screen>
483                                 </figure>
484                                 <para>The new directory <filename class="directory">/home/opensrf/Evergreen-ILS-</filename> will be created.</para>
485                         </section>
486                         <section>
487                                 <title>Install Prerequisites to Build Evergreen</title>
488                                 <para>In this section you will install and configure a set of prerequisites that will be used to build Evergreen. In a following step you will actually build the software using the <command>make</command> utility.</para>
489                                 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[distribution]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-2">"Keywords"</link> figure below.</para>
490                                 <figure>
491                                         <title>Commands to install prerequisites for Evergreen</title>
492                                         <screen>
493                                         $ su - root
494                                         $ cd /home/opensrf/Evergreen-ILS-
495                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]
496                                         ...
497                                         </screen>
498                                 </figure>
499                                 <table xml:id="serversideinstallation-keywords-figure-2">
500                                         <title>Keywords Targets for <application>make</application></title>
501                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
502                                                 <colspec colnum="1" colwidth="1*"/>
503                                                 <colspec colnum="2" colwidth="3*"/>
504                                                 <thead>
505                                                         <row>
506                                                                 <entry>Keyword</entry>
507                                                                 <entry>Description</entry>
508                                                         </row>
509                                                 </thead>
510                                                 <tbody>
511                                                         <row>
512                                                                 <entry>debian-lenny</entry>
513                                                                 <entry>for Debian Lenny (5.0), the most recent version</entry>
514                                                         </row>
515                                                         <row>
516                                                                 <entry>debian-etch</entry>
517                                                                 <entry>for Debian Etch (4.0)</entry>
518                                                         </row>
519                                                         <row>
520                                                                 <entry>ubuntu-karmic</entry>
521                                                                 <entry>for Ubuntu Lucid (10.04) [same as for Karmic]</entry>
522                                                         </row>
523                                                         <row>
524                                                                 <entry>ubuntu-karmic</entry>
525                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
526                                                         </row>
527                                                         <row>
528                                                                 <entry>ubuntu-intrepid</entry>
529                                                                 <entry>for Ubuntu Intrepid (8.10)</entry>
530                                                         </row>
531                                                         <row>
532                                                                 <entry>ubuntu-hardy</entry>
533                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
534                                                         </row>
535                                                         <row>
536                                                                 <entry>ubuntu-gutsy</entry>
537                                                                 <entry>for Ubuntu Gutsy (7.10)</entry>
538                                                         </row>
539                                                         <row>
540                                                                 <entry>gentoo</entry>
541                                                                 <entry>generic for Gentoo versions</entry>
542                                                         </row>
543                                                         <row>
544                                                                 <entry>centos</entry>
545                                                                 <entry>generic for Centos versions</entry>
546                                                         </row>
547                                                 </tbody>
548                                         </tgroup>
549                                 </table>
550                                 <indexterm>
551                                         <primary>ZZZ-REVIEW</primary>
552                                         <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>
553                                 </indexterm>
554                                 <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
555                         </section>
556                         <section>
557                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>
558                                 <para>Since the PostgreSQL server is usually a standalone server in multi-server production systems, the prerequisite installer Makefile in the previous step does not automatically install PostgreSQL. If your PostgreSQL server is on a different system, just skip this step.</para>
559                                 <para>For further information on installing PostgreSQL, see <xref linkend="serversideinstallation-postgresql"/>.</para>
560                                 <para>If your PostgreSQL server will be on the same system as your Evergreen software, then as the <systemitem class="username">root</systemitem> user install the required PostgreSQL server packages:</para>
561                                 <figure>
562                                         <title>Commands to install the PostgreSQL server</title>
563                                         <screen>
564                                         $ su - root
566                                         # Debian Lenny and Ubuntu Hardy (8.04)
567                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
568                                         ...
570                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
571                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
572                                         ...
573                                         </screen>
574                                 </figure>
575                                 <note>
576                                         <para>
577                                                 <emphasis>PostgreSQL 8.1 is deprecated and will become unsupported in a future release, though existing installations upgrading from Evergreen 1.4 or before will work fine. However, consider upgrading your Postgres soon!</emphasis>
578                                         </para>
579                                 </note>
580                                 <indexterm>
581                                         <primary>ZZZ-REVIEW</primary>
582                                         <secondary>VERIFY: IS THIS STILL TRUE? </secondary>
583                                 </indexterm>
584                                 <caution>VERIFY: IS THIS STILL TRUE? </caution>
585                                 <indexterm>
586                                         <primary>ZZZ-REVIEW</primary>
587                                         <secondary>ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE </secondary>
588                                 </indexterm>
589                                 <caution>ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE </caution>
590                         </section>
591                         <section>
592                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
593                                 <para>If PostgreSQL is running on the same system as your Evergreen software, then the Perl modules will automatically be available. Just skip this step.</para>
594                                 <para>Otherwise, if your PostgreSQL server is running on another system, then as the <systemitem class="username">root</systemitem> user install the following Perl modules on that system:</para>
595                                 <figure>
596                                         <title>Commands to install Perl modules</title>
597                                         <screen>
598                                         # ensure the gcc compiler is installed
599                                         $ su - root
600                                         $ aptitude install gcc
602                                         # install the Perl modules
603                                         $ perl -MCPAN -e shell
604                                         cpan> install JSON::XS
605                                         cpan> install MARC::Record
606                                         cpan> install MARC::File::XML
607                                         </screen>
608                                 </figure>
609                                 <indexterm>
610                                         <primary>ZZZ-REVIEW</primary>
611                                         <secondary>ADD INFO ON HOW TO INSTALL THE PERL MODULES </secondary>
612                                 </indexterm>
613                                 <caution>ADD INFO ON HOW TO INSTALL THE PERL MODULES </caution>
614                                 <indexterm>
615                                         <primary>ZZZ-REVIEW</primary>
616                                         <secondary>ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </secondary>
617                                 </indexterm>
618                                 <caution>ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </caution>
619                         </section>
620                         <section>
621                                 <title>Update the System Dynamic Library Path</title>
622                                 <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/</filename> containing two new library paths, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>
623                                 <figure>
624                                         <title>Commands to modify system dynamic library path</title>
625                                         <screen>
626                                         $ su - root
627                                         $ cat > /etc/ &lt;&lt; ENDOFFILE
628                                         /usr/local/lib
629                                         /usr/local/lib/dbd
630                                         ENDOFFILE
631                                         $ ldconfig
632                                         </screen>
633                                 </figure>
634                         </section>
635                         <section>
636                                 <title>(OPTIONAL) Restart the PostgreSQL Server</title>
637                                 <para>If PostgreSQL is running on the same system as the rest of Evergreen, as the <systemitem class="username">root</systemitem> user you must restart the PostgreSQL server to avoid a problem where the library <filename></filename> cannot be found. If your PostgreSQL server is running on another system, just skip this step.</para>
638                                 <indexterm>
639                                         <primary>ZZZ-REVIEW</primary>
640                                         <secondary>ADD INFO ON OTHER VERSIONS OF POSTGRESQL </secondary>
641                                 </indexterm>
642                                 <caution>ADD INFO ON OTHER VERSIONS OF POSTGRESQL </caution>
643                                 <figure>
644                                         <title>Commands to restart PostgreSQL server</title>
645                                         <screen>
646                                         $ su - root
647                                         $ /etc/init.d/postgresql-PGSQL_VERSION restart
648                                         </screen>
649                                 </figure>
650                                 <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</emphasis>
651                         </section>
652                         <section xml:id="serversideinstallation-configure">
653                                 <title>Configure Evergreen</title>
654                                 <para>As the <systemitem class="username">opensrf</systemitem> user, return to the Evergreen build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software:</para>
655                                 <figure>
656                                         <title>Commands to configure Evergreen</title>
657                                         <screen>
658                                         $ su - opensrf
659                                         $ cd /home/opensrf/Evergreen-ILS-
660                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
661                                         $ make
662                                         ...
663                                         </screen>
664                                 </figure>
665                         </section>
666                         <section xml:id="serversideinstallation-compilingevergreen">
667                                 <title>Compile, Link and Install Evergreen</title>
668                                 <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>
669                                 <para>As the <systemitem class="username">root</systemitem> user, return to the Evergreen build directory and use the <command>make</command> utility as shown below. The Staff Client will also be automatically built, but you must remember to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the Staff Client you will use to connect to the Evergreen server.</para>
670                                 <para>For further information on manually building the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>
671                                 <figure>
672                                         <title>Commands to build, link and install Evergreen</title>
673                                         <screen>
674                                         $ su - root
675                                         $ cd /home/opensrf/Evergreen-ILS-
676                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
677                                         ...
678                                         </screen>
679                                         <para>The above commands will create a new subdirectory <filename class="directory">/openils/var/web/xul/rel_1_6_0_7</filename> containing the Staff Client.</para>
680                                 </figure>
681                                 <para>To complete the Staff Client installation, as the <systemitem class="username">root</systemitem> user create a symbolic link named <emphasis>server</emphasis> in the head of the Staff Client directory <filename class="directory">/openils/var/web/xul</filename> that points to the subdirectory <filename class="directory">/server</filename> of the new Staff Client build:</para>
682                                 <figure>
683                                         <title>Commands to create symbolic link</title>
684                                         <screen>
685                                         $ su - root
686                                         $ cd /openils/var/web/xul
687                                         $ ln -sf rel_1_6_0_7/server server
688                                         </screen>
689                                 </figure>
690                         </section>
691                         <section>
692                                 <title>Copy the OpenSRF Configuration Files</title>
693                                 <para>As the <systemitem class="username">root</systemitem> user, copy the example OpenSRF configuration files into place. This replaces the configuration files that you set up in a previous step when you installed and tested OpenSRF. You should also create backup copies of the old files for troubleshooting purposes. Finally, change the ownership on the installed files to the <systemitem class="username">opensrf</systemitem> user:</para>
694                                 <figure>
695                                         <title>Commands to copy OpenSRF configuration files</title>
696                                         <screen>
697                                         $ su - root
698                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
699                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
700                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
701                                         $ chown -R opensrf:opensrf /openils/
702                                         </screen>
703                                 </figure>
704                         </section>
705                         <section>
706                                 <title>Create and Configure PostgreSQL Database</title>
707                                 <para>As the <systemitem class="username">postgres</systemitem> user on your PostgreSQL server, create the Evergreen database.</para>
708                                 <para>In the commands below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis> repository to match your PostgreSQL server layout. For example, if you built PostgreSQL from source the path would be <filename class="directory">/usr/local/share/contrib</filename>; if you installed the PostgreSQL 8.3 server packages on Ubuntu 8.04, the path would be <filename class="directory">/usr/share/postgresql/8.3/contrib/</filename>.</para>
709                                 <procedure>
710                                         <step>
711                                                 <para>
712                                                         <emphasis role="bold">Create and configure the database</emphasis>
713                                                 </para>
714                                                 <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
715                                                 <figure>
716                                                         <title>Commands to create database and adjust the path</title>
717                                                         <screen>
718                                                         # create the database
719                                                         $ su - postgres
720                                                         $ createdb -E UNICODE evergreen
721                                                         $ createlang plperl   evergreen
722                                                         $ createlang plperlu  evergreen
723                                                         $ createlang plpgsql  evergreen
725                                                         # adjust the paths
726                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen
727                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen
728                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen
729                                                         </screen>
730                                                 </figure>
731                                                 <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</emphasis>
732                                         </step>
733                                         <step>
734                                                 <para>
735                                                         <emphasis role="bold">Create new Evergreen superuser</emphasis>
736                                                 </para>
737                                                 <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system, create the new database <systemitem class="username">evergreen</systemitem> user and assign a password:</para>
738                                                 <figure>
739                                                         <title>Commands to create the <systemitem class="username">evergreen</systemitem> user</title>
740                                                         <screen>
741                                                         # create superuser 'evergreen' and set the password
742                                                         $ su - postgres
743                                                         $ createuser -P -s evergreen
744                                                         Enter password for new role: MYNEWPASSWORD
745                                                         Enter it again: MYNEWPASSWORD
746                                                         </screen>
747                                                 </figure>
748                                                 <emphasis>Where <literal>MYNEWPASSWORD</literal> is the password chosen.</emphasis>
749                                         </step>
750                                 </procedure>
751                         </section>
752                         <section>
753                                 <title>Create Database Schema</title>
754                                 <para>As the <systemitem class="username">root</systemitem> user, create the database schema and configure your system with the corresponding database authentication details for the <emphasis>evergreen</emphasis> database user that you created in the previous step.</para>
755                                 <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>
756                                 <figure>
757                                         <title>Commands to create Evergreen database schema</title>
758                                         <screen>
759                                         $ su - root
760                                         $ cd /home/opensrf/Evergreen-ILS-
761                                         $ perl Open-ILS/src/support-scripts/ --update-config \
762                                                 --service all --create-schema --create-bootstrap --create-offline \
763                                                 --hostname HOSTNAME --port PORT \
764                                                 --user evergreen --password PASSWORD --database DATABASENAME
765                                         </screen>
766                                 </figure>
767                                 <emphasis>Where, on most systems, <emphasis>HOSTNAME</emphasis> will be <emphasis role="bold">localhost</emphasis>, <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>, and <emphasis>PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> will be those assigned when PostgreSQL was installed in the previous step.</emphasis>
768                                 <note>
769                                         <para>
770                                                 <emphasis>If you are entering the above command on a single line, do not include the <literal>\</literal> (backslash) characters. If you are using the <command>bash</command> shell, these should only be used at the end of a line at a bash prompt to indicate that the command is continued on the next line.</emphasis>
771                                         </para>
772                                 </note>
773                         </section>
774                         <section>
775                                 <title>Configure the Apache Server</title>
776                                 <para>As the <systemitem class="username">root</systemitem> user, configure the Apache server and copy several new configuration files to the Apache server directories:</para>
777                                 <figure>
778                                         <title>Commands to configure the Apache server</title>
779                                         <screen>
780                                         # configure the Apache server
781                                         $ su - root
782                                         $ a2enmod ssl        # enable mod_ssl
783                                         $ a2enmod rewrite    # enable mod_rewrite
784                                         $ a2enmod expires    # enable mod_expires
785                                         $ cd /home/opensrf/Evergreen-ILS-
787                                         # copy files
788                                         $ cp Open-ILS/examples/apache/eg.conf    /etc/apache2/sites-available/
789                                         $ cp Open-ILS/examples/apache/eg_vhost.conf   /etc/apache2/
790                                         $ cp Open-ILS/examples/apache/      /etc/apache2/
791                                         </screen>
792                                 </figure>
793                         </section>
794                         <section>
795                                 <title>Create a Security Certificate (SSL Key)</title>
796                                 <para>Use the command <command>openssl</command> to create a new SSL key for your Apache server. For a public production server you should configure or purchase a signed SSL certificate, but for now you can just use a self-signed certificate and accept the warnings in the Staff Client and browser during testing and development:</para>
797                                 <figure>
798                                         <title>Commands to create an SSL key</title>
799                                         <screen>
800                                         $ mkdir /etc/apache2/ssl
801                                         $ cd /etc/apache2/ssl
802                                         $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
803                                         </screen>
804                                 </figure>
805                                 <warning>
806                                         <para>
807                                                 <emphasis>This is only a temporary measure to expedite testing. You <emphasis role="bold">must</emphasis> get a proper SSL certificate for a public production system.</emphasis>
808                                         </para>
809                                 </warning>
810                                 <indexterm>
811                                         <primary>ZZZ-REVIEW</primary>
812                                         <secondary>ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </secondary>
813                                 </indexterm>
814                                 <caution>ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </caution>
815                         </section>
816                         <section xml:id="serversideinstallation-modify-apache">
817                                 <title>Modify the Apache Configuration File</title>
818                                 <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/sites-available/eg.conf</filename> and make the following changes:</para>
819                                 <procedure>
820                                         <step>
821                                                 <para>Comment out the line <literal>Allow from</literal>, then uncomment the line <literal>Allow from all</literal>.</para>
822                                                 <para>
823                                                         <emphasis>This change allows access to your configuration CGI scripts from <emphasis role="bold">any</emphasis> workstation on <emphasis role="bold">any</emphasis> network. This is only a temporary change to expedite testing and should be removed after you have finished and successfully tested the Evergreen installation.</emphasis>
824                                                 </para>
825                                                 <warning>
826                                                         <para>
827                                                                 <emphasis>You must remove these changes after testing is completed. See <xref linkend="serversideinstallation-postinstallation"/> for further details on removing this change after the Evergreen installation is complete.</emphasis>
828                                                         </para>
829                                                 </warning>
830                                         </step>
831                                         <step>
832                                                 <para>Comment out the line <literal>Listen 443</literal> as it conflicts with the same declaration in the configuration file: <filename>/etc/apache2/ports.conf</filename>. <systemitem class="osname">Debian Etch</systemitem> users should not do this.</para>
833                                                 <indexterm>
834                                                         <primary>ZZZ-REVIEW</primary>
835                                                         <secondary>ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </secondary>
836                                                 </indexterm>
837                                                 <caution>ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </caution>
838                                         </step>
839                                         <step>
840                                                 <para>The following updates are needed to allow the logs to function properly, but it may break other Apache applications on your server. We hope to make this unnecessary in a future Evergreen release.</para>
841                                                 <itemizedlist>
842                                                         <listitem>
843                                                                 <para>For the <systemitem class="osname">Linux</systemitem> distributions <systemitem class="osname">Ubuntu Hardy</systemitem> or <systemitem class="osname">Debian Etch</systemitem>, as the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and change the user: <emphasis role="bold">www-data</emphasis> to the user: <systemitem class="username">opensrf</systemitem>.</para>
844                                                         </listitem>
845                                                         <listitem>
846                                                                 <para>For the <systemitem class="osname">Linux</systemitem> distributions <systemitem class="osname">Ubuntu Karmic</systemitem> or <systemitem class="osname">Ubuntu Lucid</systemitem> or <systemitem class="osname">Debian Lenny</systemitem>, as the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/envvars</filename> and change the phrase: <emphasis role="bold">export APACHE_RUN_USER=www-data</emphasis> to the phrase: <emphasis role="bold">export APACHE_RUN_USER=opensrf</emphasis>.</para>
847                                                         </listitem>
848                                                 </itemizedlist>
849                                         </step>
850                                         <step>
851                                                 <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and add the line <emphasis role="bold">KeepAliveTimeout 1</emphasis>, or modify an existing line if it already exists.</para>
852                                         </step>
853                                 </procedure>
854                         </section>
855                         <section>
856                                 <title>(OPTIONAL) Performance Modifications for Apache</title>
857                                 <para>Some further configuration changes to Apache may be necessary for busy systems. These changes increase the number of Apache server processes that are started to support additional browser connections.</para>
858                                 <procedure>
859                                         <step>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename>, locate and modify the section related to <emphasis>prefork configuration</emphasis> to suit the load on your system.</step>
860                                         <step><para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and add the line <emphasis role="bold">MaxKeepAliveRequests 100</emphasis>, or modify an existing line if it already exists.</para>
861                                                 <figure>
862                                                         <title>(OPTIONAL) Example of updates to Apache configuration</title>
863                                                         <programlisting language="xml"><![CDATA[
864 <IfModule mpm_prefork_module>
865    StartServers           20
866    MinSpareServers         5
867    MaxSpareServers        15
868    MaxClients            150
869    MaxRequestsPerChild 10000
870 </IfModule>
871 MaxKeepAliveRequests 100
872                                                         ]]></programlisting>
873                                                         </figure>
874                                         </step>
875                                 </procedure>
876                         </section>
877                         <section>
878                                 <title>Enable the Evergreen Site</title>
879                                 <para>As the <systemitem class="username">root</systemitem> user, execute the following Apache configuration commands to disable the default <emphasis>It Works</emphasis> web page and to enable the Evergreen web site:</para>
880                                 <figure>
881                                         <title>Commands to enable the Evergreen Web Site</title>
882                                         <screen>
883                                         $ su - root
885                                         # disable the default site
886                                         $ a2dissite default
888                                         # enable the Evergreen web site
889                                         $ a2ensite eg.conf
890                                         </screen>
891                                 </figure>
892                         </section>
893                         <section>
894                                 <title>Modify the OpenSRF Configuration File</title>
895                                 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename> to update the Jabber usernames and passwords, and to specify the domain from which we will accept and to which we will make connections.</para>
896                                 <para>If you are installing Evergreen on a single server and using the <systemitem class="domainname">private.localhost</systemitem> / <systemitem class="domainname">public.localhost</systemitem> domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values.</para>
897                                 <note>
898                                         <para>
899                                                 <emphasis>The following example uses common XPath syntax on the left-hand side to indicate the approximate position needing changes within the XML file:</emphasis>
900                                         </para>
901                                 </note>
902                                 <indexterm>
903                                         <primary>ZZZ-REVIEW</primary>
904                                         <secondary>ADD A BETTER DIAGRAM HERE </secondary>
905                                 </indexterm>
906                                 <caution>ADD A BETTER DIAGRAM HERE </caution>
907                                 <figure>
908                                         <title>Updates needed in the file <filename>/openils/conf/opensrf_core.xml</filename></title>
909                                         <screen>
910                                         /config/opensrf/username = opensrf
912                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
914                                         /config/gateway/username = opensrf
916                                         /config/gateway/passwd = password for "public.localhost" opensrf user
918                                         # first entry, where "transport/server" == "public.localhost" :
919                                         /config/routers/router/transport 
920                                             username = router
921                                             password = password for "public.localhost" router user
923                                         # second entry, where "transport/server" == "private.localhost" :
924                                         /config/routers/router/transport
925                                             username = router
926                                             password = password for "private.localhost" router user
927                                         </screen>
928                                 </figure>
929                         </section>
930                         <section>
931                                 <title>Create Configuration Files for Users Needing <application>srfsh</application></title>
932                                 <para>The software installation will automatically create a utility named <application>srfsh</application> (surf shell). This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See <xref linkend="serversideinstallation-testing"/> for further information.</para>
933                                 <para>In this section you will set up a special configuration file for each user who will need to run the utility. Copy the short sample configuration file <filename>/openils/conf/srfsh.xml.example</filename> to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of each user who will use <application>srfsh</application>. Finally, edit each users' <filename>.srfsh.xml</filename> file and make the following changes:</para>
934                                 <procedure>
935                                         <step>Modify <emphasis role="bold">domain</emphasis> to be the router hostname (following our domain examples, <systemitem class="domainname">private.localhost</systemitem>> will give <application>srfsh</application> access to all OpenSRF services, while <systemitem class="domainname">public.localhost</systemitem> will only allow access to those OpenSRF services that are publicly exposed).</step>
936                                         <step>Modify <emphasis role="bold">username</emphasis> and <emphasis role="bold">password</emphasis> to match the <systemitem class="username">opensrf</systemitem> Jabber user for the chosen domain</step>
937                                         <step>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</step>
938                                         <step>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</step>
939                                 </procedure>
940                                 <figure>
941                                         <title>Example of user's file <filename>.srfsh.xml</filename></title>
942                                         <programlisting language="xml"><![CDATA[
943 <?xml version="1.0"?>
944 <!-- This file follows the standard bootstrap config file layout -->
945 <!-- found in opensrf_core.xml -->
946 <srfsh>
947 <router_name>router</router_name>
948 <domain>private.localhost</domain>
949 <username>opensrf</username>
950 <passwd>evergreen</passwd>
951 <port>5222</port>
952 <logfile>/tmp/srfsh.log</logfile>
953 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
954 <loglevel>4</loglevel>
955 </srfsh>
956 ]]></programlisting>
957                                 </figure>
958                         </section>
959                         <section>
960                                 <title>Modify the OpenSRF Environment</title>
961                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change the permissions of <emphasis>.cgi</emphasis> files in the directory <filename class="directory">/openils/var/cgi-bin</filename> to <emphasis>executable</emphasis>, then modify the shell configuration file <filename>~/.bashrc</filename> for <systemitem class="username">opensrf</systemitem> by adding a Perl environmental variable. Finally, execute the shell configuration file to load the new variables into your current environment.</para>
962                                 <note>
963                                         <para>
964                                                 <emphasis>In a multi-server environment, you must add any modifications to <filename>~/.bashrc</filename> to the top of the file <emphasis>before</emphasis> the line <literal>[ -z "$PS1" ] &amp;&amp; return </literal>. This will allow headless (scripted) logins to load the correct environment.</emphasis>
965                                         </para>
966                                 </note>
967                                 <figure>
968                                         <title>Commands to modify the OpenSRF environment</title>
969                                         <screen>
970                                         # change permissions
971                                         $ su - opensrf
972                                         $ chmod 755 /openils/var/cgi-bin/*.cgi
974                                         # add environmental variable
975                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
977                                         # inherit the new environment
978                                         $ . ~/.bashrc
979                                         </screen>
980                                 </figure>
981                         </section>
982                         <section xml:id="serversideinstallation-starting">
983                                 <title>Starting Evergreen</title>
984                                 <procedure>
985                                         <step>
986                                                 <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services (if they are not already running):</para>
987                                                 <figure>
988                                                         <title>Commands to start <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services</title>
989                                                         <screen>
990                                                         $ su - root
991                                                         $ /etc/init.d/ejabberd start
992                                                         $ /etc/init.d/memcached start
993                                                         </screen>
994                                                 </figure>
995                                         </step>
996                                         <step>
997                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, start Evergreen.</para>
998                                                 <para>Use the flag <emphasis>-l</emphasis> to force Evergreen to use <emphasis>localhost</emphasis> (your current system) as the hostname. Using the <emphasis>start_all</emphasis> option will start the OpenSRF router, Perl services, and C services:</para>
999                                                 <figure>
1000                                                         <title>Commands to start Evergreen</title>
1001                                                         <screen>
1002                                                         $ su - opensrf
1004                                                         # ensure you have the needed path
1005                                                         $ export PATH=$PATH:/openils/bin
1007                                                         # start the OpenSRF service:
1008                                                         # use "-l" to force hostname to be "localhost"
1009                                                         $ -l -a start_all     
1010                                                         </screen>
1011                                                 </figure>
1012                                                 <note>
1013                                                         <para>
1014                                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but the <command></command> utility must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>
1015                                                         </para>
1016                                                         <para>Execute the following command to determine the fully qualified domain name of your system:</para>
1017                                                         <figure>
1018                                                                 <title>(OPTIONAL) Commands to determine the fully qualified domain name</title>
1019                                                                 <screen>
1020                                                                 $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
1021                                                                 </screen>
1022                                                         </figure>
1023                                                 </note>
1024                                                 <indexterm>
1025                                                         <primary>ZZZ-REVIEW</primary>
1026                                                         <secondary>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </secondary>
1027                                                 </indexterm>
1028                                                 <caution>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1029                                                 <itemizedlist>
1030                                                         <listitem>
1031                                                                 <para>When you attempt to start Evergreen, if you receive an error message similar to <emphasis> command not found</emphasis>, then your environment variable <envar>PATH</envar> does not include the directory <filename class="directory">/openils/bin</filename>. As the <systemitem class="username">opensrf</systemitem> user, edit the configuration file <filename>/home/opensrf/.bashrc</filename> and add the following line: <literal>export PATH=$PATH:/openils/bin</literal></para>
1032                                                         </listitem>
1033                                                         <listitem>
1034                                                                 <para>When you attempt to start Evergreen, if you receive an error message similar to <emphasis>Can't locate OpenSRF/ in @INC ... BEGIN failed--compilation aborted</emphasis>, then your environment variable <emphasis role="bold">PERL5LIB</emphasis> does not include the directory <filename class="directory">/openils/lib/perl5</filename>. As the <systemitem class="username">opensrf</systemitem> user, edit the configuration file <filename>/home/opensrf/.bashrc</filename> and add the following line: <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>
1035                                                         </listitem>
1036                                                 </itemizedlist>
1037                                         </step>
1038                                         <step>
1039                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, generate the Web files needed by the Staff Client and catalogue, and calculate the proximity of locations in the Organizational Unit tree (which allows <emphasis>Holds</emphasis> to work properly).</para>
1040                                                 <para>You must do this the first time you start Evergreen, and after making any changes to the library hierarchy in the configuration file <filename>config.cgi</filename>.</para>
1041                                                 <figure>
1042                                                         <title>Commands to generate web files</title>
1043                                                         <screen>
1044                                                         $ su - opensrf
1045                                                         $ cd /openils/bin
1046                                                         $ ./ -c /openils/conf/opensrf_core.xml -u
1047                                                         Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
1048                                                         Updating fieldmapper
1049                                                         ...
1050                                                         </screen>
1051                                                 </figure>
1052                                                 <indexterm>
1053                                                         <primary>ZZZ-REVIEW</primary>
1054                                                         <secondary>ADD RESULTS OF TESTS FROM "" </secondary>
1055                                                 </indexterm>
1056                                                 <caution>ADD RESULTS OF TESTS FROM <filename></filename> </caution>
1057                                         </step>
1058                                         <step>
1059                                                 <para>As the <systemitem class="username">root</systemitem> user, restart the Apache Web server:</para>
1060                                                 <figure>
1061                                                         <title>Commands to restart Apache web server</title>
1062                                                         <screen>
1063                                                         $ su - root
1064                                                         $ /etc/init.d/apache2 restart
1065                                                         </screen>
1066                                                 </figure>
1067                                                 <note>If the Apache Web server was running when you started the OpenSRF services, you might not be able to successfully log in to the OPAC or Staff Client until the Apache Web server is restarted.</note>
1068                                         </step>
1069                                 </procedure>
1070                         </section>
1071                         <section xml:id="serversideinstallation-testing">
1072                                 <title>Testing the Installation</title>
1073                                 <para>This section describes several simple tests you can perform to verify that the Evergreen server-side software has been installed and configured properly and is running as expected.</para>
1074                                 <section xml:id="serversideinstallation-testing-connections">
1075                                         <title>Testing Connections to Evergreen</title>
1076                                         <para>Once you have installed and started Evergreen, test your connection to Evergreen. As the <systemitem class="username">opensrf</systemitem> user start the <application>srfsh</application> application and try logging onto the Evergreen server using the default administrator username and password. Following is sample output generated by executing that script after a successful Evergreen installation:</para>
1077                                         <figure>
1078                                                 <title>Commands to test Evergreen with <application>srfsh</application></title>
1079                                                 <screen>
1080                                                 $ su - opensrf
1081                                                 $ /openils/bin/srfsh
1082                                                 srfsh% login admin open-ils
1083                                                 Received Data: "250bf1518c7527a03249858687714376"
1084                                                 ------------------------------------
1085                                                 Request Completed Successfully
1086                                                 Request Time in seconds: 0.045286
1087                                                 ------------------------------------
1088                                                 Received Data: {
1089                                                    "ilsevent":0,
1090                                                    "textcode":"SUCCESS",
1091                                                    "desc":" ",
1092                                                    "pid":21616,
1093                                                    "stacktrace":"oils_auth.c:304",
1094                                                    "payload":{
1095                                                       "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
1096                                                       "authtime":420
1097                                                    }
1098                                                 }
1099                                                 ------------------------------------
1100                                                 Request Completed Successfully
1101                                                 Request Time in seconds: 1.336568
1102                                                 ------------------------------------
1103                                                 </screen>
1104                                         </figure>
1105                                 </section>
1106                                 <section>
1107                                         <title>Other Connection Tests with <application>srfsh</application></title>
1108                                         <para></para>
1109                                         <para>There is another <application>srfsh</application> command called <command>math_bench</command> that sends queries to the math servers. Note that the <systemitem class="service">opensrf.math</systemitem> and <systemitem class="service">opensrf.dbmath</systemitem> must be running for this command to work:</para>
1110                                         <figure>
1111                                                 <title>Example of math_bench usage</title>
1112                                                 <screen>
1113                                                 srfsh# math_bench 10
1114                                                 |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
1115                                                 ++++++++++++++++++++++++++++++++++++++++
1116                                                 Average round trip time: 0.033425
1117                                                 srfsh#
1118                                                 </screen>
1119                                         </figure>
1120                                         <para>The first argument is how many sets of 4 queries (+ - * /) are sent to <systemitem class="service">opensrf.math</systemitem>. When the response is successful, you will see the string of <literal>+</literal> symbols. If the system is not running correctly, you will either get an exception or no result at all.</para>
1121                                         <para>For other <application>srfsh</application> commands, type <userinput>help</userinput> in at the prompt.</para>
1122                                         <para/>
1123                                         <para>If this does not work, try the troubleshooting steps in the following section.</para>
1124                                 </section>
1125                                 <section>
1126                                         <title>Testing with <application></application></title>
1127                                         <para>As the <systemitem class="username">opensrf</systemitem> user, run the script <command></command> to see if it finds any system configuration problems. Following is sample output generated by executing that script after a successful Evergreen installation:</para>
1128                                         <section>
1129                                                 <title>Example of execution of <command></command></title>
1130                                                 <programlisting language="xml"><![CDATA[
1131                                                 $ su - root
1132                                                 $ cd /home/opensrf/Evergreen-ILS-
1133                                                 $ perl Open-ILS/src/support-scripts/
1134                                                 LWP::UserAgent version 5.810
1135                                                 XML::LibXML version 1.70
1136                                                 XML::LibXML::XPathContext version 1.70
1137                                                 XML::LibXSLT version 1.70
1138                                                 Net::Server::PreFork version 0.97
1139                                                 Cache::Memcached version 1.24
1140                                                 Class::DBI version 0.96
1141                                                 Class::DBI::AbstractSearch version 0.07
1142                                                 Template version 2.19
1143                                                 DBD::Pg version 2.8.2
1144                                                 Net::Z3950::ZOOM version 1.24
1145                                                 MARC::Record version 2.0.0
1146                                                 MARC::Charset version 1.1
1147                                                 MARC::File::XML version 0.92
1148                                                 Text::Aspell version 0.04
1149                                                 CGI version 3.29
1150                                                 DateTime::TimeZone version 0.7701
1151                                                 DateTime version 0.42
1152                                                 DateTime::Format::ISO8601 version 0.06
1153                                                 DateTime::Format::Mail version 0.3001
1154                                                 Unix::Syslog version 1.1
1155                                                 GD::Graph3d version 0.63
1156                                                 JavaScript::SpiderMonkey version 0.19
1157                                                 Log::Log4perl version 1.16
1158                                                 Email::Send version 2.192
1159                                                 Text::CSV version 1.06
1160                                                 Text::CSV_XS version 0.52
1161                                                 Spreadsheet::WriteExcel::Big version 2.20
1162                                                 Tie::IxHash version 1.21
1163                                                 Parse::RecDescent version 1.95.1
1164                                                 SRU version 0.99
1165                                                 JSON::XS version 2.27
1167                                                 Checking Jabber connection for user opensrf, domain private.localhost
1168                                                 * Jabber successfully connected
1170                                                 Checking Jabber connection for user opensrf, domain public.localhost
1171                                                 * Jabber successfully connected
1173                                                 Checking Jabber connection for user router, domain public.localhost
1174                                                 * Jabber successfully connected
1176                                                 Checking Jabber connection for user router, domain private.localhost
1177                                                 * Jabber successfully connected
1178                                                 ]]></programlisting>
1179                                                 <programlisting language="xml"><![CDATA[
1180                                                 Checking database connections
1181                                                 * /opensrf/default/reporter/setup :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1182                                                   * Database has the expected server encoding UTF8.
1183                                                 * /opensrf/default/apps/ :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1184                                                   * Database has the expected server encoding UTF8.
1185                                                 * /opensrf/default/apps/open-ils.cstore/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1186                                                   * Database has the expected server encoding UTF8.
1187                                                 * /opensrf/default/apps/open-ils.pcrud/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1188                                                   * Database has the expected server encoding UTF8.
1189                                                 * /opensrf/default/apps/open-ils.reporter-store/app_settings :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432
1190                                                   * Database has the expected server encoding UTF8.
1192                                                 Checking database drivers to ensure <driver> matches <language>
1193                                                 * OK: Pg language is undefined for reporter base configuration
1194                                                 * OK: Pg language is undefined for reporter base configuration
1195                                                 * OK: Pg language is perl in /opensrf/default/apps/
1196                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.cstore/language
1197                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.pcrud/language
1198                                                 * OK: pgsql language is C in /opensrf/default/apps/open-ils.reporter-store/language
1200                                                 Checking libdbi and libdbi-drivers
1201                                                   * OK - found locally installed and in shared library path
1203                                                 Checking hostname
1204                                                  * OK: found hostname 'localhost' in <hosts> section of opensrf.xml
1205                                                 $
1206                                                 ]]></programlisting>
1207                                         </section>
1208                                         <para>If the output from the script does not help you find the problem, please do not make any further significant changes to your configuration. Follow the steps in the troubleshooting guide in <xref linkend="troubleshooting"/>.</para>
1209                                         <para>If you have followed the entire set of installation steps listed here closely, you are probably extremely close to a working system. Gather your configuration files and log files and contact the <ulink url="">Evergreen development mailing list</ulink> for assistance before making any drastic changes to your system configuration.</para>
1210                                 </section>
1211                                 <section xml:id="serversideinstallation-testing-opac">
1212                                         <title>Testing the Catalog</title>
1213                                         <para>By default, the OPAC will live at the URL <uri></uri>.</para>
1214                                         <para>Navigate to this URL and the front page of the OPAC should load. There is a basic text entry field with some extra search options. If you have any problems loading this page, check the Apache error logs. If the page loads but does not function correctly, then check for possible javascript errors. We hightly reccommend testing with the <application>Firefox</application> browser because of the helpful javascript debugging tools.</para>
1215                                         <para>Assuming that the OPAC is functioning and there is data in your database, you can now perform other simple functional tests (e.g., searching the catalog).</para>
1216                                         <indexterm>
1217                                                 <primary>ZZZ-REVIEW</primary>
1218                                                 <secondary>ADD OTHER SIMPLE FUNCTIONAL TESTS </secondary>
1219                                         </indexterm>
1220                                         <caution>ADD OTHER SIMPLE FUNCTIONAL TESTS </caution>
1221                                 </section>
1222                                 <section>
1223                                         <title>Running the Evergreen Staff Client</title>
1224                                         <para>Run the Evergreen Staff Client by using the application <application>XULRunner</application> (installed automatically and by default with Firefox version 3.0 and later on <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem> distributions).</para>
1225                                         <para>For example, if the source files for the Evergreen installation are in the directory <filename class="directory">/home/opensrf/Evergreen-ILS-</filename>, start the Staff Client as follows:</para>
1226                                         <figure>
1227                                                 <title>Commands to run the Staff Client</title>
1228                                                 <screen>
1229                                                 $ su - opensrf
1230                                                 $ xulrunner /home/opensrf/Evergreen-ILS-
1231                                                 </screen>
1232                                         </figure>
1233                                 </section>
1234                                 <section xml:id="serversideinstallation-starting-apache-server">
1235                                         <title>Testing the Apache Web Server</title>
1236                                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>
1237                                         <para>As the <systemitem class="username">root</systemitem> user, execute the following commands. Note the use of <emphasis>restart</emphasis> to force the new Evergreen modules to be reloaded even if the Apache server is already running. Any problems found with your configuration files should be displayed:</para>
1238                                         <figure>
1239                                                 <title>Commands to test the Apache Web Server</title>
1240                                                 <screen>
1241                                                 $ su - root
1242                                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart
1243                                                 </screen>
1244                                         </figure>
1245                                 </section>
1246                         </section>
1247                         <section xml:id="serversideinstallation-stopping">
1248                                 <title>Stopping Evergreen</title>
1249                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all Evergreen services by using the following command:</para>
1250                                 <figure>
1251                                         <title>Commands to stop Evergreen</title>
1252                                         <screen>
1253                                         $ su - opensrf
1255                                         # stop the server:
1256                                         # use "-l" to force hostname to be "localhost"
1257                                         $ -l -a stop_all
1258                                         </screen>
1259                                 </figure>
1260                                 <note>
1261                                         <para>
1262                                                 <emphasis>You can also stop Evergreen services <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but the <command></command> utility must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>
1263                                         </para>
1264                                 </note>
1265                                 <indexterm>
1266                                         <primary>ZZZ-REVIEW</primary>
1267                                         <secondary>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </secondary>
1268                                 </indexterm>
1269                                 <caution>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1270                         </section>
1271                         <section xml:id="serversideinstallation-postinstallation">
1272                                 <title>Post-Installation Chores</title>
1273                                 <section>
1274                                         <title>Remove temporary changes from Apache configuration file</title>
1275                                         <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/sites-available/eg.conf</filename> again and make the following change:</para>
1276                                         <para>Uncomment the line <literal>Allow from</literal>, then comment out the line <literal>Allow from all</literal>. You modified this file in an earlier step as a temporary measure to expedite testing (see <xref linkend="serversideinstallation-modify-apache"/> for further information). Those changes must now be reversed in order to deny unwanted access to your CGI scripts from users on other public networks. You <emphasis role="bold">must</emphasis> secure this for a public production system.</para>
1277                                 </section>
1278                                 <section>
1279                                         <title>Configure a permanent SSL key</title>
1280                                         <para>In a previous step, we used the command <command>openssl</command> to temporarily create a new SSL key for the Apache server. For a public production server you should configure or purchase a signed SSL certificate</para>
1281                                         <warning>
1282                                                 <para>
1283                                                         <emphasis>The temporary SSL key was only created to expedite testing. You <emphasis role="bold"> must</emphasis> get a proper SSL certificate for a public production system.</emphasis>
1284                                                 </para>
1285                                         </warning>
1286                                         <indexterm>
1287                                                 <primary>ZZZ-REVIEW</primary>
1288                                                 <secondary>ADD EXPLANATION OF HOW TO GET PERMANENT SSL CERTIFICATE </secondary>
1289                                         </indexterm>
1290                                         <caution>ADD EXPLANATION OF HOW TO GET PERMANENT SSL CERTIFICATE </caution>
1291                                 </section>
1292                                 <section>
1293                                         <title>Set Up Support For Reports</title>
1294                                         <para>Evergreen reports are extremely powerful, but some configuration is required. See <xref linkend="report-introduction"/> for details.</para>
1295                                         <itemizedlist>
1296                                                 <listitem>
1297                                                         <para>Starting the Reporter Daemon</para>
1298                                                         <para>Once the <systemitem class="daemon">open-ils.reporter</systemitem> process is running and enabled on the gateway, you can start the reporter daemon. That process periodically checks for requests for new reports or scheduled reports and gets them running.</para>
1299                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, start the reporter daemon using the following command:</para>
1300                                                         <figure>
1301                                                                 <title>Commands to start the Reporter daemon</title>
1302                                                                 <screen>
1303                                                                 $ su - opensrf
1304                                                                 $ cd /home/opensrf/Evergreen-ILS-
1305                                                                 $ ./ --daemon
1306                                                                 </screen>
1307                                                         </figure>
1308                                                         <para>You can also specify other options with this utility:</para>
1309                                                         <itemizedlist>
1310                                                                 <listitem><option>--sleep=interval</option> : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>
1311                                                                 <listitem><option>--lockfile=filename</option> : where to place the lockfile for the process; defaults to <filename>/tmp/reporter-LOCK</filename></listitem>
1312                                                                 <listitem><option>--concurrency=integer</option> : number of reporter daemon processes to run; defaults to <literal>1</literal></listitem>
1313                                                                 <listitem><option>--bootstrap=filename</option> : OpenSRF bootstrap configuration file; defaults to <filename>/openils/conf/opensrf_core.xml</filename></listitem>
1314                                                         </itemizedlist>
1315                                                 </listitem>
1316                                                 <listitem>
1317                                                         <para>Stopping the Reporter Daemon</para>
1318                                                         <para>To stop the Reporter daemon, you must kill the process and remove the lockfile. The daemon may have just a single associated process, with a lockfile in the default location.</para>
1319                                                         <note>
1320                                                                 <para>
1321                                                                         <emphasis>It is possible that several processes are running; see the optional commands in the previous section. As the <systemitem class="username">opensrf</systemitem> user, perform the following commands to stop the Reporter daemon:</emphasis>
1322                                                                 </para>
1323                                                         </note>
1324                                                         <figure>
1325                                                                 <title>Commands to stop the Reporter daemon</title>
1326                                                                 <screen>
1327                                                                 $ su - opensrf
1328                                                                 # find and kill the process ID number(s)
1329                                                                 $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
1330                                                                 # remove the lock file
1331                                                                 $ rm /tmp/reporter-LOCK
1332                                                                 </screen>
1333                                                         </figure>
1334                                                 </listitem>
1335                                         </itemizedlist>
1336                                 </section>
1337                                 <section xml:id="serversideinstallation-organizationandpolicy">
1338                                         <title>Organization and Policy Editing</title>
1339                                         <para>After installing Evergreen, you will want to make configuration changes to reflect the organizational hierarchy and the policies of your library or libraries. See <xref linkend="serveradministration-orgunits"/> for further information. Examples of what can be configured include:</para>
1340                                         <itemizedlist>
1341                                                 <listitem>Adding a branch library</listitem>
1342                                                 <listitem>Changing circulation rules for an existing library</listitem>
1343                                                 <listitem>Adding a new staff position or user group</listitem>
1344                                         </itemizedlist>
1345                                         <indexterm>
1346                                                 <primary>ZZZ-REVIEW</primary>
1347                                                 <secondary>ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </secondary>
1348                                         </indexterm>
1349                                         <caution>ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </caution>
1350                                 </section>
1351                         </section>
1352                 </section>
1353                 <section xml:id="serversideinstallation-virtual">
1354                         <title>Installing In Virtualized Unix Environments</title>
1355                         <para>Evergreen software currently runs as a native application on any of several well-known <systemitem class="osname">Linux</systemitem> distributions (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). It does not run as a native application on the <systemitem class="osname">Windows</systemitem> operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can be installed and run on <systemitem class="osname">Windows</systemitem> via a virtualized Unix-guest Operating System (using, for example, <application>VirtualBox</application> or <application>VMware</application> to emulate a <systemitem class="osname">Linux</systemitem> environment).</para>
1356                         <indexterm>
1357                                 <primary>ZZZ-REVIEW</primary>
1358                                 <secondary>ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </secondary>
1359                         </indexterm>
1361                         <section xml:id="serversideinstallation-virtualized-virtualbox">
1362                                 <title>VirtualBox</title>
1363                                 <indexterm>
1364                                         <primary>ZZZ-REVIEW</primary>
1365                                         <secondary>ADD CONTENT FOR VirtualBox </secondary>
1366                                 </indexterm>
1367                                 <caution>ADD CONTENT FOR VirtualBox </caution>
1368                         </section>
1369                         <section xml:id="serversideinstallation-virtualized-vmware">
1370                                 <title>VMware</title>
1371                                 <indexterm>
1372                                         <primary>ZZZ-REVIEW</primary>
1373                                         <secondary>ADD CONTENT FOR VMware </secondary>
1374                                 </indexterm>
1375                                 <caution>ADD CONTENT FOR VMware </caution>
1376                         </section>
1377                         <section xml:id="serversideinstallation-virtualized-virtualpc">
1378                                 <title>VirtualPC</title>
1379                                 <indexterm>
1380                                         <primary>ZZZ-REVIEW</primary>
1381                                         <secondary>ADD CONTENT FOR VirtualPC </secondary>
1382                                 </indexterm>
1383                                 <caution>ADD CONTENT FOR VirtualPC </caution>
1384                         </section>
1385                 </section>
1386                 <section xml:id="serversideinstallation-previousversions">
1387                         <title>Installing Previous Versions of Evergreen</title>
1388                         <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>
1389                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold"></emphasis></emphasis>. The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>.</para>
1390                         <section xml:id="serversideinstallation-ubuntudebian-previous">
1391                                 <title>Installing Evergreen On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>
1392                                 <indexterm>
1393                                         <primary>ZZZ-REVIEW</primary>
1394                                         <secondary>ADD CONTENT FOR INSTALLING EVERGREEN ON UBUNTU OR DEBIAN </secondary>
1395                                 </indexterm>
1396                                 <caution>ADD CONTENT FOR INSTALLING EVERGREEN ON UBUNTU OR DEBIAN </caution>
1397                         </section>
1398                         <section xml:id="serversideinstallation-opensrf-previous">
1399                                 <title>Installing OpenSRF 1.0.x</title>
1400                                 <indexterm>
1401                                         <primary>ZZZ-REVIEW</primary>
1402                                         <secondary>ADD CONTENT FOR INSTALLING OPENSRF 1.0.x </secondary>
1403                                 </indexterm>
1404                                 <caution>ADD CONTENT FOR INSTALLING OPENSRF 1.0.x </caution>
1405                         </section>
1406                 </section>
1407                 <section xml:id="serversideinstallation-postgresql">
1408                         <title>Installing PostgreSQL</title>
1409                         <indexterm>
1410                                 <primary>ZZZ-REVIEW</primary>
1411                                 <secondary>ADD CONTENT FOR POSTGRESQL </secondary>
1412                         </indexterm>
1413                         <caution>ADD CONTENT FOR POSTGRESQL </caution>
1414                 </section>
1415                 <section xml:id="serversideinstallation-apache">
1416                         <title>Installing Apache</title>
1417                         <section>
1418                                 <title>Securing Apache (httpd)</title>
1419                                 <para>The main consideration is to secure the directory <filename class="directory">cgi-bin</filename>. The only persons that need access to this directory are Evergreen system administrators. This directory should be restricted by both IP (to those workstations designated as Evergeen Administration systems), and by username/password.</para>
1420                                 <indexterm>
1421                                         <primary>ZZZ-REVIEW</primary>
1422                                         <secondary>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </secondary>
1423                                 </indexterm>
1424                                 <caution>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </caution>
1425                                 <para>A user could add new libraries, re-arrange consortia, or change user groups; or a staff member could access the directory, and change his associated security group to administrative level privileges.</para>
1426                         </section>
1427                         <indexterm>
1428                                 <primary>ZZZ-REVIEW</primary>
1429                                 <secondary>ADD MORE CONTENT FOR APACHE </secondary>
1430                         </indexterm>
1431                         <caution>ADD MORE CONTENT FOR APACHE </caution>
1432                 </section>
1433         </section>
1434         <section>
1435                 <title>Installing the Staff Client</title>
1436                 <para>You can install the Staff Client from pre-built images and packages without actually having to first build it. Pre-built packages are currently available for <systemitem class="osname">Windows</systemitem>, <systemitem class="osname">Mac OS X</systemitem>, and <systemitem class="osname">Linux</systemitem>. If you need to manually build the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>
1437                 <section xml:id="serversideinstallation-prebuilt-staffclient">
1438                         <title>Installing a Pre-Built Staff Client</title>
1439                         <para>This section reviews the process of installing pre-built versions of the Staff Client in various environments.</para>
1440                         <section>
1441                                 <title>Installing on <systemitem class="osname">Windows</systemitem></title>
1442                                 <para>A standard <systemitem class="osname">Windows</systemitem> installer that contains the current version of the Staff Client is available from the downloads section of the Evergreen website at <ulink url=""></ulink>. Download the staff client installer, then run it. A screen that looks similar to this should appear:</para>
1443                                 <figure>
1444                                         <title>Running the Staff Client installer</title>
1445                                         <mediaobject>
1446                                                 <imageobject>
1447                                                         <imagedata fileref="../media/serversideinstallation-staffclient-1.png" scalefit="1" width="70%"/>
1448                                                 </imageobject>
1449                                         </mediaobject>
1450                                 </figure>
1451                                 <para>Click <guibutton>Next</guibutton> to continue through the guided install process. The install wizard will ask you to agree to the end-user license, ask you where to install the software, ask about where to place icons, and then will install the software on your workstation.</para>
1452                                 <para>When you run the staff client for the first time, a screen similar to this should appear:</para>
1453                                 <figure>
1454                                         <title>Running the Staff Client for the first time</title>
1455                                         <mediaobject>
1456                                                 <imageobject>
1457                                                         <imagedata fileref="../media/serversideinstallation-staffclient-2.png" scalefit="1" width="70%"/>
1458                                                 </imageobject>
1459                                         </mediaobject>
1460                                 </figure>
1461                                 <para>First, configure the server you would like to connect to in the <emphasis role="bold">Server</emphasis> section. For example, the PINES demo system is <systemitem class="domain"></systemitem>. After selecting a server, click <guibutton>Re-Test Server</guibutton>.</para>
1462                                 <para>Because this is the initial run of the staff client, the <emphasis role="bold">Workstation</emphasis> section in the upper-right states: <emphasis role="bold">Not yet configured for the specified server</emphasis>. The first thing that must be done to the Staff Client on every workstation is to assign it a workstation name. This is covered in <xref linkend="serversideinstallation-workstationnames"/>.</para>
1463                         </section>
1464                         <section>
1465                                 <title>Installing on <systemitem class="osname">Mac OS X</systemitem></title>
1466                                 <para>A <systemitem class="osname">Mac OS X</systemitem> package that contains the current version of the Staff Client is available for use with <application>xulrunner</application>.</para>
1467                                 <section>
1468                                         <title>Evergreen Indiana Pkg file [Evergreen v1.2.3.0]</title>
1469                                         <procedure>
1470                                                 <step>Download and install the latest version of <application>xulrunner</application> for <systemitem class="osname">Mac OS X</systemitem>. Release notes for the latest version can be found here: <ulink url=""></ulink>. Note, later versions may not work correctly.</step>
1471                                                 <step>Download and install the <systemitem class="osname">Mac OS X</systemitem> Installation package for the 1_2_3_0 Version Staff Client from <ulink url=""></ulink>.</step>
1472                                                 <step>To upgrade to a more recent version of the staff client, you can copy the directory <emphasis>build</emphasis> from a working <systemitem class="osname">Windows</systemitem> installation of the desired version of the staff client to your Mac. The required files may be located in a directory like this on the <systemitem class="osname">Windows</systemitem> machine: <filename class="directory">C:\Program Files\Evergreen Staff Client\build</filename>. Copy these files into the folder <filename class="directory">Resources</filename> within the Open-ILS package in your Applications directory on the Mac, overwriting files with the same names.</step>
1473                                                 <step>Drag the application's icon into your toolbar for easier access.</step>
1474                                         </procedure>
1475                                         <para/>
1476                                         <para>When you run the staff client installer, a screen will appear that looks similar to this:</para>
1477                                         <figure>
1478                                                 <title>Running the Staff Client installer</title>
1479                                                 <mediaobject>
1480                                                         <imageobject>
1481                                                                 <imagedata fileref="../media/serversideinstallation-staffclient-3.png" scalefit="1" width="20%"/>
1482                                                         </imageobject>
1483                                                 </mediaobject>
1484                                         </figure>
1485                                         <caution> FIX BAD LINK: </caution>
1486                                         <para>Click <guibutton>Continue</guibutton>, accept the license, then finish the installation. The application will be located at the destination you selected during installation. You will then be able to drag the application into your toolbar for easier access.</para>
1487                                         <figure>
1488                                                 <title>Finishing the installation</title>
1489                                                 <mediaobject>
1490                                                         <imageobject>
1491                                                                 <imagedata fileref="../media/serversideinstallation-staffclient-4.png" scalefit="1" width="20%"/>
1492                                                         </imageobject>
1493                                                 </mediaobject>
1494                                         </figure>
1495                                         <caution> FIX BAD LINK: </caution>
1496                                 </section>
1497                                 <section>
1498                                         <title>Running directly using <application>xulrunner</application></title>
1499                                         <para>You must install an apropriate version of <application>xulrunner</application> to match the Evergreen version. See the following table for the recommended version of <application>xulrunner</application>:</para>
1500                                         <table>
1501                                                 <title>Evergreen / XULRunner Dependencies</title>
1502                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1503                                                         <colspec colnum="1" colwidth="1*"/>
1504                                                         <colspec colnum="2" colwidth="3*"/>
1505                                                         <tbody>
1506                                                                 <row>
1507                                                                         <entry>Evergreen 1.6.x.x</entry>
1508                                                                         <entry>XULrunner 1.9</entry>
1509                                                                 </row>
1510                                                                 <row>
1511                                                                         <entry>Evergreen 1.4.x.x</entry>
1512                                                                         <entry>XULrunner or XULrunner</entry>
1513                                                                 </row>
1514                                                                 <row>
1515                                                                         <entry>Evergreen 1.2.x.x</entry>
1516                                                                         <entry>XULrunner or XULrunner</entry>
1517                                                                 </row>
1518                                                         </tbody>
1519                                                 </tgroup>
1520                                         </table>
1521                                         <note>If you have issues removing previously installed <application>xulrunner</application> versions see <xref linkend="serversideinstallation-staffclient-remove-xulrunner"/> for information on removing previous <application>XULRunner</application> versions.</note>
1522                                         <para>The staff client data from the directory <filename class="directory">./staff_client/build</filename> must be placed somewhere on the machine (e.g. <emphasis>~/Desktop/Evergreen_Staff_Client</emphasis>). Remember to call <application>XULRunner</application> with the full path to the binary, followed by the install command and the path to the client data. See the following command:</para>
1523                                         <figure>
1524                                                 <title>Executing <application>xulrunner</application></title>
1525                                                 <screen>
1526                                                 /Library/Frameworks/XUL.framework/xulrunner-bin --install-app ~/Desktop/Evergreen_Staff_Client
1527                                                 </screen>
1528                                         </figure>
1529                                         <para>This command should exit quietly. A folder will be created, named <emphasis>/Applications/OpenILS</emphasis>, containing a launcher named <emphasis>open_ils_staff_client</emphasis>.</para>
1530                                 </section>
1531                                 <section xml:id="serversideinstallation-staffclient-remove-xulrunner">
1532                                         <title>Removing previously installed <application>xulrunner</application> versions</title>
1533                                         <para>If you already have a newer version installed, per the release notes, you will need to remove the entire directory <filename class="directory">/Library/Frameworks/XUL.framework</filename> before downgrading.</para>
1534                                         <para>In addition, you may also need to remove the previous file <filename>/Library/Receipts/xulrunner-ver-mak.pkg</filename>.</para>
1535                                         <para>If there is no file <filename>/Library/Receipts/xulrunner-ver-mak.pkg</filename> (possibly in newer OSX releases) you need to flush the file <emphasis>receiptdb</emphasis>.</para>
1536                                         <note>If you install a newer version over a previous (older) install, the older one is not removed but the symlinks get changed to the newer one.</note>
1537                                         <para>First, get the package identifier, then purge/forget the build that was initially installed:</para>
1538                                         <figure>
1539                                                 <title>Purging previous build</title>
1540                                                 <screen>
1541                                                 sudo pkgutil --pkgs > /tmp/pkgs.txt
1542                                                 sudo pkgutil --forget org.mozilla.xulrunner
1543                                                 </screen>
1544                                         </figure>
1545                                         <note>It may not be necessary to edit the file <filename>/Library/Receipts/InstallHistory.plist</filename> after deleting the folder <emphasis>XUL.framework</emphasis>.</note>
1546                                 </section>
1547                                 <section>
1548                                         <title>Creating an APP file: Staff Client &amp; <application>xulrunner</application> Bundled</title>
1549                                         <para>An APP file is basically a folder. Start with a folder stucture like this:</para>
1550                                         <figure>
1551                                                 <title>Sample APP file folder structure</title>
1552                                                 <screen>
1553                                                 *
1554                                                   * Contents
1555                                                     * Frameworks
1556                                                     * Resources
1557                                                     * MacOS
1558                                                 </screen>
1559                                         </figure>
1560                                         <para>Create an APP folder structure with the following commands:</para>
1561                                         <figure>
1562                                                 <title>Creating a folder structure</title>
1563                                                 <screen>
1564                                                 mkdir -p
1565                                                 mkdir -p
1566                                                 mkdir -p
1567                                                 </screen>
1568                                         </figure>
1569                                         <para/>
1570                                         <procedure>
1571                                                 <step>
1572                                                         <para>Create a new file in the folder <emphasis></emphasis> containing the following data (adjust for your version of Evergreen):</para>
1573                                                         <figure>
1574                                                                 <title>Creating a new file</title>
1575                                                                 <programlisting language="xml"><![CDATA[
1576 <?xml version="1.0" encoding="UTF-8"?>
1577 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
1578 <plist version="1.0">
1579 <dict>
1580         <key>CFBundleExecutable</key>
1581         <string>xulrunner</string>
1582         <key>CFBundleGetInfoString</key>
1583         <string>OpenILS open_ils_staff_client rel_1_6_0_7</string>
1584         <key>CFBundleInfoDictionaryVersion</key>
1585         <string>6.0</string>
1586         <key>CFBundleName</key>
1587         <string>Evergreen Staff Client</string>
1588         <key>CFBundlePackageType</key>
1589         <string>APPL</string>
1590         <key>CFBundleShortVersionString</key>
1591         <string>rel_1_6_0_7</string>
1592         <key>CFBundleVersion</key>
1593         <string>rel_1_6_0_7.rel_1_6_0_7</string>
1594         <key>NSAppleScriptEnabled</key>
1595         <true/>
1596         <key>CFBundleTypeIconFile</key>
1597         <string>Evergreen.icns</string>
1598 </dict>
1599 </plist>
1600 ]]></programlisting>
1601                                                         </figure>
1602                                                 </step>
1603                                                 <step>Download and install an appropriate <systemitem class="osname">Mac OS X</systemitem>package of <application>XULRunner</application> from the Mozilla website (see above for recommendations).</step>
1604                                                 <step>
1605                                                         <para>Make a copy of <emphasis>/Library/Frameworks/XUL.Framework</emphasis> inside your APP file. It should look something like this:</para>
1606                                                         <figure>
1607                                                                 <title>Example of APP file framework</title>
1608                                                                 <screen>
1609                                                                 *
1610                                                                 __* Contents/
1611                                                                 ____* Frameworks/
1612                                                                 ______* XUL.Framework/
1613                                                                 ______* Versions/
1614                                                                 ________* Current -> (symlink)
1615                                                                 ________*
1616                                                                 ______* XUL -> Versions/Current/XUL
1617                                                                 ______* libxpcom.dylib -> Versions/Current/libxpcom.dylib
1618                                                                 ______* xulrunner-bin -> Versions/Current/xulrunner-bin
1619                                                                 </screen>
1620                                                         </figure>
1621                                                 </step>
1622                                                 <step>Copy <emphasis>XUL.Framework/Versions/Current/xulrunner</emphasis> into <emphasis></emphasis> (do not symlink; copy the file).</step>
1623                                                 <step>
1624                                                         <para>Make <emphasis></emphasis> the root of your Evergreen application files like this:</para>
1625                                                         <figure>
1626                                                                 <title>Example APP file</title>
1627                                                                 <screen>
1628                                                                 *
1629                                                                 __* Contents/
1630                                                                 ____* Resources/
1631                                                                 ______* BUILD_ID
1632                                                                 ______* application.ini
1633                                                                 ______* chrome/
1634                                                                 ______* components/
1635                                                                 ______* etc.
1636                                                                 </screen>
1637                                                         </figure>
1638                                                 </step>
1639                                                 <step>Put a <systemitem class="osname">Mac</systemitem> format icon file named <emphasis>Evergreen.icns</emphasis> in Resources.</step>
1640                                         </procedure>
1641                                 </section>
1642                         </section>
1643                         <section xml:id="serversideinstallation-staffclient">
1644                                 <title>Installing on <systemitem class="osname">Linux</systemitem></title>
1645                                 <section>
1646                                         <title>Quick Upgrade of the Staff Client</title>
1647                                         <para>A <systemitem class="osname">Linux</systemitem> Staff Client is automatically built on the server as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side software. To upgrade the Staff Client on a remote workstation with a new version, just copy the directory tree containing the Staff Client from the server to the remote workstation.</para>
1648                                         <para>The following example assumes you already have an <systemitem class="username">opensrf</systemitem> user account on both the server and the remote workstation. Remember to replace <literal>user</literal>, <literal>client.linux.machine</literal> and <literal>eg-client-x.x.x.x</literal> with the proper user name, client machine name, and version number in the following example.</para>
1649                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then recursively copy the entire directory tree to the remote workstation:</para>
1650                                         <figure>
1651                                                 <title>Copying the Staff Client to a remote workstation</title>
1652                                                 <screen>
1653                                                 $ su - opensrf
1654                                                 $ cd /home/opensrf/Evergreen-ILS-
1655                                                 $ scp -r build user@client.linux.machine:~/eg-client-x.x.x.x/
1656                                                 </screen>
1657                                         </figure>
1658                                         <para>To test the newly copied Staff Client, as the <systemitem class="username">opensrf</systemitem> user log into the remote workstation and execute it as shown:</para>
1659                                         <figure>
1660                                                 <title>Testing the copied Staff Client</title>
1661                                                 <screen>
1662                                                 $ su - opensrf
1663                                                 $ xulrunner ~/eg-client-x.x.x.x/build/application.ini
1664                                                 </screen>
1665                                         </figure>
1666                                 </section>
1667                                 <section>
1668                                         <title>Building the Staff Client on the Server</title>
1669                                         <para>A <systemitem class="osname">Linux</systemitem> Staff Client is automatically built on the server as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side software.</para>
1670                                         <para>In order to install a compatible Staff Client on another <systemitem class="osname">Linux</systemitem> system, just copy the applicable files from the server to that system, or even manually build it on that system. Ensure that the BUILD_ID you choose on the server matches the BUILD_ID for each staff client you use on other systems.</para>
1671                                         <para>If you will be using a pre-packaged <systemitem class="osname">Windows</systemitem> version on some systems, you may want to choose the BUILD_ID on both server and other versions to match that of the <systemitem class="osname">Windows</systemitem> Staff Client. To determine which BUILD_ID is used in an existing Staff Client installation, just click <guibutton>About this Client</guibutton> on the running Staff Client.</para>
1672                                         <para>If you are allowed to make changes on the Evergreen server, another option is to create a symbolic link. In order for a copy of the Staff Client and server to work together, the BUILD_ID must match the name of the directory containing the server components of the Staff Client, or the name of a symbolic link to that directory.</para>
1673                                         <figure>
1674                                                 <title>Creating a symbolic link</title>
1675                                                 <screen>
1676                                                 $ su - root
1677                                                 $ cd /openils/var/web/xul
1678                                                 $ ln -s SERVER_BUILD_ID/ CLIENT_BUILD_ID
1679                                                 </screen>
1680                                         </figure>
1681                                 </section>
1682                                 <section>
1683                                         <title>Building the Staff Client on the client Machine</title>
1684                                         <para>This section is directed toward end-users who wish to use <systemitem class="osname">Linux</systemitem> rather than <systemitem class="osname">Windows</systemitem> for client machines, but have limited <systemitem class="osname">Linux</systemitem> experience. You can build the Staff Client on a <systemitem class="osname">Linux</systemitem> system without installing the Evergreen Server component. This is a relatively simple process compared to server installation, but does require some command-line work. The following directions are for building Staff Client version on Kubuntu 7.10; you must modify them for other distributions (the instructions should work as-is for Ubuntu or Ubuntu derivatives).</para>
1685                                         <procedure>
1686                                                 <step>
1687                                                         <para>Prerequisites</para>
1688                                                         <para>Both <application>subversion</application> and <application>xulrunner</application> are required to build the Staff Client. As the <systemitem class="username">root</systemitem> user, use <application>apt-get</application> to install packages for <application>subversion</application> and <application>xulrunner</application>. You can also use <application>synaptic</application>, the graphical user interface for <application>apt-get</application>. For <application>subversion</application>, select the latest version; for <application>xulrunner</application>, select version <emphasis></emphasis>.</para>
1689                                                         <figure>
1690                                                                 <title>Installing subversion and xulrunner</title>
1691                                                                 <screen>
1692                                                                 $ sudo apt-get install subversion
1693                                                                 $ sudo apt-get install xulrunner
1694                                                                 </screen>
1695                                                         </figure>
1696                                                 </step>
1697                                                 <step>
1698                                                         <para>Download the Source Code</para>
1699                                                         <itemizedlist>
1700                                                                 <listitem>
1701                                                                         <para>Determine which version is needed</para>
1702                                                                         <para>For most end-users, a specific version is required to communicate properly with the Evergreen server. Check with your system admininstrator, IT person, or HelpDesk to determine which Staff Client versions are supported.</para>
1703                                                                         <para>Next, you need to determine which <emphasis>tag</emphasis> to use when downloading the source code. Tags are markers in the source code to create a snapshot of the code as it existed at a certain time; tags usually point to tested and stable code, or at least a community-recognized release version.</para>
1704                                                                         <para>To determine which tag to use, browse to <ulink url=""></ulink>. Look in the <guibutton>Visit</guibutton> drop-down box; see the list of Branches and, further down, a list of Tags. You may have to do some guesswork, but it is fairly straightforward to determine which tag to use. If the server is version, you will want to use the tag that looks most appropriate. For example, as you look through the tag list, notice the tag named 'rel_1_2_1_4'. This is the tag you need; make a note of it for the next step.</para>
1705                                                                 </listitem>
1706                                                                 <listitem>
1707                                                                         <para>Download the Code</para>
1708                                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, open a terminal (command-line prompt) and navigate to the directory in which you wish to download the Staff Client. Use the following commands to download the proper version of the source code by tag name:</para>
1709                                                                         <figure>
1710                                                                                 <title>Downloading the source code</title>
1711                                                                                 <screen>
1712                                                                                 $ su - opensrf
1713                                                                                 $ cd /YOUR/DOWNLOAD/DIRECTORY
1714                                                                                 $ svn co svn://
1715                                                                                 </screen>
1716                                                                         </figure>
1717                                                                         <para>Remember to change <literal>rel_1_2_1_4</literal> to the appropriate tag for your installation.</para>
1718                                                                 </listitem>
1719                                                         </itemizedlist>
1720                                                 </step>
1721                                                 <step>
1722                                                         <para>Build the Staff Client</para>
1723                                                         <section>
1724                                                                 <title>Evergreen 1.2.x</title>
1725                                                                 <para>In the following example, navigate to the directory in which the source code was downloaded, then navigate to the proper subdirectory and run the <command>make</command> utility to actually build the Staff Client. Remember to check with your system administrator about which Staff Client BUILD_ID to use. The server checks the Staff Client BUILD_ID against itself to determine whether or not a connecting client is supported. For instance, for the PINES installation (version the supported BUILD_ID is <literal>rel_1_2_1_4</literal>. Modify the following commands accordingly.</para>
1726                                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands to build the Staff Client:</para>
1727                                                                 <figure>
1728                                                                         <title>Finding the downloaded source code</title>
1729                                                                         <screen>
1730                                                                         $ su - opensrf
1731                                                                         $ cd /YOUR/DOWNLOAD/DIRECTORY
1732                                                                         $ cd Open-ILS/xul/staff_client
1733                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_2_1_4'
1734                                                                         ...
1735                                                                         </screen>
1736                                                                 </figure>
1737                                                         </section>
1738                                                         <section>
1739                                                                 <title>Evergreen 1.4.x</title>
1740                                                                 <para>The 1.4 series of Evergreen has complicated the build process for the Staff Client a bit. If you downloaded a .tar.gz (compressed tar archive) of Evergreen, then your steps will resemble the following:</para>
1741                                                                 <caution>FIXME -- Need instructions for getting certain Javascript files from OpenSRF, preferably without actually installing OpenSRF.
1742 </caution>
1743                                                                 <figure>
1744                                                                         <title>Building 1.4.x</title>
1745                                                                         <screen>
1746                                                                         $ su - opensrf
1747                                                                         $ wget
1748                                                                         $ tar xfz Evergreen-ILS-
1749                                                                         $ cd Evergreen-ILS-
1750                                                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
1751                                                                         $ cd Open-ILS/xul/staff_client/
1752                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_4_0_4' install
1753                                                                         </screen>
1754                                                                 </figure>
1755                                                                 <para/>
1756                                                                 <para>If you're installing from a Subversion checkout:</para>
1757                                                                 <figure>
1758                                                                         <title>Building from a <application>subversion</application> checkout</title>
1759                                                                         <screen>
1760                                                                         $ su - opensrf
1761                                                                         $ svn co svn://
1762                                                                         $ cd rel_1_4_0_4
1763                                                                         $ ./   # If you downloaded a .tar.gz of Evergreen, you may skip this step
1764                                                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
1765                                                                         $ cd Open-ILS/xul/staff_client/
1766                                                                         $ make STAFF_CLIENT_BUILD_ID='rel_1_4_0_4' install
1767                                                                         </screen>
1768                                                                 </figure>
1769                                                         </section>
1770                                                 </step>
1771                                                 <step>
1772                                                         <para>Run the Staff Client (from the command line)</para>
1773                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, navigate to the directory <filename class="directory">build/</filename> (not <filename class="directory">staff_client/</filename>) and run the following command:</para>
1774                                                         <figure>
1775                                                                 <title>Running the Staff Client</title>
1776                                                                 <screen>
1777                                                                 $ su - opensrf
1778                                                                 $ xulrunner application.ini
1779                                                                 </screen>
1780                                                         </figure>
1781                                                 </step>
1782                                                 <step>
1783                                                         <para>(OPTIONAL) Cleaning Up / Creating Shortcuts</para>
1784                                                         <para>The source code download included many files that are needed to build the Staff Client, but are not necessary to run it. You may wish to remove them to save space, or to create a clean directory containing the built staff client that can be copied to other machines. To create a clean "staging" directory in which to place the finished staff client, issue the following commands:</para>
1785                                                         <figure>
1786                                                                 <title>Creating a "staging" directory</title>
1787                                                                 <screen>
1788                                                                 $ mkdir ~/&lt;Destination Directory>
1789                                                                 $ cd ~/&lt;Download Directory>/Open-ILS/xul/
1790                                                                 $ cp -r staff_client ~/&lt;Destination Directory>
1791                                                                 </screen>
1792                                                         </figure>
1793                                                         <para>Finally, test the Staff Client to verify that all the necessary files were moved to the destination directory:</para>
1794                                                         <figure>
1795                                                                 <title>Testing the copied Staff Client</title>
1796                                                                 <screen>
1797                                                                 $ cd ~/&lt;Destination Directory>/staff_client/build
1798                                                                 $ xulrunner application.ini
1799                                                                 </screen>
1800                                                         </figure>
1801                                                         <para>If there were no problems, then finish the cleanup by removing the original download directory and all subdirectories:</para>
1802                                                         <figure>
1803                                                                 <title>Cleaning up</title>
1804                                                                 <screen>
1805                                                                 $ rm -r -f ~/&lt;Download Directory>
1806                                                                 </screen>
1807                                                         </figure>
1808                                                         <para>Finally, test the copied Staff Client. You can create "Desktop / Start Menu / K-Menu" shortcuts for the Staff Client by using the following command as the target:</para>
1809                                                         <figure>
1810                                                                 <title>Running the copied Staff Client</title>
1811                                                                 <screen>
1812                                                                 $ xulrunner ~/&lt;Destination Directory>/staff_client/build/application.ini
1813                                                                 </screen>
1814                                                         </figure>
1815                                                 </step>
1816                                         </procedure>
1817                                 </section>
1818                                 <section>
1819                                         <title>Using <application>Wine</application> to Install On Linux</title>
1820                                         <para>The <systemitem class="osname">Linux</systemitem> application <application>Wine</application> is another alternative for those who wish to install the packaged <systemitem class="osname">Windows</systemitem> versions rather than building the Staff Client manually. <application>Wine</application> is a <systemitem class="osname">Linux</systemitem> application that allows users to directly run <systemitem class="osname">Windows</systemitem> executables, and is a simple way for casual <systemitem class="osname">Linux</systemitem> users to use the Staff Client. More information about <application>Wine</application> can be found at <ulink url=""></ulink>.</para>
1821                                         <para>As the <systemitem class="username">root</systemitem> user, use <application>apt-get</application> to install the package for <application>Wine</application>. You can also use <application>synaptic</application>, the graphical user interface.</para>
1822                                         <procedure>
1823                                                 <step>
1824                                                         <para>Install <application>Wine</application></para>
1825                                                         <figure>
1826                                                                 <title>Installing <application>Wine</application></title>
1827                                                                 <screen>