]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
2994a8069ed9dbfdf90d35d4c0c2147fd0b9095a
[working/Evergreen.git] / 1.6 / admin / ServersideInstallation.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter xml:id="ServersideInstallation" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xl="http://www.w3.org/1999/xlink">
3         <info>
4                 <title>Server-side Installation of Evergreen Software</title>
5                 <abstract>
6                         <para>This section describes installation of the Evergreen server-side software and its associated components. Installation, configuration, testing and verification of the software is straightforward if you follow some simple directions.</para>
7                 </abstract>
8         </info>
9         <section xml:id="serversideinstallation-overview">
10                 <title>Overview</title>
11                 <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current stable software release. See the section <link linkend="serversideinstallation-all">"Installation of Server-Side Software"</link> for instructions tailored to installing on some particular distributions of the Linux operating system. Earlier software distributions are described in the section <link linkend="serversideinstallation-previousversions">"Installing Previous Versions of Evergreen"</link>.</para>
12                 <para>The current version of the Evergreen server-side software runs as a native application on any of several well-known Linux distributions (e.g., <emphasis>Ubuntu</emphasis> and <emphasis>Debian</emphasis>). It does not currently run as a native application on the Windows operating system (e.g., WindowsXP, WindowsXP Professional, Windows7), but the software can still be installed and run on Windows via a so-called <emphasis>virtualized</emphasis> Unix-guest Operating System (using, for example, VirtualBox, or VMware, or VirtualPC to emulate a Linux environment). It can also be installed to run on other Linux systems via virtualized environments (using, for example, VirtualBox or VMware). More information on virtualized environments can be found in the section <link linkend="serversideinstallation-virtual">"Installing Evergreen in Virtualized Unix Environments"</link>.</para>
13                 <para>Installation of some sub-components of the Evergreen server-side software is mentioned only in abbreviated form in this section. More detailed information is available in the accompanying sections:
14 <link linkend="serversideinstallation-postgresql">"Installing PostgreSQL"</link>, 
15 <link linkend="serversideinstallation-apache">"Apache"</link> and
16 <link linkend="serversideinstallation-memcached">"memcached Servers"</link>.
17 </para>
18                 <para>Finally, installation of the Evergreen Staff Client software is reviewed in the section <link linkend="serversideinstallation-staffclient">"Installing the Evergreen Staff Client"</link>. </para>
19                 <section>
20                         <title>Evergreen Software Dependencies</title>
21                         <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>
22                         <table>
23                                 <title>Evergreen Software Dependencies</title>
24                                 <tgroup align="left" cols="3" colsep="1" rowsep="1">
25                                         <thead>
26                                                 <row>
27                                                         <entry>Evergreen</entry>
28                                                         <entry>OpenSRF</entry>
29                                                         <entry>PostgreSQL</entry>
30                                                 </row>
31                                         </thead>
32                                         <tbody>
33                                                 <row>
34                                                         <entry>1.6.x</entry>
35                                                         <entry>1.2</entry>
36                                                         <entry>8.2 / 8.3</entry>
37                                                 </row>
38                                                 <row>
39                                                         <entry>1.4.x</entry>
40                                                         <entry>1.0</entry>
41                                                         <entry>8.1 / 8.2</entry>
42                                                 </row>
43                                                 <row>
44                                                         <entry>1.2.x</entry>
45                                                         <entry>0.9</entry>
46                                                         <entry>8.1 / 8.2</entry>
47                                                 </row>
48                                         </tbody>
49                                 </tgroup>
50                         </table>
51                         <caution fileref="media/caution.png">VERIFY THE DEPENDENCIES IN THIS TABLE </caution>
52                 </section>
53                 <section>
54                         <title>Current Stable Software Release</title>
55                         <para>The current stable release of Evergreen is version <emphasis><emphasis role="bold">1.6.0.7</emphasis></emphasis>. Instructions for installing, configuring and testing that version on the <emphasis>Ubuntu</emphasis> or <emphasis>Debian</emphasis> Linux systems are found in the section <link linkend="serversideinstallation-ubuntudebian">"Installing Evergreen on Ubuntu or Debian"</link> .
56                         </para>
57                         <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 the section <link linkend="serversideinstallation-opensrf">"Installing OpenSRF On Ubuntu or Debian"</link> .</para>
58                 </section>
59                 <section>
60                         <title>Previous Software Releases</title>
61                         <para>Earlier releases of Evergreen are also available. Instructions for installing, configuring and testing earlier versions are found in the section <link linkend="serversideinstallation-previousversions">"Installing Previous Versions of Evergreen"</link> .</para>
62                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold">1.4.0.6</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in the section <link linkend="serversideinstallation-ubuntudebian-previous">"Installing Evergreen 1.4.0.6 on Ubuntu or Debian"</link> .</para>
63                         <para>The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in the section <link linkend="serversideinstallation-opensrf-previous">"Installing OpenSRF 1.0.x"</link> .</para>
64                 </section>
65         </section>
66         <section xml:id="serversideinstallation-all">
67                 <title>Installation of Server-Side Software</title>
68                 <para>This section describes the installation of the major components of Evergreen server-side software.</para>
69                 <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 the section on <link linkend="adminmisc-backingup">"Backing Up"</link>  for further information.</para>
70                 <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>
71                 <section xml:id="serversideinstallation-opensrf">
72                         <title>Installing OpenSRF 1.2.x On Ubuntu or Debian</title>
73                         <para>This section describes the installation of the latest version of the Open Service Request Framework (OpenSRF), a major component of the Evergreen server-side software, on Ubuntu or Debian systems. Evergreen software is integrated with and depends on the OpenSRF software system.</para>
74                         <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>
75                         <note>
76                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) platforms. OpenSRF 1.2.0 has been tested on Debian Etch (4.0), Debian Lenny, Ubuntu Hardy Heron (8.04), and Ubuntu Intrepid Ibex (8.10).</para>
77                                 <para>In the following instructions, you are asked to perform certain steps as either the <emphasis role="bold">root</emphasis> user, the <emphasis role="bold">opensrf</emphasis> user, or the <emphasis role="bold">postgres</emphasis> user.</para>
78                                 <itemizedlist>
79                                         <listitem><emphasis role="bold">Debian</emphasis> -- To become the <emphasis>root</emphasis> user, issue the command <emphasis role="bold">"su -"</emphasis> and enter the password of the root user.</listitem>
80                                         <listitem><emphasis role="bold">Ubuntu</emphasis> -- To become the <emphasis>root</emphasis> user, issue the command <emphasis role="bold">"sudo su -"</emphasis> and enter the password of your current user.</listitem>
81                                 </itemizedlist>
82                                 <para>To switch from the <emphasis role="bold">root</emphasis> user to a different user, issue the command <emphasis role="bold">"su - USERNAME"</emphasis>. For example, to switch from the <emphasis role="bold">root</emphasis> user to the <emphasis role="bold">opensrf</emphasis> user, issue the command <emphasis role="bold">"su - opensrf"</emphasis>. Once you have become a non-root user, to become the <emphasis role="bold">root</emphasis> user again, simply issue the command <emphasis role="bold">"exit"</emphasis>.</para>
83                         </note>
84                         <section>
85                                 <title>Add the OpenSRF User</title>
86                                 <para>As the <emphasis role="bold">root</emphasis> user, add the opensrf user to the system. The default shell for the new user is automatically set to <emphasis role="bold">/bin/bash</emphasis> to inherit a reasonable environment:</para>
87                                 <figure>
88                                         <title>Commands to add "opensrf" user</title>
89                                         <screen>
90                                         $ su - opensrf
91                                         $ useradd -m -s /bin/bash opensrf
92                                         $ passwd opensrf
93                                         Enter new UNIX password: ******
94                                         Retype new UNIX password: ******
95                                         passwd: password updated successfully
96                                         $
97                                         </screen>
98                                 </figure>
99                         </section>
100                         <section>
101                                 <title>Download and Unpack Latest OpenSRF Version</title>
102                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, download and extract the latest version of OpenSRF. The latest version can be found here: <emphasis><emphasis role="bold"><ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz"></ulink></emphasis></emphasis></para>
103                                 <figure>
104                                         <title>Commands to download and unpack OpenSRF</title>
105                                         <screen>
106                                         $ su - opensrf
107                                         $ wget http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz
108                                         $ tar zxf OpenSRF-1.2.2.tar.gz
109                                         </screen>
110                                 </figure>
111                                 <para>The new directory <emphasis>/home/opensrf/OpenSRF-1.2.2</emphasis> will be created.</para>
112                         </section>
113                         <section>
114                                 <title>Install Prerequisites to Build OpenSRF</title>
115                                 <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 <emphasis>make</emphasis> utility.</para>
116                                 <para>As the <emphasis role="bold">root</emphasis> 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 Linux distribution listed in the <link linkend="serversideinstallation-keywords-figure-1">"Keywords"</link> figure below.</para>
117                                 <figure>
118                                         <title>Commands to install prerequisites for OpenSRF</title>
119                                         <screen>
120                                         $ su - root
121                                         $ cd /home/opensrf/OpenSRF-1.2.2
122                                         $ make -f src/extras/Makefile.install [distribution]
123                                         ...
124                                         </screen>
125                                 </figure>
126                                 <table xml:id="serversideinstallation-keywords-figure-1">
127                                         <title>Keywords Targets for "make"</title>
128                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
129                                                 <colspec colnum="1" colwidth="1*"/>
130                                                 <colspec colnum="2" colwidth="3*"/>
131                                                 <thead>
132                                                         <row>
133                                                                 <entry>Keyword</entry>
134                                                                 <entry>Description</entry>
135                                                         </row>
136                                                 </thead>
137                                                 <tbody>
138                                                         <row>
139                                                                 <entry>debian-lenny</entry>
140                                                                 <entry>for Debian Lenny (5.0)</entry>
141                                                         </row>
142                                                         <row>
143                                                                 <entry>debian-etch</entry>
144                                                                 <entry>for Debian Etch (4.0)</entry>
145                                                         </row>
146                                                         <row>
147                                                                 <entry>ubuntu-karmic</entry>
148                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
149                                                         </row>
150                                                         <row>
151                                                                 <entry>ubuntu-intrepid</entry>
152                                                                 <entry>for Ubuntu Jaunty (9.04) or Intrepid (8.10)</entry>
153                                                         </row>
154                                                         <row>
155                                                                 <entry>ubuntu-hardy</entry>
156                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
157                                                         </row>
158                                                 </tbody>
159                                         </tgroup>
160                                 </table>
161                                 <caution fileref="media/caution.png"> ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
162                                 <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 "no" to the initial CPAN configuration prompt to allow it to automatically configure itself to download and install Perl modules from CPAN. The CPAN installer will ask you a number of times whether it should install prerequisite modules - say "yes".</para>
163                         </section>
164                         <section>
165                                 <title>Configure OpenSRF</title>
166                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, return to the OpenSRF build directory and use the utility "configure" to prepare for the next step of compiling and linking the software. You can include the <emphasis>--enable-python</emphasis> and <emphasis>--enable-java</emphasis> configuration options if you wish to include support for Python and Java, respectively:</para>
167                                 <figure>
168                                         <title>Commands to configure OpenSRF</title>
169                                         <screen>
170                                         $ su - opensrf
171                                         $ cd /home/opensrf/OpenSRF-1.2.2
172                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
173                                         $ make
174                                         ...
175                                         </screen>
176                                 </figure>
177                         </section>
178                         <section>
179                                 <title>Compile, Link and Install OpenSRF</title>
180                                 <para>As the <emphasis role="bold">root</emphasis> user, return to the OpenSRF build directory and use the <emphasis>make</emphasis> command to compile, link and install OpenSRF:</para>
181                                 <figure>
182                                         <title>Commands to build, link and install OpenSRF</title>
183                                         <screen>
184                                         $ su - opensrf
185                                         $ cd /home/opensrf/OpenSRF-1.2.2
186                                         $ make install
187                                         ...
188                                         </screen>
189                                 </figure>
190                         </section>
191                         <section>
192                                 <title>Update the System Dynamic Library Path</title>
193                                 <para>As the <emphasis role="bold">root</emphasis> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating a new file named <emphasis role="bold">/etc/ld.so.conf.d/osrf.conf</emphasis> containing a new library path, then run the command <emphasis role="bold">ldconfig</emphasis> to automatically read the file and modify the system dynamic library path:</para>
194                                 <figure>
195                                         <title>Commands to modify system dynamic library path</title>
196                                         <screen>
197                                         $ su - root
198                                         $ echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf
199                                         $ ldconfig
200                                         </screen>
201                                 </figure>
202                         </section>
203                         <section>
204                                 <title>Define Public and Private OpenSRF Domains</title>
205                                 <para>Define your public and private OpenSRF domains. For security purposes, OpenSRF uses Jabber domains to separate services into public and private realms. Throughout these instructions, we will use the example domains <emphasis>public.localhost</emphasis> for the public domain and <emphasis>private.localhost</emphasis> for the private domain. On a single-server system, the easiest way to define public and private domains is to define separate hostnames by adding entries to the file <emphasis>/etc/hosts</emphasis>.</para>
206                                 <para>As the <emphasis role="bold">root</emphasis> user, edit the file <emphasis>/etc/hosts</emphasis> and add the following entries for our example domains:</para>
207                                 <figure>
208                                         <title>Example public and private domains in /etc/hosts</title>
209                                         <screen>
210                                         127.0.1.2       public.localhost        public
211                                         127.0.1.3       private.localhost       private
212                                         </screen>
213                                 </figure>
214                         </section>
215                         <section>
216                                 <title>Change File Ownerships</title>
217                                 <para>As the <emphasis role="bold">root</emphasis> user, change the ownership of files installed in the directory <emphasis>/openils</emphasis> to the user "opensrf":</para>
218                                 <figure>
219                                         <title>Commands to change file ownerships</title>
220                                         <screen>
221                                         $ chown -R opensrf:opensrf /openils
222                                         </screen>
223                                 </figure>
224                         </section>
225                         <section>
226                                 <title>Stop the "ejabberd" Service</title>
227                                 <para>As the <emphasis role="bold">root</emphasis> user, stop the "ejabberd" service:</para>
228                                 <figure>
229                                         <title>Commands to stop the "ejabberd" service</title>
230                                         <screen>
231                                         $ /etc/init.d/ejabberd stop
232                                         </screen>
233                                 </figure>
234                                 <para>If "ejabberd" reports that it is already stopped, it may have run into a problem starting back at the installation stage. One possible fix is to kill any remaining <emphasis>beam</emphasis> and <emphasis>epmd</emphasis> processes, then edit the <emphasis>ejabberd</emphasis> configuration file to hardcode a domain:</para>
235                                 <figure>
236                                         <title>Commands to recover from "ejabberd" error</title>
237                                         <screen>
238                                         $ su - root
239                                         $ epmd -kill
240                                         $ killall beam; killall beam.smp
241                                         $ rm /var/lib/ejabberd/*
242                                         $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd
243                                         </screen>
244                                 </figure>
245                         </section>
246                         <section>
247                                 <title>Edit the "ejabberd" configuration</title>
248                                 <para>As the <emphasis role="bold">root</emphasis> user, edit the file <emphasis>/etc/ejabberd/ejabberd.cfg</emphasis> and make the following changes:</para>
249                                 <itemizedlist>
250                                         <listitem>Change <emphasis role="bold">{hosts, ["localhost"]}.</emphasis> to <emphasis role="bold">{hosts, ["localhost", "private.localhost", "public.localhost"]}.</emphasis></listitem>
251                                         <listitem>Change <emphasis role="bold">{max_user_sessions, 10}.</emphasis> to <emphasis role="bold">{max_user_sessions, 10000}.</emphasis> If you see something like this instead: <emphasis role="bold">{access, max_user_sessions, [{10, all}]}.</emphasis>, then change it to <emphasis role="bold">{access, max_user_sessions, [{10000, all}]}.</emphasis></listitem>
252                                         <listitem>Change all three occurrences of <emphasis role="bold">max_stanza_size</emphasis> to <emphasis role="bold">2000000</emphasis>.</listitem>
253                                         <listitem>Change both occurrences of <emphasis role="bold">maxrate</emphasis> to <emphasis role="bold">500000</emphasis>.       </listitem>
254                                         <listitem>Comment out the line <emphasis role="bold">{mod_offline, []}</emphasis> by placing two <emphasis role="bold">%</emphasis> comment signs in front.</listitem>
255                                 </itemizedlist>
256                         </section>
257                         <section>
258                                 <title>Restart the "ejabberd" service</title>
259                                 <para>As the <emphasis role="bold">root</emphasis> user, restart the <emphasis>ejabberd</emphasis> service to test the configuration changes and to register your users:</para>
260                                 <figure>
261                                         <title>Commands to restart the "ejabberd" service</title>
262                                         <screen>
263                                         $ /etc/init.d/ejabberd start
264                                         </screen>
265                                 </figure>
266                         </section>
267                         <section>
268                                 <title>Register "router" and "ejabberd" users</title>
269                                 <para>On each domain, you need two "ejabberd" users to manage the OpenSRF communications:</para>
270                                 <itemizedlist>
271                                         <listitem>a "router" user, to whom all requests to connect to an OpenSRF service will be routed; this "ejabberd" user must be named "router"</listitem>
272                                         <listitem>an "opensrf" user, which clients use to connect to OpenSRF services; this user can be named anything you like, but we will use "opensrf" in our examples</listitem>
273                                 </itemizedlist>
274                                 <para>As the <emphasis role="bold">root</emphasis> user, use the utility "ejabberdctl" 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 <emphasis>/openils/conf/opensrf_core.xml</emphasis>:</para>
275                                 <figure>
276                                         <title>Commands to registe "router" and "ejabberd" users</title>
277                                         <screen>
278                                         # Syntax for registering a user with ejabberdctl:
279                                         #    ejabberdctl register &lt;user> &lt;domain> &lt;password>
280                                         #
281                                         $ ejabberdctl register router private.localhost &lt;password>
282                                         $ ejabberdctl register opensrf private.localhost &lt;password>
283                                         $ ejabberdctl register router public.localhost &lt;password>
284                                         $ ejabberdctl register opensrf public.localhost &lt;password>
285                                         </screen>
286                                 </figure>
287                         </section>
288                         <section>
289                                 <title>Create configuration files</title>
290                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, use the example templates to create the configuration files <emphasis>/openils/conf/opensrf_core.xml</emphasis> and <emphasis>/openils/conf/opensrf.xml</emphasis>:</para>
291                                 <figure>
292                                         <title>Commands to create configuration files</title>
293                                         <screen>
294                                         $ su - root
295                                         $ cd /openils/conf
296                                         $ cp opensrf.xml.example      opensrf.xml
297                                         $ cp opensrf_core.xml.example opensrf_core.xml
298                                         </screen>
299                                 </figure>
300                         </section>
301                         <section>
302                                 <title>Edit opensrf_core.xml</title>
303                                 <para>Edit the file <emphasis>/openils/conf/opensrf_core.xml</emphasis> to change the "ejabberd" usernames and passwords as follows.</para>
304                                 <note>
305                                         <para>
306                                                 <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>
307                                         </para>
308                                 </note>
309                                 <figure>
310                                         <title>Updates needed in the file "/openils/conf/opensrf_core.xml"</title>
311                                         <screen>
312                                         /config/opensrf/username = opensrf
313
314                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
315
316                                         /config/gateway/username = opensrf
317
318                                         /config/gateway/passwd = password for "public.localhost" opensrf user
319
320                                         # first entry, where "transport/server" == "public.localhost" :
321                                         /config/routers/router/transport 
322                                             username = router
323                                             password = password for "public.localhost" router user
324
325                                         # second entry, where "transport/server" == "private.localhost" :
326                                         /config/routers/router/transport
327                                             username = router
328                                             password = password for "private.localhost" router user
329                                         </screen>
330                                 </figure>
331                                 <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 "private.localhost" / "public.localhost" domains, these will already be set to the correct values. Otherwise, search and replace to match your values.</para>
332                         </section>
333                         <section>
334                                 <title>Modify the file "opensrf.xml"</title>
335                                 <para>Modify the file <emphasis>/openils/conf/opensrf.xml</emphasis>.</para>
336                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, edit the file to set the location of the persistent database in the <emphasis role="bold">&lt;dbfile></emphasis> element near the end of the file:</para>
337                                 <figure>
338                                         <title>Example of the file "opensrf.xml"</title>
339                                         <screen>
340                                         &lt;!-- Example of an app-specific setting override -->
341                                         &lt;opensrf.persist>
342                                           &lt;app_settings>
343                                             &lt;dbfile>/tmp/persist.db&lt;/dbfile>
344                                           &lt;/app_settings>
345                                         &lt;/opensrf.persist>
346                                         </screen>
347                                 </figure>
348                         </section>
349                         <section>
350                                 <title>Create Configuration Files for Users Needing srfsh</title>
351                                 <para>In this section you will set up a special configuration file for each user who will need to run the <emphasis>srfsh</emphasis> (surf shell) utility.</para>
352                                 <para>The software installation will automatically create <emphasis>srfsh</emphasis>. This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See the section <link linkend="serversideinstallation-testing">"Testing the Installation"</link> for further information.</para>
353                                 <para>As the <emphasis role="bold">root</emphasis> user, copy the short sample configuration file <emphasis>/openils/conf/srfsh.xml.example</emphasis> to the file <emphasis>.srfsh.xml</emphasis> (note the leading dot!) in the home directory of each user who will use <emphasis role="bold">srfsh</emphasis>. Finally, edit each file <emphasis>.srfsh.xml</emphasis> and make the following changes. When you finish, remember to change the owner of the file to match the owner of the home directory.</para>
354                                 <itemizedlist>
355                                         <listitem>Modify <emphasis role="bold">domain</emphasis> to be the router hostname (following our domain examples, <emphasis role="bold">private.localhost</emphasis> will give <emphasis>srfsh</emphasis> access to all OpenSRF services, while <emphasis role="bold">public.localhost</emphasis> will only allow access to those OpenSRF services that are publicly exposed).</listitem>
356                                         <listitem>Modify <emphasis role="bold">username</emphasis> and <emphasis role="bold">password</emphasis> to match the <emphasis role="bold">opensrf</emphasis> Jabber user for the chosen domain</listitem>
357                                         <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
358                                         <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
359                                 </itemizedlist>
360                                 <figure>
361                                         <title>Example of the file "/openils/conf/srfsh.xml.example"</title>
362                                         <screen>
363                                         &lt;?xml version="1.0"?>
364                                         &lt;!-- This file follows the standard bootstrap config file layout -->
365                                         &lt;!-- found in opensrf_core.xml -->
366                                         &lt;srfsh>
367                                         &lt;router_name>router&lt;/router_name>
368                                         &lt;domain>private.localhost&lt;/domain>
369                                         &lt;username>opensrf&lt;/username>
370                                         &lt;passwd>privsrf&lt;/passwd>
371                                         &lt;port>5222&lt;/port>
372                                         &lt;logfile>/tmp/srfsh.log&lt;/logfile>
373                                         &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
374                                         &lt;loglevel>4&lt;/loglevel>
375                                         &lt;/srfsh>
376                                         </screen>
377                                 </figure>
378                         </section>
379                         <section>
380                                 <title>Modify Environmental Variable PATH for "opensrf" User</title>
381                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, modify the environmental variable PATH by adding a new file path to the <emphasis>opensrf</emphasis> user's shell configuration file <emphasis>.bashrc</emphasis>:</para>
382                                 <figure>
383                                         <title>Commands to add path to ".bashrc" configuration file</title>
384                                         <screen>
385                                         $ su - opensrf
386                                         $ echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc
387                                         </screen>
388                                 </figure>
389                         </section>
390                         <section>
391                                 <title>Starting OpenSRF</title>
392                                 <para>As the <emphasis role="bold">root</emphasis> user, start the "ejabberd" and "memcached" services:</para>
393                                 <figure>
394                                         <title>Commands to start "ejabberd" and "memcached" services</title>
395                                         <screen>
396                                         $ su - root
397                                         $ /etc/init.d/ejabberd start
398                                         $ /etc/init.d/memcached start
399                                         </screen>
400                                 </figure>
401                                 <para/>
402                                 <para>Finally, as the <emphasis role="bold">opensrf</emphasis> user, start OpenSRF:</para>
403                                 <figure>
404                                         <title>Commands to start OpenSRF</title>
405                                         <screen>
406                                         $ su - opensrf
407
408                                         # ensure you have the needed path
409                                         $ export PATH=$PATH:/openils/bin
410
411                                         # start the OpenSRF service:
412                                         # use "-l" to force hostname to be "localhost"
413                                         $ osrf_ctl.sh -l -a start_all     
414                                         </screen>
415                                 </figure>
416                                 <note>
417                                         <para>
418                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but <emphasis>osrf_ctl.sh</emphasis> must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <emphasis>opensrf.xml</emphasis>, which you configured in a previous step.</emphasis>
419                                         </para>
420                                 </note>
421                         </section>
422                         <section>
423                                 <title>Testing connections to OpenSRF</title>
424                                 <para>Once you have installed and started OpenSRF, as the <emphasis role="bold">root</emphasis> user, test your connection to OpenSRF using the utility <emphasis>srfsh</emphasis> and trying to call the <emphasis>add</emphasis> method on the OpenSRF "math" service:</para>
425                                 <figure>
426                                         <title>Commands to test OpenSRF with "srfsh"</title>
427                                         <screen>
428                                         $ su - opensrf
429                                         $ /openils/bin/srfsh
430                                         srfsh#  request opensrf.math add 2 2
431                                         Received Data: 4
432                                         ------------------------------------
433                                         Request Completed Successfully
434                                         Request Time in seconds: 0.007519
435                                         ------------------------------------
436                                         srfsh#
437                                         </screen>
438                                 </figure>
439                                 <caution fileref="media/caution.png"> VERIFY THIS TEST </caution>
440                                 <para>For other srfsh commands, type 'help' in at the prompt.</para>
441                         </section>
442                         <section>
443                                 <title>Stopping OpenSRF</title>
444                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, stop OpenSRF:</para>
445                                 <figure>
446                                         <title>Commands to stop OpenSRF</title>
447                                         <screen>
448                                         $ su - opensrf
449                                         $ osrf_ctl.sh -l -a stop_all
450                                         </screen>
451                                 </figure>
452                         </section>
453                 </section>
454                 <section xml:id="serversideinstallation-ubuntudebian">
455                         <title>Installing Evergreen 1.6.0.x On Ubuntu or Debian</title>
456                         <para>This section outlines the installation process for the latest stable version of Evergreen (1.6.0.7).</para>
457                         <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>
458                         <note>
459                                 <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>
460                                 <para>In the following instructions, you are asked to perform certain steps as either the <emphasis role="bold">root</emphasis> user, the <emphasis role="bold">opensrf</emphasis> user, or the <emphasis role="bold">postgres</emphasis> user.</para>
461                                 <itemizedlist>
462                                         <listitem><emphasis role="bold">Debian</emphasis> -- To become the <emphasis>root</emphasis> user, issue the command <emphasis role="bold">"su -"</emphasis> and enter the password of the root user.</listitem>
463                                         <listitem><emphasis role="bold">Ubuntu</emphasis> -- To become the <emphasis>root</emphasis> user, issue the command <emphasis role="bold">"sudo su -"</emphasis> and enter the password of your current user.</listitem>
464                                 </itemizedlist>
465                                 <para>To switch from the <emphasis role="bold">root</emphasis> user to a different user, issue the command <emphasis role="bold">"su - USERNAME"</emphasis>. For example, to switch from the <emphasis role="bold">root</emphasis> user to the <emphasis role="bold">opensrf</emphasis> user, issue the command <emphasis role="bold">"su - opensrf"</emphasis>. Once you have become a non-root user, to become the <emphasis role="bold">root</emphasis> user again, simply issue the command <emphasis role="bold">"exit"</emphasis>.</para>
466                         </note>
467                         <section xml:id="serversideinstallation-opensrf-overview">
468                                 <title>Installing OpenSRF</title>
469                                 <para>Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see the section <link linkend="serversideinstallation-opensrf">"Installing OpenSRF"</link>.</para>
470                                 <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>
471                         </section>
472                         <section>
473                                 <title>Download and Unpack Latest Evergreen Version</title>
474                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, download and extract the latest version of Evergreen. The latest version can be found here: <emphasis><emphasis role="bold"><ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz"></ulink></emphasis></emphasis></para>
475                                 <figure>
476                                         <title>Commands to download and unpack Evergreen</title>
477                                         <screen>
478                                         $ su - opensrf
479                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz
480                                         $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz
481                                         </screen>
482                                 </figure>
483                                 <para>The new directory <emphasis>/home/opensrf/Evergreen-ILS-1.6.0.1</emphasis> will be created.</para>
484                         </section>
485                         <section>
486                                 <title>Install Prerequisites to Build Evergreen</title>
487                                 <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 <emphasis>make</emphasis> utility.</para>
488                                 <para>As the <emphasis role="bold">root</emphasis> 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 Linux distribution listed in the <link linkend="serversideinstallation-keywords-figure-2">"Keywords"</link> figure below.</para>
489                                 <figure>
490                                         <title>Commands to install prerequisites for Evergreen</title>
491                                         <screen>
492                                         $ su - root
493                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
494                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]
495                                         ...
496                                         </screen>
497                                 </figure>
498                                 <table xml:id="serversideinstallation-keywords-figure-2">
499                                         <title>Keywords Targets for "make"</title>
500                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">
501                                                 <colspec colnum="1" colwidth="1*"/>
502                                                 <colspec colnum="2" colwidth="3*"/>
503                                                 <thead>
504                                                         <row>
505                                                                 <entry>Keyword</entry>
506                                                                 <entry>Description</entry>
507                                                         </row>
508                                                 </thead>
509                                                 <tbody>
510                                                         <row>
511                                                                 <entry>debian-lenny</entry>
512                                                                 <entry>for Debian Lenny (5.0), the most recent version</entry>
513                                                         </row>
514                                                         <row>
515                                                                 <entry>debian-etch</entry>
516                                                                 <entry>for Debian Etch (4.0)</entry>
517                                                         </row>
518                                                         <row>
519                                                                 <entry>ubuntu-karmic</entry>
520                                                                 <entry>for Ubuntu Lucid (10.04) [same as for Karmic]</entry>
521                                                         </row>
522                                                         <row>
523                                                                 <entry>ubuntu-karmic</entry>
524                                                                 <entry>for Ubuntu Karmic (9.10)</entry>
525                                                         </row>
526                                                         <row>
527                                                                 <entry>ubuntu-intrepid</entry>
528                                                                 <entry>for Ubuntu Intrepid (8.10)</entry>
529                                                         </row>
530                                                         <row>
531                                                                 <entry>ubuntu-hardy</entry>
532                                                                 <entry>for Ubuntu Hardy (8.04)</entry>
533                                                         </row>
534                                                         <row>
535                                                                 <entry>ubuntu-gutsy</entry>
536                                                                 <entry>for Ubuntu Gutsy (7.10)</entry>
537                                                         </row>
538                                                         <row>
539                                                                 <entry>gentoo</entry>
540                                                                 <entry>generic for Gentoo versions</entry>
541                                                         </row>
542                                                         <row>
543                                                                 <entry>centos</entry>
544                                                                 <entry>generic for Centos versions</entry>
545                                                         </row>
546                                                 </tbody>
547                                         </tgroup>
548                                 </table>
549                                 <caution fileref="media/caution.png"> ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>
550                         </section>
551                         <section>
552                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>
553                                 <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>
554                                 <para>For further information on installing PostgreSQL, see the section <link linkend="serversideinstallation-postgresql">"Installing PostgreSQL"</link>.</para>
555                                 <para>If your PostgreSQL server will be on the same system as your Evergreen software, then as the <emphasis role="bold">root</emphasis> user install the required PostgreSQL server packages:</para>
556                                 <figure>
557                                         <title>Commands to install the PostgreSQL server</title>
558                                         <screen>
559                                         $ su - root
560         
561                                         # Debian Lenny and Ubuntu Hardy (8.04)
562                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
563                                         ...
564
565                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
566                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
567                                         ...
568                                         </screen>
569                                 </figure>
570                                 <note>
571                                         <para>
572                                                 <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>
573                                         </para>
574                                 </note>
575                                 <caution fileref="media/caution.png"> VERIFY: IS THIS STILL TRUE? </caution>
576                                 <caution fileref="media/caution.png"> ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE </caution>
577                         </section>
578                         <section>
579                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
580                                 <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>
581                                 <para>Otherwise, if your PostgreSQL server is running on another system, then as the <emphasis role="bold">root</emphasis> user install the following Perl modules on that system:</para>
582                                 <figure>
583                                         <title>Commands to install Perl modules</title>
584                                         <screen>
585                                         # ensure the gcc compiler is installed
586                                         $ su - root
587                                         $ aptitude install gcc
588         
589                                         # install the Perl modules
590                                         $ perl -MCPAN -e shell
591                                         cpan> install JSON::XS
592                                         cpan> install MARC::Record
593                                         cpan> install MARC::File::XML
594                                         </screen>
595                                 </figure>
596                                 <caution fileref="media/caution.png"> ADD INFO ON HOW TO INSTALL THE PERL MODULES </caution>
597                                 <caution fileref="media/caution.png"> ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </caution>
598                         </section>
599                         <section>
600                                 <title>Update the System Dynamic Library Path</title>
601                                 <para>As the <emphasis role="bold">root</emphasis> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating a new file named <emphasis role="bold">/etc/ld.so.conf.d/eg.conf</emphasis> containing two new library paths, then run the command <emphasis role="bold">ldconfig</emphasis> to automatically read the file and modify the system dynamic library path:</para>
602                                 <figure>
603                                         <title>Commands to modify system dynamic library path</title>
604                                         <screen>
605                                         $ su - root
606                                         $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
607                                         /usr/local/lib
608                                         /usr/local/lib/dbd
609                                         ENDOFFILE
610                                         $ ldconfig
611                                         </screen>
612                                 </figure>
613                         </section>
614                         <section>
615                                 <title>(OPTIONAL) Restart the PostgreSQL Service</title>
616                                 <para>If PostgreSQL is running on the same system as the rest of Evergreen, as the <emphasis role="bold">root</emphasis> user you must restart the PostgreSQL service to avoid a problem where the library <emphasis role="bold">plperl.so</emphasis> cannot be found. If your PostgreSQL server is running on another system, just skip this step.</para>
617                                 <caution fileref="media/caution.png"> ADD INFO ON OTHER VERSIONS OF POSTGRESQL </caution>
618                                 <figure>
619                                         <title>Commands to restart PostgreSQL service</title>
620                                         <screen>
621                                         $ su - root
622                                         $ /etc/init.d/postgresql-PGSQL_VERSION restart
623                                         </screen>
624                                 </figure>
625                                 <emphasis>Where "PGSQL_VERSION" is your installed PostgreSQL version (e.g. "8.3").</emphasis>
626                         </section>
627                         <section xml:id="serversideinstallation-configure">
628                                 <title>Configure Evergreen</title>
629                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, return to the Evergreen build directory and use the utility "configure" to prepare for the next step of compiling and linking the software:</para>
630                                 <figure>
631                                         <title>Commands to configure Evergreen</title>
632                                         <screen>
633                                         $ su - opensrf
634                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
635                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
636                                         $ make
637                                         ...
638                                         </screen>
639                                 </figure>
640                         </section>
641                         <section xml:id="serversideinstallation-compilingevergreen">
642                                 <title>Compile, Link and Install Evergreen</title>
643                                 <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>
644                                 <para>As the <emphasis role="bold">root</emphasis> user, return to the Evergreen build directory and use the <emphasis>make</emphasis> command as shown below. The Staff Client will also be automatically built, but you must remember to set the variable <emphasis role="bold">STAFF_CLIENT_BUILD_ID</emphasis> to match the version of the Staff Client you will use to connect to the Evergreen server.</para>
645                                 <para>For further information on manually building the Staff Client, see the section <link linkend="serversideinstallation-staffclient">"Installing the Evergreen Staff Client"</link>.</para>
646                                 <figure>
647                                         <title>Commands to build, link and install Evergreen</title>
648                                         <screen>
649                                         $ su - root
650                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
651                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
652                                         ...
653                                         </screen>
654                                         <para>The above commands will create a new subdirectory <emphasis>/openils/var/web/xul/rel_1_6_0_7</emphasis> containing the Staff Client.</para>
655                                 </figure>
656                                 <para>To complete the Staff Client installation, as the <emphasis role="bold">root</emphasis> user create a symbolic link named <emphasis>server</emphasis> in the head of the Staff Client directory <emphasis>/openils/var/web/xul</emphasis> that points to the <emphasis>/server</emphasis> subdirectory of the new Staff Client build:</para>
657                                 <figure>
658                                         <title>Commands to create symbolic link</title>
659                                         <screen>
660                                         $ su - root
661                                         $ cd /openils/var/web/xul
662                                         $ ln -sf rel_1_6_0_7/server server
663                                         </screen>
664                                 </figure>
665                         </section>
666                         <section>
667                                 <title>Copy the OpenSRF Configuration Files</title>
668                                 <para>As the <emphasis role="bold">root</emphasis> 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 user <emphasis role="bold">opensrf</emphasis>:</para>
669                                 <figure>
670                                         <title>Commands to copy OpenSRF configuration files</title>
671                                         <screen>
672                                         $ su - root
673                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
674                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
675                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
676                                         $ chown -R opensrf:opensrf /openils/
677                                         </screen>
678                                 </figure>
679                         </section>
680                         <section>
681                                 <title>Create and Configure PostgreSQL Database</title>
682                                 <para>As the <emphasis role="bold">postgres</emphasis> user on your PostgreSQL server, create the Evergreen database.</para>
683                                 <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 <emphasis role="bold">/usr/local/share/contrib</emphasis>; if you installed the PostgreSQL 8.3 server packages on Ubuntu 8.04, the path would be <emphasis role="bold">/usr/share/postgresql/8.3/contrib/</emphasis>.</para>
684                                 <orderedlist>
685                                         <listitem>
686                                                 <para>
687                                                         <emphasis role="bold">Create and configure the database</emphasis>
688                                                 </para>
689                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
690                                                 <figure>
691                                                         <title>Commands to create database and adjust the path</title>
692                                                         <screen>
693                                                         # create the database
694                                                         $ su - postgres
695                                                         $ createdb -E UNICODE evergreen
696                                                         $ createlang plperl   evergreen
697                                                         $ createlang plperlu  evergreen
698                                                         $ createlang plpgsql  evergreen
699                 
700                                                         # adjust the paths
701                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen
702                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen
703                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen
704                                                         </screen>
705                                                 </figure>
706                                                 <emphasis>Where "PGSQL_VERSION" is your installed PostgreSQL version (e.g. "8.3").</emphasis>
707                                         </listitem>
708                                         <listitem>
709                                                 <para><emphasis role="bold">Create new Evergreen superuser</emphasis> </para>
710                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system, create the new database user <emphasis role="bold">evergreen</emphasis> and assign a password:</para>
711                                                 <figure>
712                                                         <title>Commands to create the "evergreen" user</title>
713                                                         <screen>
714                                                         # create superuser 'evergreen' and set the password
715                                                         $ su - postgres
716                                                         $ createuser -P -s evergreen
717                                                         Enter password for new role: MYNEWPASSWORD
718                                                         Enter it again: MYNEWPASSWORD
719                                                         </screen>
720                                                 </figure>
721                                                 <emphasis>Where "MYNEWPASSWORD" is the password chosen.</emphasis>
722                                         </listitem>
723                                 </orderedlist>
724                         </section>
725                         <section>
726                                 <title>Create Database Schema</title>
727                                 <para>As the <emphasis role="bold">root</emphasis> user, create the database schema and configure your system with the corresponding database authentication details for the database user <emphasis>evergreen</emphasis> that you created in the previous step.</para>
728                                 <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>
729                                 <figure>
730                                         <title>Commands to create Evergreen database schema</title>
731                                         <screen>
732                                         $ su - root
733                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
734                                         $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
735                                                 --service all --create-schema --create-bootstrap --create-offline \
736                                                 --hostname HOSTNAME --port PORT \
737                                                 --user evergreen --password PASSWORD --database DATABASENAME
738                                         </screen>
739                                 </figure>
740                                 <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>
741                                 <note>
742                                         <para>
743                                                 <emphasis>If you are entering the above command on a single line, do not include the <emphasis><emphasis role="bold">\</emphasis></emphasis> (backslash) characters. If you are using the <emphasis role="bold">bash</emphasis> shell, these should only be used at the end of a line at a bash prompt to indicate that the command is continued on the next line.</emphasis>
744                                         </para>
745                                 </note>
746                         </section>
747                         <section>
748                                 <title>Configure the Apache Server</title>
749                                 <para>As the <emphasis role="bold">root</emphasis> user, configure the Apache server and copy several new configuration files to the Apache server directories:</para>
750                                 <figure>
751                                         <title>Commands to configure the Apache server</title>
752                                         <screen>
753                                         # configure the Apache server
754                                         $ su - root
755                                         $ a2enmod ssl        # enable mod_ssl
756                                         $ a2enmod rewrite    # enable mod_rewrite
757                                         $ a2enmod expires    # enable mod_expires
758                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
759         
760                                         # copy files
761                                         $ cp Open-ILS/examples/apache/eg.conf    /etc/apache2/sites-available/
762                                         $ cp Open-ILS/examples/apache/eg_vhost.conf   /etc/apache2/
763                                         $ cp Open-ILS/examples/apache/startup.pl      /etc/apache2/
764                                         </screen>
765                                 </figure>
766                         </section>
767                         <section>
768                                 <title>Create a Security Certificate (SSL Key)</title>
769                                 <para>Use the command <emphasis role="bold">openssl</emphasis> to create a new SSL key for your Apache server. For a public production server you should configure or purchase a signed SSL certificate, but for now you can just use a self-signed certificate and accept the warnings in the Staff Client and browser during testing and development:</para>
770                                 <figure>
771                                         <title>Commands to create an SSL key</title>
772                                         <screen>
773                                         $ mkdir /etc/apache2/ssl
774                                         $ cd /etc/apache2/ssl
775                                         $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
776                                         </screen>
777                                 </figure>
778                                 <warning>
779                                         <para>
780                                                 <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>
781                                         </para>
782                                 </warning>
783                                 <caution fileref="media/caution.png"> ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </caution>
784                         </section>
785                         <section xml:id="serversideinstallation-modify-apache">
786                                 <title>Modify the Apache Configuration File</title>
787                                 <para>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/sites-available/eg.conf</emphasis> and make the following changes:</para>
788                                 <orderedlist>
789                                         <listitem>
790                                                 <para>Comment out the line <emphasis role="bold">Allow from 10.0.0.0/8</emphasis>, then uncomment the line <emphasis role="bold">Allow from all</emphasis>.</para>
791                                                 <para>
792                                                         <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>
793                                                 </para>
794                                                 <warning>
795                                                         <para>
796                                                                 <emphasis>You must remove these changes after testing is completed. See the section <link linkend="serversideinstallation-postinstallation">"Post-Installation Chores"</link> for further details on removing this change after the Evergreen installation is complete.</emphasis>
797                                                         </para>
798                                                 </warning>
799                                         </listitem>
800                                         <listitem>
801                                                 <para>Comment out the line <emphasis role="bold">Listen 443</emphasis> as it conflicts with the same declaration in the configuration file: <emphasis>/etc/apache2/ports.conf</emphasis>. Debian <emphasis>etch</emphasis> users should not do this.</para>
802                                                 <caution fileref="media/caution.png"> ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </caution>
803                                         </listitem>
804                                         <listitem>
805                                                 <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>
806                                                 <itemizedlist>
807                                                         <listitem>
808                                                                 <para>For the Linux distributions <emphasis>Ubuntu Hardy</emphasis> or <emphasis>Debian Etch</emphasis>, as the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/apache2.conf</emphasis> and change the user: <emphasis role="bold">www-data</emphasis> to the user: <emphasis role="bold">opensrf</emphasis>.</para>
809                                                         </listitem>
810                                                         <listitem>
811                                                                 <para>For the Linux distributions <emphasis>Ubuntu Karmic</emphasis> or <emphasis>Ubuntu Lucid</emphasis> or <emphasis>Debian Lenny</emphasis>, as the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/envvars</emphasis> 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>
812                                                         </listitem>
813                                                 </itemizedlist>
814                                         </listitem>
815                                         <listitem>
816                                                 <para>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/apache2.conf</emphasis> and add the line <emphasis role="bold">KeepAliveTimeout 1</emphasis>, or modify an existing line if it already exists.</para>
817                                         </listitem>
818                                 </orderedlist>
819                         </section>
820                         <section>
821                                 <title>(OPTIONAL) Performance Modifications for Apache</title>
822                                 <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>
823                                 <orderedlist>
824                                         <listitem>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/apache2.conf</emphasis>, locate and modify the section related to <emphasis>prefork configuration</emphasis> to suit the load on your system.</listitem>
825                                         <listitem>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/apache2.conf</emphasis> and add the line <emphasis role="bold">MaxKeepAliveRequests 100</emphasis>, or modify an existing line if it already exists.
826                                                 <figure><title>(OPTIONAL) Example of updates to Apache configuration</title><screen>
827                                                         &lt;IfModule mpm_prefork_module>
828                                                            StartServers           20
829                                                            MinSpareServers         5
830                                                            MaxSpareServers        15
831                                                            MaxClients            150
832                                                            MaxRequestsPerChild 10000
833                                                         &lt;/IfModule>
834                                                 
835                                                         MaxKeepAliveRequests 100
836                                                         </screen></figure></listitem>
837                                 </orderedlist>
838                         </section>
839                         <section>
840                                 <title>Enable the Evergreen Site</title>
841                                 <para>As the <emphasis role="bold">root</emphasis> user, execute the following Apache configuration commands to disable the default "It Works" web page and to enable the Evergreen web site:</para>
842                                 <figure>
843                                         <title>Commands to enable the Evergreen Web Site</title>
844                                         <screen>
845                                         $ su - root
846
847                                         # disable the default site
848                                         $ a2dissite default
849         
850                                         # enable the Evergreen web site
851                                         $ a2ensite eg.conf
852                                         </screen>
853                                 </figure>
854                         </section>
855                         <section>
856                                 <title>Modify the OpenSRF Configuration File</title>
857                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, edit the OpenSRF configuration file <emphasis>/openils/conf/opensrf_core.xml</emphasis> 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>
858                                 <para>If you are installing Evergreen on a single server and using the <emphasis>private.localhost</emphasis> / <emphasis>public.localhost</emphasis> domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values.</para>
859                                 <note>
860                                         <para>
861                                                 <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>
862                                         </para>
863                                 </note>
864                                 <caution fileref="media/caution.png"> ADD A BETTER DIAGRAM HERE </caution>
865                                 <figure>
866                                         <title>Updates needed in the file "/openils/conf/opensrf_core.xml"</title>
867                                         <screen>
868                                         /config/opensrf/username = opensrf
869         
870                                         /config/opensrf/passwd = password for "private.localhost" opensrf user
871         
872                                         /config/gateway/username = opensrf
873         
874                                         /config/gateway/passwd = password for "public.localhost" opensrf user
875         
876                                         # first entry, where "transport/server" == "public.localhost" :
877                                         /config/routers/router/transport 
878                                             username = router
879                                             password = password for "public.localhost" router user
880
881                                         # second entry, where "transport/server" == "private.localhost" :
882                                         /config/routers/router/transport
883                                             username = router
884                                             password = password for "private.localhost" router user
885                                         </screen>
886                                 </figure>
887                         </section>
888                         <section>
889                                 <title>Create Configuration Files for Users Needing srfsh</title>
890                                 <para>The software installation will automatically create a utility named <emphasis>srfsh</emphasis> (surf shell). This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See the section <link linkend="serversideinstallation-testing">"Testing the Installation"</link> for further information.</para>
891                                 <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 <emphasis>/openils/conf/srfsh.xml.example</emphasis> to the file <emphasis>.srfsh.xml</emphasis> (note the leading dot!) in the home directory of each user who will use <emphasis role="bold">srfsh</emphasis>. Finally, edit each users' <emphasis>.srfsh.xml</emphasis> file and make the following changes:</para>
892                                 <orderedlist>
893                                         <listitem>Modify <emphasis role="bold">domain</emphasis> to be the router hostname (following our domain examples, <emphasis role="bold">private.localhost</emphasis> will give <emphasis role="bold">srfsh</emphasis> access to all OpenSRF services, while <emphasis role="bold">public.localhost</emphasis> will only allow access to those OpenSRF services that are publicly exposed).</listitem>
894                                         <listitem>Modify <emphasis role="bold">username</emphasis> and <emphasis role="bold">password</emphasis> to match the <emphasis role="bold">opensrf</emphasis> Jabber user for the chosen domain</listitem>
895                                         <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
896                                         <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
897                                 </orderedlist>
898                                 <figure>
899                                         <title>Example of user's file ".srfsh.xml"</title>
900                                         <screen>
901                                         &lt;?xml version="1.0"?>
902                                         &lt;!-- This file follows the standard bootstrap config file layout -->
903                                         &lt;!-- found in opensrf_core.xml -->
904                                         &lt;srfsh>
905                                         &lt;router_name>router&lt;/router_name>
906                                         &lt;domain>private.localhost&lt;/domain>
907                                         &lt;username>opensrf&lt;/username>
908                                         &lt;passwd>evergreen&lt;/passwd>
909                                         &lt;port>5222&lt;/port>
910                                         &lt;logfile>/tmp/srfsh.log&lt;/logfile>
911                                         &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
912                                         &lt;loglevel>4&lt;/loglevel>
913                                         &lt;/srfsh>
914                                         </screen>
915                                 </figure>
916                         </section>
917                         <section>
918                                 <title>Modify the OpenSRF Environment</title>
919                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change the permissions of <emphasis>.cgi</emphasis> files in the directory <emphasis>/openils/var/cgi-bin</emphasis> to <emphasis>executable</emphasis>, then modify the shell configuration file <emphasis>~/.bashrc</emphasis> for <emphasis>opensrf</emphasis> by adding a Perl environmental variable. Finally, execute the shell configuration file to load the new variables into your current environment.</para>
920                                 <note>
921                                         <para>
922                                                 <emphasis>In a multi-server environment, you must add any modifications to <emphasis role="bold">~/.bashrc</emphasis> to the top of the file <emphasis>before</emphasis> the line <emphasis role="bold"> [ -z "$PS1" ] &amp;&amp; return</emphasis>. This will allow headless (scripted) logins to load the correct environment.</emphasis>
923                                         </para>
924                                 </note>
925                                 <figure>
926                                         <title>Commands to modify the OpenSRF environment</title>
927                                         <screen>
928                                         # change permissions
929                                         $ su - opensrf
930                                         $ chmod 755 /openils/var/cgi-bin/*.cgi
931         
932                                         # add environmental variable
933                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
934         
935                                         # inherit the new environment
936                                         $ . ~/.bashrc
937                                         </screen>
938                                 </figure>
939                         </section>
940                         <section xml:id="serversideinstallation-starting">
941                                 <title>Starting Evergreen</title>
942                                 <orderedlist>
943                                         <listitem>
944                                                 <para>As the <emphasis role="bold">root</emphasis> user, start the "ejabberd" and "memcached" services (if they are not already running):</para>
945                                                 <figure>
946                                                         <title>Commands to start "ejabberd" and "memcached" services</title>
947                                                         <screen>
948                                                         $ su - root
949                                                         $ /etc/init.d/ejabberd start
950                                                         $ /etc/init.d/memcached start
951                                                         </screen>
952                                                 </figure>
953                                         </listitem>
954                                         <listitem>
955                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, start Evergreen.</para>
956                                                 <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>
957                                                 <figure>
958                                                         <title>Commands to start Evergreen</title>
959                                                         <screen>
960                                                         $ su - opensrf
961
962                                                         # ensure you have the needed path
963                                                         $ export PATH=$PATH:/openils/bin
964
965                                                         # start the OpenSRF service:
966                                                         # use "-l" to force hostname to be "localhost"
967                                                         $ osrf_ctl.sh -l -a start_all     
968                                                         </screen>
969                                                 </figure>
970                                                 <note>
971                                                         <para>
972                                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but the utility <emphasis>osrf_ctl.sh</emphasis> must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <emphasis>opensrf.xml</emphasis>, which you configured in a previous step.</emphasis>
973                                                         </para>
974                                                 </note>
975                                                 <caution fileref="media/caution.png"> ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
976                                                 <para>Execute the following command to determine the fully qualified domain name of your system:</para>
977                                                 <figure>
978                                                         <title>(OPTIONAL) Commands to determine the fully qualified domain name</title>
979                                                         <screen>
980                                                         $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
981                                                         </screen>
982                                                 </figure>
983                                                 <itemizedlist>
984                                                         <listitem>When you attempt to start Evergreen, if you receive an error message similar to <emphasis>osrf_ctl.sh: command not found</emphasis>, then your environment variable <emphasis role="bold">PATH</emphasis> does not include the directory <emphasis>/openils/bin</emphasis>. As the <emphasis role="bold">opensrf</emphasis> user, edit the configuration file <emphasis>/home/opensrf/.bashrc</emphasis> and add the following line: <emphasis role="bold"><screen>export PATH=$PATH:/openils/bin</screen></emphasis></listitem>
985                                                         <listitem>When you attempt to start Evergreen, if you receive an error message similar to <emphasis>Can't locate OpenSRF/System.pm in @INC ... BEGIN failed--compilation aborted</emphasis>, then your environment variable <emphasis role="bold">PERL5LIB</emphasis> does not include the directory <emphasis>/openils/lib/perl5</emphasis>. As the <emphasis role="bold">opensrf</emphasis> user, edit the configuration file <emphasis>/home/opensrf/.bashrc</emphasis> and add the following line: <emphasis role="bold"><screen>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</screen></emphasis></listitem>
986                                                 </itemizedlist>
987                                         </listitem>
988                                         <listitem>
989                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, generate the Web files needed by the Staff Client and catalogue, and calculate the proximity of locations in the Organizational Unit tree (which allows <emphasis>Holds</emphasis> to work properly).</para>
990                                                 <para>You must do this the first time you start Evergreen, and after any changes you make to the library hierarchy in the configuration file <emphasis>config.cgi</emphasis>.</para>
991                                                 <figure>
992                                                         <title>Commands to generate web files</title>
993                                                         <screen>
994                                                         $ su - opensrf
995                                                         $ cd /openils/bin
996                                                         $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u
997                                                         Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
998                                                         Updating fieldmapper
999                                                         ...
1000                                                         </screen>
1001                                                         <caution fileref="media/caution.png"> ADD RESULTS OF TESTS FROM "autogen.sh" </caution>
1002                                                 </figure>
1003                                         </listitem>
1004                                         <listitem>
1005                                                 <para>As the <emphasis role="bold">root</emphasis> user, restart the Apache Web server:</para>
1006                                                 <figure>
1007                                                         <title>Commands to restart Apache web server</title>
1008                                                         <screen>
1009                                                         $ su - root
1010                                                         $ /etc/init.d/apache2 restart
1011                                                         </screen>
1012                                                 </figure>
1013                                                 <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>
1014                                         </listitem>
1015                                 </orderedlist>
1016                         </section>
1017                         <section xml:id="serversideinstallation-testing">
1018                                 <title>Testing the Installation</title>
1019                                 <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>
1020                                 <section xml:id="serversideinstallation-testing-connections">
1021                                         <title>Testing Connections to Evergreen</title>
1022                                         <para>Once you have installed and started Evergreen, test your connection to Evergreen. As the <emphasis role="bold">opensrf</emphasis> user start the utility <emphasis>srfsh</emphasis> and try logging onto the Evergreen server using the default administrator username and password. Following is sample output generated by executing that script after a successful Evergreen installation:</para>
1023                                         <figure>
1024                                                 <title>Commands to test Evergreen with "srfsh"</title>
1025                                                 <screen>
1026                                                 $ su - opensrf
1027                                                 $ /openils/bin/srfsh
1028                                                 srfsh% login admin open-ils
1029                                                 Received Data: "250bf1518c7527a03249858687714376"
1030                                                 ------------------------------------
1031                                                 Request Completed Successfully
1032                                                 Request Time in seconds: 0.045286
1033                                                 ------------------------------------
1034                                                 Received Data: {
1035                                                    "ilsevent":0,
1036                                                    "textcode":"SUCCESS",
1037                                                    "desc":" ",
1038                                                    "pid":21616,
1039                                                    "stacktrace":"oils_auth.c:304",
1040                                                    "payload":{
1041                                                       "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
1042                                                       "authtime":420
1043                                                    }
1044                                                 }
1045                                                 ------------------------------------
1046                                                 Request Completed Successfully
1047                                                 Request Time in seconds: 1.336568
1048                                                 ------------------------------------
1049                                                 </screen>
1050                                         </figure>
1051                                 </section>
1052                                 <section>
1053                                         <title>Other Connection Tests with "srfsh"</title>
1054                                         <para></para>
1055                                         <para>There is another <emphasis>srfsh</emphasis> command called <emphasis>math_bench</emphasis> that sends queries to the math servers. Note that opensrf.math and opensrf.dbmath must be running for this command to work:</para>
1056                                         <screen>
1057                                         srfsh# math_bench 10
1058                                         |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
1059                                         ++++++++++++++++++++++++++++++++++++++++
1060                                         Average round trip time: 0.033425
1061                                         srfsh#
1062                                         </screen>
1063                                         <para>The first argument is how many sets of 4 queries (+ - * /) are sent to <emphasis>opensrf.math</emphasis>. When the response is successful, you will see the string of "+" symbols. If the system is not running correctly, you will either get an exception or no result at all.</para>
1064                                         <para>For other srfsh commands, type 'help' in at the prompt.</para>
1065                                         <para/>
1066                                         <para>If this does not work, try the troubleshooting steps in the following section.</para>
1067                                 </section>
1068                                 <section>
1069                                         <title>Testing with "settings-tester.pl"</title>
1070                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, run the script <emphasis>settings-tester.pl</emphasis> to see if it finds any system configuration problems. Following is sample output generated by executing that script after a successful Evergreen installation:</para>
1071                                         <caution fileref="media/caution.png"> REWORK THIS DIAGRAM TO USE SAME IMAGE STANDARDS AS OTHER CHAPTERS </caution>
1072                                         <figure>
1073                                                 <title>Executing the script <emphasis>settings-tester.pl</emphasis></title>
1074                                                 <mediaobject>
1075                                                         <imageobject>
1076                                                                 <imagedata fileref="../media/serversideinstallation-testing-1.png" scalefit="1" width="100%"/>
1077                                                         </imageobject>
1078                                                 </mediaobject>
1079                                                 <mediaobject>
1080                                                         <imageobject>
1081                                                                 <imagedata fileref="../media/serversideinstallation-testing-2.png" scalefit="1" width="100%"/>
1082                                                         </imageobject>
1083                                                 </mediaobject>
1084                                         </figure>
1085                                         <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, <link linkend="troubleshooting">"Troubleshooting"</link>.</para>
1086                                         <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="http://open-ils.org/listserv.php">Evergreen development mailing list</ulink> for assistance before making any drastic changes to your system configuration.</para>
1087                                 </section>
1088                                 <section xml:id="serversideinstallation-testing-opac">
1089                                         <title>Testing the Catalog</title>
1090                                         <para>By default, the OPAC will live at the URL <emphasis>http://my.domain.com/opac/</emphasis>.</para>
1091                                         <para>Navigate to this URL and the front page of the OPAC should load. There is a basic text entry field with some extra search options. If you have any problems loading this page, check the Apache error logs. If the page loads but does not function correctly, then check for possible javascript errors. We hightly reccommend testing with the <emphasis>Firefox</emphasis> browser because of the helpful javascript debugging tools.</para>
1092                                         <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>
1093                                         <caution fileref="media/caution.png"> ADD OTHER SIMPLE FUNCTIONAL TESTS </caution>
1094                                 </section>
1095                                 <section>
1096                                         <title>Running the Evergreen Staff Client</title>
1097                                         <para>Run the Evergreen Staff Client by using the application <emphasis>XULRunner</emphasis> (installed automatically and by default with Firefox version 3.0 and later on Ubuntu and Debian distributions).</para>
1098                                         <para>For example, if the source files for the Evergreen installation are in the directory <emphasis>/home/opensrf/Evergreen-ILS-1.6.0.7/</emphasis>, start the Staff Client as follows:</para>
1099                                         <figure>
1100                                                 <title>Commands to run the Staff Client</title>
1101                                                 <screen>
1102                                                 $ su - opensrf
1103                                                 $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
1104                                                 </screen>
1105                                         </figure>
1106                                 </section>
1107                                 <section xml:id="serversideinstallation-starting-apache-server">
1108                                         <title>Testing the Apache Web Server</title>
1109                                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>
1110                                         <para>As the <emphasis role="bold">root</emphasis> user, execute the following commands. Note the use of <emphasis>restart</emphasis> to force the new Evergreen modules to be reloaded even if the Apache server is already running. Any problems found with your configuration files should be displayed:</para>
1111                                         <figure>
1112                                                 <title>Commands to test the Apache Web Server</title>
1113                                                 <screen>
1114                                                 $ su - root
1115                                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart
1116                                                 </screen>
1117                                         </figure>
1118                                 </section>
1119                         </section>
1120                         <section xml:id="serversideinstallation-stopping">
1121                                 <title>Stopping Evergreen</title>
1122                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, stop all Evergreen services by using the following command:</para>
1123                                 <figure>
1124                                         <title>Commands to stop Evergreen</title>
1125                                         <screen>
1126                                         $ su - opensrf
1127
1128                                         # stop the server:
1129                                         # use "-l" to force hostname to be "localhost"
1130                                         $ osrf_ctl.sh -l -a stop_all
1131                                         </screen>
1132                                 </figure>
1133                                 <note>
1134                                         <para>
1135                                                 <emphasis>You can also stop Evergreen services <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but the utility <emphasis>osrf_ctl.sh</emphasis> must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <emphasis>opensrf.xml</emphasis>, which you configured in a previous step.</emphasis>
1136                                         </para>
1137                                 </note>
1138                                 <caution fileref="media/caution.png"> ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>
1139                         </section>
1140                         <section xml:id="serversideinstallation-postinstallation">
1141                                 <title>Post-Installation Chores</title>
1142                                 <section>
1143                                         <title>Remove temporary changes from Apache configuration file</title>
1144                                         <para>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/sites-available/eg.conf</emphasis> again and make the following change:</para>
1145                                         <para>Uncomment the line <emphasis role="bold">Allow from 10.0.0.0/8</emphasis>, then comment out the line <emphasis role="bold">Allow from all</emphasis>. You modified this file in an earlier step as a temporary measure to expedite testing (see the section <link linkend="serversideinstallation-modify-apache">"Modify the Apache Configuration File"</link> 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>
1146                                 </section>
1147                                 <section>
1148                                         <title>Configure a permanent SSL key</title>
1149                                         <para>In a previous step, we used the command <emphasis role="bold">openssl</emphasis> to temporarily create a new SSL key for the Apache server. For a public production server you should configure or purchase a signed SSL certificate</para>
1150                                         <warning>
1151                                                 <para>
1152                                                         <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>
1153                                                 </para>
1154                                         </warning>
1155                                         <caution fileref="media/caution.png"> ADD EXPLANATION OF HOW TO GET PERMANENT SSL CERTIFICATE </caution>
1156                                 </section>
1157                                 <section>
1158                                         <title>Set Up Support For Reports</title>
1159                                         <para>Evergreen reports are extremely powerful, but some configuration is required. See the section <link linkend="report-introduction">"Reports"</link> for details.</para>
1160                                         <itemizedlist>
1161                                                 <listitem>
1162                                                         <para>Starting the Reporter Daemon</para>
1163                                                         <para>Once the <emphasis>open-ils.reporter</emphasis> process is running and enabled on the gateway, you can start the reporter daemon. That process periodically checks for requests for new reports or scheduled reports and gets them running.</para>
1164                                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, start the reporter daemon using the following command:</para>
1165                                                         <figure>
1166                                                                 <title>Commands to start the Reporter daemon</title>
1167                                                                 <screen>
1168                                                         $ su - opensrf
1169                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/src/reporter
1170                                                         $ ./clark-kent.pl --daemon
1171                                                         </screen>
1172                                                         </figure>
1173                                                         <para>You can also specify other options with this utility:</para>
1174                                                         <itemizedlist>
1175                                                                 <listitem>--sleep=interval      : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>
1176                                                                 <listitem>--lockfile=filename   : where to place the lockfile for the process; defaults to <emphasis>/tmp/reporter-LOCK</emphasis></listitem>
1177                                                                 <listitem>--concurrency=integer : number of reporter daemon processes to run; defaults to "1"</listitem>
1178                                                                 <listitem>--bootstrap=filename   : OpenSRF bootstrap configuration file; defaults to <emphasis>/openils/conf/opensrf_core.xml</emphasis></listitem>
1179                                                         </itemizedlist>
1180                                                 </listitem>
1181                                                 <listitem>
1182                                                         <para>Stopping the Reporter Daemon</para>
1183                                                         <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>
1184                                                         <note>
1185                                                                 <para>
1186                                                                         <emphasis>It is possible that several processes are running; see the optional commands in the previous section. As the <emphasis role="bold">opensrf</emphasis> user, perform the following commands to stop the Reporter daemon:</emphasis>
1187                                                                 </para>
1188                                                         </note>
1189                                                         <figure>
1190                                                                 <title>Commands to stop the Reporter daemon</title>
1191                                                                 <screen>
1192                                                 $ su - opensrf
1193                                                 # find and kill the process ID number(s)
1194                                                 $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
1195                                                 # remove the lock file
1196                                                 $ rm /tmp/reporter-LOCK
1197                                                 </screen>
1198                                                         </figure>
1199                                                 </listitem>
1200                                         </itemizedlist>
1201                                 </section>
1202                         </section>
1203                 </section>
1204                 <section xml:id="serversideinstallation-otherlinux">
1205                         <title>Installing On Other Linux Systems</title>
1206                         <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING ON OTHER LINUX SYSTEMS </caution>
1207                 </section>
1208                 <section xml:id="serversideinstallation-virtual">
1209                         <title>Installing In Virtualized Unix Environments</title>
1210                         <para>Evergreen software currently runs as a native application on any of several well-known Linux distributions (e.g., <emphasis>Ubuntu</emphasis> and <emphasis>Debian</emphasis>). It does not run as a native application on the Windows operating system (e.g., WindowsXP, WindowsXP Professional, Windows7), but the software can be installed and run on Windows via a virtualized Unix-guest Operating System (using, for example, VirtualBox or VMware to emulate a Linux environment).</para>
1211                         <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </caution>
1212                         <section xml:id="serversideinstallation-virtualized-virtualbox">
1213                                 <title>VirtualBox</title>
1214                                 <caution fileref="media/caution.png"> ADD CONTENT FOR VirtualBox </caution>
1215                         </section>
1216                         <section xml:id="serversideinstallation-virtualized-vmware">
1217                                 <title>VMware</title>
1218                                 <caution fileref="media/caution.png"> ADD CONTENT FOR VMware </caution>
1219                         </section>
1220                         <section xml:id="serversideinstallation-virtualized-virtualpc">
1221                                 <title>VirtualPC</title>
1222                                 <caution fileref="media/caution.png"> ADD CONTENT FOR VirtualPC </caution>
1223                         </section>
1224                 </section>
1225                 <section xml:id="serversideinstallation-previousversions">
1226                         <title>Installing Previous Versions of Evergreen</title>
1227                         <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>
1228                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold">1.4.0.6</emphasis></emphasis>. The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>.</para>
1229                         <section xml:id="serversideinstallation-ubuntudebian-previous">
1230                                 <title>Installing Evergreen 1.4.0.6 on Ubuntu or Debian</title>
1231                                 <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING EVERGREEN 1.4.0.6 ON UBUNTU OR DEBIAN </caution>
1232                         </section>
1233                         <section xml:id="serversideinstallation-opensrf-previous">
1234                                 <title>Installing OpenSRF 1.0.x</title>
1235                                 <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING OPENSRF 1.0.x </caution>
1236                         </section>
1237                 </section>
1238                 <section xml:id="serversideinstallation-postgresql">
1239                         <title>Installing PostgreSQL</title>
1240                         <caution fileref="media/caution.png"> ADD CONTENT FOR POSTGRESQL </caution>
1241                 </section>
1242                 <section xml:id="serversideinstallation-apache">
1243                         <title>Installing Apache</title>
1244                         <section>
1245                                 <title>Securing Apache (httpd)</title>
1246                                 <para>The main consideration is to secure the directory <emphasis>cgi-bin</emphasis>. The only persons that need access to this directory are Evergreen system administrators. This directory should be restricted by both IP (to those workstations designated as Evergeen Administration systems), and by username/password.</para>
1247                                 <caution fileref="media/caution.png"> ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </caution>
1248                                 <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>
1249                         </section>
1250                         <caution fileref="media/caution.png"> ADD MORE CONTENT FOR APACHE </caution>
1251                 </section>
1252         </section>
1253         <section xml:id="serversideinstallation-staffclient">
1254                 <title>Installation of the Staff Client</title>
1255                 <para>The Staff Client is automatically built by default as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side software. See the section <link linkend="serversideinstallation-compilingevergreen">"Compile, Link and Install Evergreen"</link> to review the final compile/link/install phase of the default Evergreen build process.</para>
1256                 <section>
1257                         <title>Building the Evergreen Staff Client</title>
1258                         <para>You can also build the Staff Client manually by running the <emphasis>make</emphasis> command in the source directory <emphasis>/home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</emphasis>. The <emphasis>make</emphasis> command accepts a number of options to build special versions of the Staff Client. Following is a list of environment variables that can be passed to <emphasis>make</emphasis> to influence the manual build process:</para>
1259                         <section>
1260                                 <title>Option STAFF_CLIENT_BUILD_ID</title>
1261                                 <para>This variable defaults to an automatically generated date/time string during the normal Evergreen server-side software installation process, but you can also specify it manually. The following commands could have been used during the normal build process:</para>
1262                                 <figure>
1263                                         <title>Commands for normal Evergreen build</title>
1264                                         <screen>
1265                                                 $ su - root
1266                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
1267                                                 $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
1268                                                 ...
1269                                                 </screen>
1270                                 </figure>
1271                                 <para>You can also manually set the BUILD_ID. The following commands will manually build the Staff Client using a different BUILD_ID.</para>
1272                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>
1273                                 <figure>
1274                                         <title>Commands to manually build the Staff Client</title>
1275                                         <screen>
1276                                                 $ su - opensrf
1277                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1278                                                 $ make STAFF_CLIENT_BUILD_ID=my_test_id  build
1279                                                 ...
1280                                                 </screen>
1281                                 </figure>
1282                         </section>
1283                         <section>
1284                                 <title>Option STAFF_CLIENT_VERSION</title>
1285                                 <para>During the normal Evergreen server-side software build process this variable is pulled automatically from a README file in the Evergreen source root, but you can also specify it manually. The following commands could have been used during the normal build process:</para>
1286                                 <figure>
1287                                         <title>Commands used for normal Evergreen build</title>
1288                                         <screen>
1289                                                 $ su - root
1290                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
1291                                                 $ make STAFF_CLIENT_VERSION=0mytest.200 install
1292                                                 ...
1293                                                 </screen>
1294                                 </figure>
1295                                 <para>If you manually build the Staff Client, VERSION will default to <emphasis>0trunk.revision</emphasis>, where revision is either automatically pulled from SVN or an empty string on failure. If you wish to make extensions update automatically then your version needs to conform to the format found in <ulink url="https://developer.mozilla.org/en/Toolkit_version_format">Toolkit Version Format</ulink> and newer versions need to be "higher" than older versions.</para>
1296                                 <para>You can manually set VERSION. The following commands will manually build the Staff Client using a different VERSION.</para>
1297                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>
1298                                 <figure>
1299                                         <title>Commands to manually build the Staff Client</title>
1300                                         <screen>
1301                                                 $ su - opensrf
1302                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1303                                                 $ make STAFF_CLIENT_VERSION=0mytest.200  build
1304                                                 ...
1305                                                 </screen>
1306                                 </figure>
1307                         </section>
1308                         <section>
1309                                 <title>Option STAFF_CLIENT_STAMP_ID variable</title>
1310                                 <para>During the normal Evergreen server-side software build process this variable is generated from STAFF_CLIENT_VERSION, but you can also specify it manually. The following commands could have been used during the normal build process:</para>
1311                                 <figure>
1312                                         <title>Commands used for normal Evergreen build</title>
1313                                         <screen>
1314                                                 $ su - root
1315                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
1316                                                 $ make STAFF_CLIENT_STAMP_ID=my_test_stamp install
1317                                                 ...
1318                                                 </screen>
1319                                 </figure>
1320                                 <para>It is possible to have multiple versions of the Staff Client with different stamps, possibly for different uses or client-side customizations.</para>
1321                                 <para>You can manually set STAMP_ID. The following commands will manually build the Staff Client using a different STAMP_ID.</para>
1322                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>
1323                                 <figure>
1324                                         <title>Commands to manually build the Staff Client</title>
1325                                         <screen>
1326                                                 $ su - opensrf
1327                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1328                                                 $ make STAFF_CLIENT_STAMP_ID=my_test_stamp  build
1329                                                 ...
1330                                                 </screen>
1331                                 </figure>
1332                         </section>
1333                 </section>
1334                 <section>
1335                         <title>Advanced Build Options</title>
1336                         <para>In addition to the basic options listed above, there are a number of other options for building the Staff Client. Most are target names for the <emphasis>make</emphasis> utility and require that you build the Staff Client from its source directory. See the following table for a list of possible <emphasis>make</emphasis> target keywords:</para>
1337                         <table>
1338                                 <title>Keywords Targets for "make" Command</title>
1339                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1340                                         <colspec colnum="1" colwidth="1*"/>
1341                                         <colspec colnum="2" colwidth="3*"/>
1342                                         <thead>
1343                                                 <row>
1344                                                         <entry>Keyword</entry>
1345                                                         <entry>Description</entry>
1346                                                 </row>
1347                                         </thead>
1348                                         <tbody>
1349                                                 <row>
1350                                                         <entry>clients</entry>
1351                                                         <entry>Run "make win-client", "make linux-client", and "make generic-client" individually</entry>
1352                                                 </row>
1353                                                 <row>
1354                                                         <entry>client_dir</entry>
1355                                                         <entry>Build a client directory from the build directory, without doing a rebuild. The same as "copy everything but server/".</entry>
1356                                                 </row>
1357                                                 <row>
1358                                                         <entry>client_app</entry>
1359                                                         <entry>Prereq "client_dir"; removes "install.rdf" from client directory so an app bundle can't be installed as an extension</entry>
1360                                                 </row>
1361                                                 <row>
1362                                                         <entry>client_ext</entry>
1363                                                         <entry>Prereq "client_dir"; remove "application.ini", "autoupdate.js", "standalone_xul_app.js" from client directory so an extension won't break Firefox</entry>
1364                                                 </row>
1365                                                 <row>
1366                                                         <entry>extension</entry>
1367                                                         <entry>Prereq "client_ext"; rewritten to use "client_ext"</entry>
1368                                                 </row>
1369                                                 <row>
1370                                                         <entry>generic-client</entry>
1371                                                         <entry>Prereq "client_app"; make an XPI file suitable for use with "xulrunner --install-app""</entry>
1372                                                 </row>
1373                                                 <row>
1374                                                         <entry>win-xulrunner</entry>
1375                                                         <entry>Prereq "client_app"; add Windows xulrunner to client build</entry>
1376                                                 </row>
1377                                                 <row>
1378                                                         <entry>linux-xulrunner</entry>
1379                                                         <entry>Prereq "client_app"; add Linux xulrunner to client build</entry>
1380                                                 </row>
1381                                                 <row>
1382                                                         <entry>win-client</entry>
1383                                                         <entry>Prereq "win-xulrunner"; build "setup exe" (requires that "nsis" package be installed, will add options for automatic update if configured and developer options if client build was a "make devbuild")</entry>
1384                                                 </row>
1385                                                 <row>
1386                                                         <entry>linux-client</entry>
1387                                                         <entry>Prereq "linux_xulrunner"; build a "tar.bz2" bundle of the Linux client</entry>
1388                                                 </row>
1389                                                 <row>
1390                                                         <entry>[generic | win | linux | extension]-updates[-client]</entry>
1391                                                         <entry>Call external/make_updates.sh to build full and partial updates generic/win/linux/extension prefix limit to that distribution; Adding "-client" builds clients and copies them to a subdirectory of the "updates" directory as well; "extension-updates-client" doesn't exist.</entry>
1392                                                 </row>
1393                                         </tbody>
1394                                 </tgroup>
1395                         </table>
1396                         <itemizedlist>
1397                                 <listitem>
1398                                         <para>Developer Build</para>
1399                                         <para>You can create a so-called "developer build" of the Staff Client by substituting "devbuild" for "build" when running <emphasis>make</emphasis>. The build will contain an extra configuration file that enables some special developer options.</para>
1400                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, run <emphasis>make</emphasis> from the Staff Client source directory:</para>
1401                                         <figure>
1402                                                 <title>Commands to do a "developer build"</title>
1403                                                 <screen>
1404                                                         $ su - opensrf
1405                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1406                                                         $ make devbuild
1407                                                         ...
1408                                                         </screen>
1409                                         </figure>
1410                                 </listitem>
1411                                 <listitem>
1412                                         <para>Compressed Javascript</para>
1413                                         <para>You can automatically run the Google "Closure Compiler" utility to review and compress Javascript code after the build process completes by substituting "compress-javascript" for "build" when running <emphasis>make</emphasis>.</para>
1414                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, run the following commands from the Staff Client source directory:</para>
1415                                         <figure>
1416                                                 <title>Commands to compress Javascript</title>
1417                                                 <screen>
1418                                                         $ su - opensrf
1419                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1420                                                         $ make compress-javascript
1421                                                         ...
1422                                                         </screen>
1423                                         </figure>
1424                                         <para>You can also combine Javascript review and compression, and also perform a "developer build".</para>
1425                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, run the following commands from the Staff Client source directory:</para>
1426                                         <figure>
1427                                                 <title>Commands to compress Javascript and do a "developer build"</title>
1428                                                 <screen>
1429                                                         $ su - opensrf
1430                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1431
1432                                                         # order of options is important!
1433                                                         $ make devbuild compress-javascript
1434                                                         ...
1435                                                         </screen>
1436                                         </figure>
1437                                 </listitem>
1438                                 <listitem>
1439                                         <para>Automatic Update Host</para>
1440                                         <para>The host used to check for automatic Staff Client updates can be overridden by specifying the AUTOUPDATE_HOST option. The following commands could have been used during the normal build process:</para>
1441                                         <figure>
1442                                                 <title>Commands to set AUTOUPDATE_HOST for normal Evergreen build</title>
1443                                                 <screen>
1444                                                         $ su - root
1445                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
1446                                                         $ make AUTOUPDATE_HOST=localhost install
1447                                                         ...
1448                                                         </screen>
1449                                         </figure>
1450                                         <para>You can manually set AUTOUPDATE_HOST. The following commands will manually build the Staff Client using a different AUTOUPDATE_HOST.</para>
1451                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>
1452                                         <figure>
1453                                                 <title>Commands to manually specify AUTOUPDATE_HOST</title>
1454                                                 <screen>
1455                                                         $ su - opensrf
1456                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1457                                                         $ make AUTOUPDATE_HOST=localhost build
1458                                                         ...
1459                                                         </screen>
1460                                         </figure>
1461                                         <para>For more information see the section <link linkend="serversideinstallation-staffclient-autoupdate">"Automatic Updates"</link>.</para>
1462                                 </listitem>
1463                         </itemizedlist>
1464                 </section>
1465                 <section>
1466                         <title>Installing and Activating the Staff Client</title>
1467                         <para>The Staff Client is automatically built, installed and activated as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side software. However, if you manually build the Staff Client from its source directory, then you need to take additional steps to install and active it.</para>
1468                         <para>Assuming you have already built the Staff Client, and that your installation is in the directory <emphasis>/openils/var/web/xul</emphasis>, as the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1469                         <figure>
1470                                 <title>Commands to install and active the Staff Client</title>
1471                                 <screen>
1472                                         $ su - opensrf
1473                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1474                                         $ mkdir -p "/openils/var/web/xul/$(cat build/STAMP_ID)"
1475                                         $ cp -R build/server "/openils/var/web/xul/$(cat build/STAMP_ID)"
1476                                         </screen>
1477                         </figure>
1478                 </section>
1479                 <section>
1480                         <title>Packaging the Staff Client</title>
1481                         <para>Once the Staff Client has been built, you can create several forms of client packages by using some targetted <emphasis>make</emphasis> commands in the Staff Client source directory.</para>
1482                         <itemizedlist>
1483                                 <listitem>
1484                                         <para>Packaging a Generic Client</para>
1485                                         <para>This build creates a Staff Client packaged as an XPI file suitable for use with <emphasis>XULRunner</emphasis>.</para>
1486                                         <para>This special build requires that you already have the "zip" utility installed on your system. It will create the output file "evergreen_staff_client.xpi", suitable for use with the <emphasis>XULRunner</emphasis> parameter <emphasis>--install-app</emphasis>.</para>
1487                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1488                                         <figure>
1489                                                 <title>Commands to package a "generic" client</title>
1490                                                 <screen>
1491                                                         $ su - opensrf
1492                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1493                                                         $ make generic-client
1494                                                         ...
1495                                                         </screen>
1496                                         </figure>
1497                                 </listitem>
1498                                 <listitem>
1499                                         <para>Packaging a Windows Client</para>
1500                                         <para>This build creates a Staff Client packaged as a Windows executable</para>
1501                                         <para>This special build requires that you already have the "zip" utility installed on your system. It also requires that you install <ulink url="http://nsis.sourceforge.net/">NSIS (Nullsoft Scriptable Install System)</ulink>, a professional open source utility package used to create Windows installers (the "makensis" utility is installed as part of the "nsis" package). We recommend using Version 2.45 or later. The output file "evergreen_staff_client_setup.exe" will be created.</para>
1502                                         <para>(OPTIONAL) If you wish for the Staff Client to have a link icon/tray icon by default, you may wish to provide a pre-modified <emphasis>xulrunner-stub.exe</emphasis>. Place it in the Staff Client source directory and <emphasis>make</emphasis> will automatically use it instead of the one that comes with the downloaded <emphasis>XULRunner</emphasis> release. The version of <emphasis>xulrunner-stub.exe</emphasis> need not match exactly.</para>
1503                                         <para>You can also use a tool such as <ulink url="http://www.angusj.com/resourcehacker/">Resource Hacker</ulink> to embed icons. "Resource Hacker" is an open-source utility used to view, modify, rename, add, delete and extract resources in 32bit Windows executables</para>
1504                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1505                                         <figure>
1506                                                 <title>Useful icon ID strings</title>
1507                                                 <screen>
1508                                                         IDI_APPICON - Tray icon
1509                                                         32512 - Default window icon
1510                                                         </screen>
1511                                         </figure>
1512                                         <para/>
1513                                         <figure>
1514                                                 <title>Commands to build a Windows client</title>
1515                                                 <screen>
1516                                                         $ su - opensrf
1517                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1518                                                         $ make win-client
1519                                                         ...
1520                                                         </screen>
1521                                         </figure>
1522                                 </listitem>
1523                                 <listitem>
1524                                         <para>Packaging a Linux Client</para>
1525                                         <para>This build creates a Staff Client package for Linux as a "tar.bz2" file with <emphasis>XULRunner</emphasis> already bundled with it. The output file "evergreen_staff_client.tar.bz2" will be created.</para>
1526                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1527                                         <figure>
1528                                                 <title>Commands to build a Linux client</title>
1529                                                 <screen>
1530                                                         $ su - opensrf
1531                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1532                                                         $ make linux-client
1533                                                         ...
1534                                                         </screen>
1535                                         </figure>
1536                                 </listitem>
1537                                 <listitem>
1538                                         <para>Packaging a Firefox Extension</para>
1539                                         <para>This special build requires that you already have the "zip" utility installed on your system. This build creates a Staff Client packaged as a Firefox extension. The output file "evergreen.xpi" will be created.</para>
1540                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1541                                         <figure>
1542                                                 <title>Commands to build a Firefox extension</title>
1543                                                 <screen>
1544                                                         $ su - opensrf
1545                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1546                                                         $ make extension
1547                                                         ...
1548                                                         </screen>
1549                                         </figure>
1550                                 </listitem>
1551                         </itemizedlist>
1552                 </section>
1553                 <section xml:id="serversideinstallation-staffclient-autoupdate">
1554                         <title>Automatic Updates</title>
1555                         <para>It is possible to set up support for automatic Staff Client updates, either during the normal Evergreen server-side build process, or by later building the Staff Client with certain special options.</para>
1556                         <para>Automatic update server certificate requirements are more strict than normal server requirements. Firefox and <emphasis>XULRunner</emphasis> will both ignore any automatic update server that is not validated by a trusted certificate authority. Servers with exceptions added to force the Staff Client to accept them WILL NOT WORK.</para>
1557                         <para>In addition, automatic updates have special requirements for the file <emphasis>update.rdf</emphasis>:</para>
1558                         <orderedlist>
1559                                 <listitem>It must be served from an SSL server, or</listitem>
1560                                 <listitem>It must be signed with the utility <ulink url="https://developer.mozilla.org/en/McCoy">McCoy</ulink>.</listitem>
1561                         </orderedlist>
1562                         <para>You can pre-install the signing key into the file <emphasis>install.rdf</emphasis> directly, or install it into a copy as <emphasis>install.mccoy.rdf</emphasis>. If the latter exists it will be copied into the build instead of the original file <emphasis>install.rdf</emphasis>.</para>
1563                         <para>The name of the automatic update host can be provided in either of two ways:</para>
1564                         <orderedlist>
1565                                 <listitem>At configuration time for the Evergreen server-side software, or</listitem>
1566                                 <listitem>During the Staff Client build process</listitem>
1567                         </orderedlist>
1568                         <section>
1569                                 <title>Specifying the Automatic Update Host</title>
1570                                 <section>
1571                                         <title>At configuration time for the Evergreen server-side software</title>
1572                                         <para>This must be done when the Evergreen server-side software is first configured (see the section <link linkend="serversideinstallation-configure"> "Configure Evergreen" </link>). As the <emphasis role="bold">opensrf</emphasis> user, use the utility "configure" as shown:</para>
1573                                         <figure>
1574                                                 <title>Commands to configure Evergreen</title>
1575                                                 <screen>
1576                                                         $ su - opensrf
1577                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
1578                                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf --with-updateshost=hostname
1579                                                         $ make
1580                                                         ...
1581                                                         </screen>
1582                                         </figure>
1583                                 </section>
1584                                 <section>
1585                                         <title>During the Staff Client build process</title>
1586                                         <para>You will used the variable AUTOUPDATE_HOST=hostname (see above). If you specify just a hostname (such as "example.com") then the URL will be a secure HTTPS URL (such as "https://example.com"). If you wish to use a non-HTTPS URL then prefix the hostname with "http://". (such as "http://example.com").</para>
1587                                         <para>If neither option is used then, by default, the Staff Client will not include the automatic update preferences.</para>
1588                                 </section>
1589                         </section>
1590                         <section>
1591                                 <title>Building Updates</title>
1592                                 <para>Similar to building clients, the targets "generic-updates", "win-updates", "linux-updates", and "extension-updates" can be used individually with <emphasis>make</emphasis> to build the update files for the Staff Client. To build all the targets at once, simply use the target "updates".</para>
1593                                 <para>A "full" update will be built for each specified target (or for all if the target "updates" is used). For all but extensions any previous "full" updates (archived by default in the directory <emphasis>/openils/var/updates/archives</emphasis>) will be used to make "partial" updates. Partial updates tend to be much smaller and will thus download more quickly, but if something goes wrong with a partial update the full update will be used as a fallback. Extensions do not currently support partial updates.</para>
1594                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1595                                 <figure>
1596                                         <title>Commands for building updates</title>
1597                                         <screen>
1598                                                 $ su - opensrf
1599                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1600
1601                                                 # command to build all updates at once:
1602                                                 $ make updates
1603                                                 ...
1604
1605                                                 # commands to build updates individually:
1606                                                 $ make generic-updates
1607                                                 ...
1608                                                 $ make win-updates
1609                                                 ...
1610                                                 $ make linux-updates
1611                                                 ...
1612                                                 $ make extension-updates
1613                                                 ...
1614                                                 </screen>
1615                                 </figure>
1616                         </section>
1617                         <section>
1618                                 <title>Building updates with "-client"</title>
1619                                 <para>To save time and effort you can build updates and manual download clients at the same time by adding the string "-client" to each target name (for instance, you can specify "win-updates-client"). You can also specify "updates-client" to build all the targets at once. This does not work for extension-updates.</para>
1620                                 <para>The clients will be installed alongside the updates and listed on the "manualupdate.html" page, rather than left in the Staff Client directory.</para>
1621                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1622                                 <figure>
1623                                         <title>Commands for building updates</title>
1624                                         <screen>
1625                                                 $ su - opensrf
1626                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1627
1628                                                 # command to build all updates at once:
1629                                                 $ make updates-client
1630                                                 ...
1631
1632                                                 # commands to build updates individually:
1633                                                 $ make generic-updates-client
1634                                                 ...
1635                                                 $ make win-updates-client
1636                                                 ...
1637                                                 $ make linux-updates-client
1638                                                 ...
1639                                                 </screen>
1640                                 </figure>
1641                         </section>
1642                         <section>
1643                                 <title>Activating the Update Server</title>
1644                                 <para>This section reviews scripts associated with the update server, and requires some final adjustments to file permissions.</para>
1645                                 <para>The Apache example configuration creates an "updates" directory that, by default, points to the directory <emphasis>/openils/var/updates/pub</emphasis>. This directory contains one HTML file and several specially-named script files</para>
1646                                 <para>The "updatedetails.html" file is the fallback web page for the update details. The "check" script is used for <emphasis>XULRunner</emphasis> updates. The "update.rdf" script is used for extension updates. The "manualupdate.html" script checks for clients to provide download links when automatic updates have failed and uses the download script to force a download of the generic client xpi (compared to Firefox trying to install it as an extension).</para>
1647                                 <para>As the <emphasis role="bold">root</emphasis> user, change directory to the updates directory, then execute the following commands:</para>
1648                                 <para>The following scripts should be marked as executable: <emphasis>check, download, manualupdate.html, update.rdf</emphasis>.</para>
1649                                 <figure>
1650                                         <title>Changing permissions of scripts</title>
1651                                         <screen>
1652                                                 $ su - root
1653                                                 $ cd /openils/var/updates/pub
1654                                                 $ chmod +x  check  download  manualupdate.html  update.rdf
1655                                                 </screen>
1656                                 </figure>
1657                         </section>
1658                 </section>
1659                 <section>
1660                         <title>Other tips</title>
1661                         <itemizedlist>
1662                                 <listitem>
1663                                         <para>Multiple workstations on one install</para>
1664                                         <para>Multiple workstation registrations for the same server can be accomplished with a single Staff Client install by using multiple profiles. When running <emphasis>XULRunner</emphasis> you can specify the option "-profilemanager" or "-P" (uppercase "P") to force the Profile Manager to start. Unchecking the "Don't ask at startup" option will make this the default.</para>
1665                                         <para>Once you have opened the Profile Manager you can create additional profiles, one for each workstation you wish to register. You may need to install SSL exceptions for each profile.</para>
1666                                         <para>When building targets "win-client", "win-updates-client", or "updates-client", you can specify "NSIS_EXTRAOPTS=-DPROFILES" to add an "Evergreen Staff Client Profile Manager" option to the start menu.</para>
1667                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, change directory to the Staff Client source directory, then execute the following commands:</para>
1668                                         <figure>
1669                                                 <title>Command to add start menu option</title>
1670                                                 <screen>
1671                                                         $ su - opensrf
1672                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client
1673                                                         $ make NSIS_EXTRAOPTS=-DPROFILES win-client
1674                                                         ...
1675                                                         </screen>
1676                                         </figure>
1677                                 </listitem>
1678                                 <listitem>
1679                                         <para> Multiple Staff Clients</para>
1680                                         <para>This may be confusing if you are not careful, but you can log in to multiple Evergreen servers at the same time, or a single Evergreen server multiple times. In either case you will need to create an additional profile for each additional server or workstation you want to log in as (see previous tip).</para>
1681                                         <para>Once you have done so, run <emphasis>XULRunner</emphasis> with the option "-no-remote" (in addition to "-profilemanger" or "-P" if neeeded). Instead of <emphasis>XULRunner</emphasis> opening a new login window on your existing session it will start a new session instead, which can then be logged in to a different server or workstation ID.</para>
1682                                 </listitem>
1683                         </itemizedlist>
1684                 </section>
1685                 <section xml:id="serversideinstallation-running-staffclient">
1686                         <title>Running the Evergreen Staff Client</title>
1687                         <caution fileref="media/caution.png">ADD CONTENT: LINUX VS WINDOWS STAFF CLIENT</caution>
1688                         <para>Run the Evergreen Staff Client on a Linux system by using the application <emphasis>XULRunner</emphasis> (installed automatically and by default with Firefox version 3.0 and later on Ubuntu and Debian distributions).</para>
1689                         <para>For example, if the source files for the Evergreen installation are in the directory <emphasis>/home/opensrf/Evergreen-ILS-1.6.0.7/</emphasis>, start the Staff Client as shown in the following command example:</para>
1690                         <figure>
1691                                 <title>Commands to run the Staff Client</title>
1692                                 <screen>
1693                                         $ su - opensrf
1694                                         $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
1695                                         </screen>
1696                         </figure>
1697                 </section>
1698         </section>
1699         <section xml:id="serversideinstallation-memcached">
1700                 <title>memcached Servers</title>
1701                 <caution fileref="media/caution.png"> ADD CONTENT FOR MEMCACHED </caution>
1702         </section>
1703         <section xml:id="serversideinstallation-organizationandpolicy">
1704                 <title>Organization and Policy Editing</title>
1705                 <para>After installing Evergreen, you will want to make configuration changes to reflect the organizational hierarchy and the policies of your library or libraries. See the section <link linkend="serveradministration-orgunits">"Organizational Unit Types and Organizational Units"</link> for further information. Examples of what can be configured include:</para>
1706                 <itemizedlist>
1707                         <listitem>Adding a branch library</listitem>
1708                         <listitem>Changing circulation rules for an existing library</listitem>
1709                         <listitem>Adding a new staff position or user group</listitem>
1710                 </itemizedlist>
1711                 <caution fileref="media/caution.png"> ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </caution>
1712         </section>
1713         <section xml:id="serversideinstallation-sip">
1714                 <title>Installing the SIP Server</title>
1715                 <caution fileref="media/caution.png"> ADD CONTENT FOR INSTALLING THE SIP SERVER </caution>
1716         </section>
1717         <section xml:id="serversideinstallation-nginx">
1718                 <title>Using nginx to serve static content</title>
1719                 <caution fileref="media/caution.png"> ADD CONTENT FOR USING NGINX TO SERVE STATIC CONTENT </caution>
1720         </section>
1721         <section xml:id="serversideinstallation-localization">
1722                 <title>(OPTIONAL) Configuration for Other Languages</title>
1723                 <para>This section describes how translations such as Armenian (hy-AM), Canadian French (fr-CA) and others are loaded into the database to complete the translations (default English) available in the OPAC and Staff Client.</para>
1724                 <caution fileref="media/caution.png"> ADD SECTION ON LANGUAGE LOCALIZATION </caution>
1725         </section>
1726 </chapter>