]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
a18dc629f3156e4e8b7567c71fa2dd466584efc4
[working/Evergreen.git] / 1.6 / admin / ServersideInstallation.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
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">\r
3         <info>\r
4                 <title>Server-side Installation of Evergreen Software</title>\r
5                 <abstract>\r
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>\r
7                 </abstract>\r
8         </info>\r
9         <section xml:id="serversideinstallation-overview">\r
10                 <title>Overview</title>\r
11                 <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current stable software release. See <xref linkend="serversideinstallation-all"/> for instructions tailored to installing on some particular distributions of the <systemitem class="osname">Linux</systemitem> operating system. Earlier software distributions are described in <xref linkend="serversideinstallation-previousversions"/>.</para>\r
12                 <para>The current version of the Evergreen server-side software runs as a native application on any of several well-known <systemitem class="osname">Linux</systemitem> distributions (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). It does not currently run as a native application on the <systemitem class="osname">Microsoft Windows</systemitem> operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can still be installed and run on <systemitem class="osname">Windows</systemitem> via a so-called <emphasis>virtualized</emphasis> Linux-guest Operating System (using, for example, <application>"VirtualBox"</application>, or <application>"VMware"</application>, or <application>"VirtualPC"</application> to emulate a <systemitem class="osname">Linux</systemitem> environment). It can also be installed to run on other <systemitem class="osname">Linux</systemitem> systems via virtualized environments (using, for example, <application>"VirtualBox"</application> or <application>"VMware"</application>). More information on virtualized environments can be found in <xref linkend="serversideinstallation-virtual"/>.</para>\r
13                 <para>Installation of some sub-components of the Evergreen server-side software is mentioned only in abbreviated form in this section. More detailed information is available in <xref linkend="serversideinstallation-postgresql"/> and <xref linkend="serversideinstallation-apache"/>.</para>\r
14                 <para>Finally, installation of the Evergreen Staff Client software is reviewed in <xref linkend="serversideinstallation-staffclient"/>. </para>\r
15                 <section>\r
16                         <title>Evergreen Software Dependencies</title>\r
17                         <para>The Evergreen server-side software has dependencies on particular versions of certain major software sub-components. Successful installation of Evergreen software requires that software versions agree with those listed here:</para>\r
18                         <table xml:id="serversideinstall-software-dependencies">\r
19                                 <title>Evergreen Software Dependencies</title>\r
20                                 <tgroup align="left" cols="3" colsep="1" rowsep="1">\r
21                                 <colspec colnum="1" colname="Evergreen" colwidth="1.0*"/>\r
22                                 <colspec colnum="2" colname="OpenSRF" colwidth="1.0*"/>\r
23                                 <colspec colnum="3" colname="PostgreSQL" colwidth="1.0*"/>\r
24                                 \r
25                                         <thead>\r
26                                                 <row>\r
27                                                         <entry>Evergreen</entry>\r
28                                                         <entry>OpenSRF</entry>\r
29                                                         <entry>PostgreSQL</entry>\r
30                                                 </row>\r
31                                         </thead>\r
32                                         <tbody>\r
33                                                 <row>\r
34                                                         <entry>1.6.x</entry>\r
35                                                         <entry>1.2</entry>\r
36                                                         <entry>8.2 / 8.3</entry>\r
37                                                 </row>\r
38                                                 <row>\r
39                                                         <entry>1.4.x</entry>\r
40                                                         <entry>1.0</entry>\r
41                                                         <entry>8.1 / 8.2</entry>\r
42                                                 </row>\r
43                                                 <row>\r
44                                                         <entry>1.2.x</entry>\r
45                                                         <entry>0.9</entry>\r
46                                                         <entry>8.1 / 8.2</entry>\r
47                                                 </row>\r
48                                         </tbody>\r
49                                 </tgroup>\r
50                         </table>\r
51                 </section>\r
52                 <section>\r
53                         <title>Current Stable Software Release</title>\r
54                         <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 <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> <systemitem class="osname">Linux</systemitem> systems are found in <xref linkend="serversideinstallation-ubuntudebian"/>.</para>\r
55                         <para>This release of Evergreen software is dependent on the Open Service Request Framework (OpenSRF). The current stable release of OpenSRF is version <emphasis><emphasis role="bold">1.2.2</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in <xref linkend="serversideinstallation-opensrf"/>.</para>\r
56                 </section>\r
57                 <section>\r
58                         <title>Previous Software Releases</title>\r
59                         <para>Earlier releases of Evergreen are also available. Instructions for installing, configuring and testing earlier versions are found in <xref linkend="serversideinstallation-previousversions"/>.</para>\r
60                         <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 <xref linkend="serversideinstallation-evergreen-previous"/>.</para>\r
61                         <para>The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.7</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in <xref linkend="serversideinstallation-opensrf-previous"/>.</para>\r
62                 </section>\r
63         </section>\r
64         <section xml:id="serversideinstallation-all">\r
65                 <title>Installing Server-Side Software</title>\r
66                 <para>This section describes the installation of the major components of Evergreen server-side software.</para>\r
67                 <para>As far as possible, you should perform the following steps in the exact order given since the success of many steps relies on the successful completion of earlier steps. You should make backup copies of files and environments when you are instructed to do so. In the event of installation problems those copies can allow you to back out of a step gracefully and resume the installation from a known state. See <xref linkend="backingup"/> for further information.</para>\r
68                 <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>\r
69                 <section xml:id="serversideinstallation-opensrf">\r
70                         <title>Installing OpenSRF 1.2.2 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>\r
71                         <para>This section describes the installation of the latest version of the Open Service Request Framework (OpenSRF), a major component of the Evergreen server-side software, on <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> systems. Evergreen software is integrated with and depends on the OpenSRF software system.</para>\r
72                         <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>\r
73                         <note>\r
74                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) platforms. OpenSRF 1.2.2 has been tested on <systemitem class="osname">Debian Etch (4.0)</systemitem>, <systemitem class="osname">Debian Lenny</systemitem>, <systemitem class="osname">Ubuntu Hardy Heron (8.04)</systemitem>, and <systemitem class="osname">Ubuntu Intrepid Ibex (8.10)</systemitem>.</para>\r
75                                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>\r
76                                 <itemizedlist>\r
77                                         <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
78                                         <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
79                                 </itemizedlist>\r
80                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue the command <command>exit"</command>.</para>\r
81                         </note>\r
82                         <section>\r
83                                 <title>Add the OpenSRF User</title>\r
84                                 <para>As the <systemitem class="username">root</systemitem> user, add the opensrf user to the system. The default shell for the new user is automatically set to <command>/bin/bash</command> to inherit a reasonable environment:</para>\r
85                                 <figure>\r
86                                         <title>Commands to add <systemitem class="username">opensrf</systemitem> user</title>\r
87                                         <screen>\r
88                                         $ su - opensrf\r
89                                         $ useradd -m -s /bin/bash opensrf\r
90                                         $ passwd opensrf\r
91                                         Enter new UNIX password: ******\r
92                                         Retype new UNIX password: ******\r
93                                         passwd: password updated successfully\r
94                                         $\r
95                                         </screen>\r
96                                 </figure>\r
97                         </section>\r
98                         <section>\r
99                                 <title>Download and Unpack Latest OpenSRF Version</title>\r
100                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of OpenSRF. The latest version can be found here: <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz"></ulink></para>\r
101                                 <figure>\r
102                                         <title>Commands to download and unpack OpenSRF</title>\r
103                                         <screen>\r
104                                         $ su - opensrf\r
105                                         $ wget http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz\r
106                                         $ tar zxf OpenSRF-1.2.2.tar.gz\r
107                                         </screen>\r
108                                 </figure>\r
109                                 <para>The new directory <filename class="directory">/home/opensrf/OpenSRF-1.2.2</filename> will be created.</para>\r
110                         </section>\r
111                         <section>\r
112                                 <title>Install Prerequisites to Build OpenSRF</title>\r
113                                 <para>In this section you will install and configure a set of prerequisites that will be used to build OpenSRF. In a following step you will actually build the software using the <command>make</command> utility.</para>\r
114                                 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-1">"Keywords"</link> figure below.</para>\r
115                                 <figure>\r
116                                         <title>Commands to install prerequisites for OpenSRF</title>\r
117                                         <screen>\r
118                                         $ su - root\r
119                                         $ cd /home/opensrf/OpenSRF-1.2.2\r
120                                         $ make -f src/extras/Makefile.install [DISTRIBUTION]\r
121                                         ...\r
122                                         </screen>\r
123                                 </figure>\r
124                                 <table xml:id="serversideinstallation-keywords-figure-1">\r
125                                         <title>Keywords Targets for <application>"make"</application> Command</title>\r
126                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
127                                                 <colspec colnum="1" colwidth="1.0*"/>\r
128                                                 <colspec colnum="2" colwidth="3.0*"/>\r
129                                                 <thead>\r
130                                                         <row>\r
131                                                                 <entry>Keyword</entry>\r
132                                                                 <entry>Description</entry>\r
133                                                         </row>\r
134                                                 </thead>\r
135                                                 <tbody>\r
136                                                         <row>\r
137                                                                 <entry>debian-lenny</entry>\r
138                                                                 <entry>for Debian Lenny (5.0)</entry>\r
139                                                         </row>\r
140                                                         <row>\r
141                                                                 <entry>debian-etch</entry>\r
142                                                                 <entry>for Debian Etch (4.0)</entry>\r
143                                                         </row>\r
144                                                         <row>\r
145                                                                 <entry>ubuntu-karmic</entry>\r
146                                                                 <entry>for Ubuntu Karmic (9.10)</entry>\r
147                                                         </row>\r
148                                                         <row>\r
149                                                                 <entry>ubuntu-intrepid</entry>\r
150                                                                 <entry>for Ubuntu Jaunty (9.04) or Intrepid (8.10)</entry>\r
151                                                         </row>\r
152                                                         <row>\r
153                                                                 <entry>ubuntu-hardy</entry>\r
154                                                                 <entry>for Ubuntu Hardy (8.04)</entry>\r
155                                                         </row>\r
156                                                 </tbody>\r
157                                         </tgroup>\r
158                                 </table>\r
159                                 <indexterm>\r
160                                         <primary>ZZZ-REVIEW</primary>\r
161                                         <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>\r
162                                 </indexterm>\r
163                                 <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>\r
164                                 <para>This will install a number of packages on the system that are required by OpenSRF, including some Perl modules from CPAN. You can say <literal>No</literal> to the initial CPAN configuration prompt to allow it to automatically configure itself to download and install Perl modules from CPAN. The CPAN installer will ask you a number of times whether it should install prerequisite modules - say <literal>Yes</literal>.</para>\r
165                         </section>\r
166                         <section>\r
167                                 <title>Configure OpenSRF</title>\r
168                                 <para>As the <systemitem class="username">opensrf</systemitem> user, return to the OpenSRF build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software. You can include the  <option>--enable-python</option> and <option>--enable-java</option> configuration options if you wish to include support for Python and Java, respectively:</para>\r
169                                 <figure>\r
170                                         <title>Commands to configure OpenSRF</title>\r
171                                         <screen>\r
172                                         $ su - opensrf\r
173                                         $ cd /home/opensrf/OpenSRF-1.2.2\r
174                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf\r
175                                         $ make\r
176                                         ...\r
177                                         </screen>\r
178                                 </figure>\r
179                         </section>\r
180                         <section>\r
181                                 <title>Compile, Link and Install OpenSRF</title>\r
182                                 <para>As the <systemitem class="username">root</systemitem> user, return to the OpenSRF build directory and use the <command>make</command> utility to compile, link and install OpenSRF:</para>\r
183                                 <figure>\r
184                                         <title>Commands to build, link and install OpenSRF</title>\r
185                                         <screen>\r
186                                         $ su - opensrf\r
187                                         $ cd /home/opensrf/OpenSRF-1.2.2\r
188                                         $ make install\r
189                                         ...\r
190                                         </screen>\r
191                                 </figure>\r
192                         </section>\r
193                         <section>\r
194                                 <title>Update the System Dynamic Library Path</title>\r
195                                 <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a new library path, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>\r
196                                 <figure>\r
197                                         <title>Commands to modify system dynamic library path</title>\r
198                                         <screen>\r
199                                         $ su - root\r
200                                         $ echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf\r
201                                         $ ldconfig\r
202                                         </screen>\r
203                                 </figure>\r
204                         </section>\r
205                         <section>\r
206                                 <title>Define Public and Private OpenSRF Domains</title>\r
207                                 <para>Define your public and private OpenSRF domains. For security purposes, OpenSRF uses Jabber domains to separate services into public and private realms. Throughout these instructions, we will use the example domains <systemitem class="domainname">public.localhost</systemitem> for the public domain and <systemitem class="domainname">private.localhost</systemitem> for the private domain. On a single-server system, the easiest way to define public and private domains is to define separate host names by adding entries to the file <filename>/etc/hosts</filename>.</para>\r
208                                 <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/hosts</filename> and add the following entries for our example domains:</para>\r
209                                 <figure>\r
210                                         <title>Example public and private domains in /etc/hosts</title>\r
211                                         <screen>\r
212                                         127.0.1.2       public.localhost        public\r
213                                         127.0.1.3       private.localhost       private\r
214                                         </screen>\r
215                                 </figure>\r
216                         </section>\r
217                         <section>\r
218                                 <title>Change File Ownerships</title>\r
219                                 <para>As the <systemitem class="username">root</systemitem> user, change the ownership of files installed in the directory <filename class="directory">/openils</filename> to the <systemitem class="username">opensrf</systemitem> user:</para>\r
220                                 <figure>\r
221                                         <title>Commands to change file ownerships</title>\r
222                                         <screen>\r
223                                         $ chown -R opensrf:opensrf /openils\r
224                                         </screen>\r
225                                 </figure>\r
226                         </section>\r
227                         <section>\r
228                                 <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>\r
229                                 <para>As the <systemitem class="username">root</systemitem> user, stop the <systemitem class="service">ejabberd</systemitem> service:</para>\r
230                                 <figure>\r
231                                         <title>Commands to stop the <systemitem class="service">ejabberd</systemitem> service</title>\r
232                                         <screen>\r
233                                         $ /etc/init.d/ejabberd stop\r
234                                         </screen>\r
235                                 </figure>\r
236                                 <para>If <systemitem class="service">ejabberd</systemitem> eeports that it is already stopped, it may have run into a problem starting back at the installation stage. One possible fix is to kill any remaining <systemitem class="daemon">beam</systemitem> and <systemitem class="daemon">epmd</systemitem> processes, then edit the configuration file <filename>/etc/ejabberd/ejabberd.cfg</filename> to hardcode a domain:</para>\r
237                                 <figure>\r
238                                         <title>Commands to recover from <systemitem class="service">ejabberd</systemitem> errors</title>\r
239                                         <screen>\r
240                                         $ su - root\r
241                                         $ epmd -kill\r
242                                         $ killall beam; killall beam.smp\r
243                                         $ rm /var/lib/ejabberd/*\r
244                                         $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd\r
245                                         </screen>\r
246                                 </figure>\r
247                         </section>\r
248                         <section>\r
249                                 <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>\r
250                                 <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>\r
251                                 <itemizedlist>\r
252                                         <listitem>Change <literal>{hosts, ["localhost"]}.</literal> to <literal>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</literal></listitem>\r
253                                         <listitem>Change <literal>{max_user_sessions, 10}.</literal> to <literal>{max_user_sessions, 10000}.</literal> If you see something like this instead: <literal>{access, max_user_sessions, [{10, all}]}.</literal>, then change it to <literal>{access, max_user_sessions, [{10000, all}]}.</literal></listitem>\r
254                                         <listitem>Change all three occurrences of <literal>max_stanza_size</literal> to <literal>2000000</literal>.</listitem>\r
255                                         <listitem>Change both occurrences of <literal>maxrate</literal> to <literal>500000</literal>.</listitem>\r
256                                         <listitem>Comment out the line <literal>{mod_offline, []}</literal> by placing two <literal>%</literal> comment signs in front.</listitem>\r
257                                 </itemizedlist>\r
258                         </section>\r
259                         <section xml:id="serversideinstallation-opensrf-continued">\r
260                                 <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>\r
261                                 <para>As the <systemitem class="username">root</systemitem> user, restart the <systemitem class="service">ejabberd</systemitem> service to test the configuration changes and to register your users:</para>\r
262                                 <figure>\r
263                                         <title>Commands to restart the <systemitem class="service">ejabberd</systemitem> service</title>\r
264                                         <screen>\r
265                                         $ /etc/init.d/ejabberd start\r
266                                         </screen>\r
267                                 </figure>\r
268                         </section>\r
269                         <section>\r
270                                 <title>Register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>\r
271                                 <para>On each domain, you need two <systemitem class="service">ejabberd</systemitem> users to manage the OpenSRF communications:</para>\r
272                                 <itemizedlist>\r
273                                         <listitem>a <systemitem class="username">router</systemitem> user, to whom all requests to connect to an OpenSRF service will be routed; this <systemitem class="service">ejabberd</systemitem> user must be named <systemitem class="username">router</systemitem></listitem>\r
274                                         <listitem>an <systemitem class="username">opensrf</systemitem> user, which clients use to connect to OpenSRF services; this user can be named anything you like, but we will use <literal>opensrf</literal> in our examples</listitem>\r
275                                 </itemizedlist>\r
276                                 <para>As the <systemitem class="username">root</systemitem> user, use the <command>ejabberdctl</command> utility to register your ejabber users <emphasis>router</emphasis> and <emphasis>opensrf</emphasis> for the OpenSRF router service on each domain. The users should have different passwords on each domain. These users will correspond to those configured in the file <filename>/openils/conf/opensrf_core.xml</filename>:</para>\r
277                                 <figure>\r
278                                         <title>Commands to register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>\r
279                                         <programlisting language="xml"><![CDATA[\r
280                                         # Syntax for registering a user with ejabberdctl:\r
281                                         #    ejabberdctl register <user> <domain> <password>\r
282                                         #\r
283                                         $ ejabberdctl register router private.localhost  <password>\r
284                                         $ ejabberdctl register opensrf private.localhost <password>\r
285                                         $ ejabberdctl register router public.localhost   <password>\r
286                                         $ ejabberdctl register opensrf public.localhost  <password>\r
287                                         ]]></programlisting>\r
288                                 </figure>\r
289                         </section>\r
290                         <section>\r
291                                 <title>Create configuration files</title>\r
292                                 <para>As the <systemitem class="username">opensrf</systemitem> user, use the example templates to create the configuration files <filename>/openils/conf/opensrf_core.xml</filename> and <filename>/openils/conf/opensrf.xml</filename>:</para>\r
293                                 <figure>\r
294                                         <title>Commands to create configuration files</title>\r
295                                         <screen>\r
296                                         $ su - root\r
297                                         $ cd /openils/conf\r
298                                         $ cp opensrf.xml.example      opensrf.xml\r
299                                         $ cp opensrf_core.xml.example opensrf_core.xml\r
300                                         </screen>\r
301                                 </figure>\r
302                         </section>\r
303                         <section>\r
304                                 <title>Edit opensrf_core.xml</title>\r
305                                 <para>Edit the file <filename>/openils/conf/opensrf_core.xml</filename> to change the <systemitem class="service">ejabberd</systemitem> usernames and passwords as follows.</para>\r
306                                 <note>\r
307                                         <para>\r
308                                                 <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>\r
309                                         </para>\r
310                                 </note>\r
311                                 <figure>\r
312                                         <title>Updates needed in the file <filename>/openils/conf/opensrf_core.xml</filename></title>\r
313                                         <screen>\r
314                                         /config/opensrf/username = opensrf\r
315 \r
316                                         /config/opensrf/passwd = password for "private.localhost" opensrf user\r
317 \r
318                                         /config/gateway/username = opensrf\r
319 \r
320                                         /config/gateway/passwd = password for "public.localhost" opensrf user\r
321 \r
322                                         # first entry, where "transport/server" == "public.localhost" :\r
323                                         /config/routers/router/transport \r
324                                             username = router\r
325                                             password = password for "public.localhost" router user\r
326 \r
327                                         # second entry, where "transport/server" == "private.localhost" :\r
328                                         /config/routers/router/transport\r
329                                             username = router\r
330                                             password = password for "private.localhost" router user\r
331                                         </screen>\r
332                                 </figure>\r
333                                 <para>You also need to specify the domains from which OpenSRF will accept and to which OpenSRF will make connections. If you are installing OpenSRF on a single server and using the <systemitem class="domainname">private.localhost</systemitem> / <systemitem class="domainname">public.localhost</systemitem> domains, these will already be set to the correct values. Otherwise, search and replace to match your values.</para>\r
334                         </section>\r
335                         <section>\r
336                                 <title>Modify the file <filename>opensrf.xml</filename></title>\r
337                                 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the file <filename>/openils/conf/opensrf.xml</filename> to set the location of the persistent database in the <literal>dbfile</literal> element near the end of the file:</para>\r
338                                 <figure>\r
339                                         <title>Example of the file <filename>opensrf.xml</filename></title>\r
340                                         <programlisting language="xml"><![CDATA[\r
341                                         <!-- Example of an app-specific setting override -->\r
342                                         <opensrf.persist>\r
343                                           <app_settings>\r
344                                             <dbfile>/tmp/persist.db</dbfile>\r
345                                           </app_settings>\r
346                                         </opensrf.persist>\r
347                                         ]]></programlisting>\r
348                                 </figure>\r
349                         </section>\r
350                         <section>\r
351                                 <title>Create Configuration Files for Users Needing <application>"srfsh"</application></title>\r
352                                 <para>In this section you will set up a special configuration file for each user who will need to run the <application>"srfsh"</application> (pronounced <emphasis>surf shell</emphasis>) utility.</para>\r
353                                 <para>The software installation will automatically create <application>"srfsh"</application>. This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See <xref linkend="serversideinstallation-testing"/> for further information.</para>\r
354                                 <para>As the <systemitem class="username">root</systemitem> user, copy the short sample configuration file <filename>/openils/conf/srfsh.xml.example</filename> to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of each user who will use <application>"srfsh"</application>. Finally, edit each file <filename>.srfsh.xml</filename> and make the following changes. When you finish, remember to change the owner of the file to match the owner of the home directory.</para>\r
355                                 <itemizedlist>\r
356                                         <listitem>Modify <literal>domain</literal> to be the router hostname (following our domain examples, <systemitem class="domainname">private.localhost</systemitem> will give <application>"srfsh"</application> access to all OpenSRF services, while <systemitem class="domainname">public.localhost</systemitem> will only allow access to those OpenSRF services that are publicly exposed).</listitem>\r
357                                         <listitem>Modify <literal>username</literal> and <literal>password</literal> to match the <literal>opensrf</literal> Jabber user for the chosen domain</listitem>\r
358                                         <listitem>Modify <literal>logfile</literal> to be the full path for a log file to which the user has write access</listitem>\r
359                                         <listitem>Modify <literal>loglevel</literal> as needed for testing</listitem>\r
360                                 </itemizedlist>\r
361                                 <figure>\r
362                                         <title>Example of the file <filename>/openils/conf/srfsh.xml.example</filename></title>\r
363                                         <programlisting language="xml"><![CDATA[\r
364                                         <?xml version="1.0"?>\r
365                                         <!-- This file follows the standard bootstrap config file layout -->\r
366                                         <!-- found in opensrf_core.xml -->\r
367                                         <srfsh>\r
368                                         <router_name>router</router_name>\r
369                                         <domain>private.localhost</domain>\r
370                                         <username>opensrf</username>\r
371                                         <passwd>privsrf</passwd>\r
372                                         <port>5222</port>\r
373                                         <logfile>/tmp/srfsh.log</logfile>\r
374                                         <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->\r
375                                         <loglevel>4</loglevel>\r
376                                         </srfsh>\r
377                                         ]]></programlisting>\r
378                                 </figure>\r
379                         </section>\r
380                         <section>\r
381                                 <title>Modify Environmental Variable PATH for <systemitem class="username">opensrf</systemitem> User</title>\r
382                                 <para>As the <systemitem class="username">opensrf</systemitem> user, modify the environmental variable <envar>PATH</envar> by adding a new file path to the <systemitem class="username">opensrf</systemitem> user's shell configuration file <filename>.bashrc</filename>:</para>\r
383                                 <figure>\r
384                                         <title>Commands to add path to <filename>.bashrc</filename> configuration file</title>\r
385                                         <screen>\r
386                                         $ su - opensrf\r
387                                         $ echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc\r
388                                         </screen>\r
389                                 </figure>\r
390                         </section>\r
391                         <section>\r
392                                 <title>Starting OpenSRF</title>\r
393                                 <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services:</para>\r
394                                 <figure>\r
395                                         <title>Commands to start <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services</title>\r
396                                         <screen>\r
397                                         $ su - root\r
398                                         $ /etc/init.d/ejabberd start\r
399                                         $ /etc/init.d/memcached start\r
400                                         </screen>\r
401                                 </figure>\r
402                                 <para/>\r
403                                 <para>Finally, as the <systemitem class="username">opensrf</systemitem> user, start OpenSRF:</para>\r
404                                 <figure>\r
405                                         <title>Commands to start OpenSRF</title>\r
406                                         <screen>\r
407                                         $ su - opensrf\r
408 \r
409                                         # ensure you have the needed path\r
410                                         $ export PATH=$PATH:/openils/bin\r
411 \r
412                                         # start the OpenSRF service:\r
413                                         # use "-l" to force hostname to be "localhost"\r
414                                         $ osrf_ctl.sh -l -a start_all     \r
415                                         </screen>\r
416                                 </figure>\r
417                                 <note>\r
418                                         <para>\r
419                                                 <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 <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>\r
420                                         </para>\r
421                                 </note>\r
422                         </section>\r
423                         <section>\r
424                                 <title>Testing connections to OpenSRF</title>\r
425                                 <para>Once you have installed and started OpenSRF, as the <systemitem class="username">root</systemitem> user, test your connection to OpenSRF using the <application>"srfsh"</application> utility and trying to call the <emphasis>add</emphasis> method on the OpenSRF <systemitem class="service">math</systemitem> service:</para>\r
426                                 <figure>\r
427                                         <title>Commands to test OpenSRF with <application>"srfsh"</application></title>\r
428                                         <screen>\r
429                                         $ su - opensrf\r
430                                         $ /openils/bin/srfsh\r
431                                         srfsh#  request opensrf.math add 2 2\r
432                                         Received Data: 4\r
433                                         ------------------------------------\r
434                                         Request Completed Successfully\r
435                                         Request Time in seconds: 0.007519\r
436                                         ------------------------------------\r
437                                         srfsh#\r
438                                         </screen>\r
439                                 </figure>\r
440                                 <indexterm>\r
441                                         <primary>ZZZ-REVIEW</primary>\r
442                                         <secondary>VERIFY THIS TEST </secondary>\r
443                                 </indexterm>\r
444                                 <caution>VERIFY THIS TEST </caution>\r
445                                 <para>For other <application>"srfsh"</application> commands, type <userinput>help</userinput> in at the prompt.</para>\r
446                         </section>\r
447                         <section>\r
448                                 <title>Stopping OpenSRF</title>\r
449                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop OpenSRF:</para>\r
450                                 <figure>\r
451                                         <title>Commands to stop OpenSRF</title>\r
452                                         <screen>\r
453                                         $ su - opensrf\r
454                                         $ osrf_ctl.sh -l -a stop_all\r
455                                         </screen>\r
456                                 </figure>\r
457                         </section>\r
458                 </section>\r
459                 <section xml:id="serversideinstallation-ubuntudebian">\r
460                         <title>Installing Evergreen 1.6.0.7 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>\r
461                         <para>This section outlines the installation process for the latest stable version of Evergreen.</para>\r
462                         <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>\r
463                         <note>\r
464                                 <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 <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server edition.</para>\r
465                                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>\r
466                                 <itemizedlist>\r
467                                         <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
468                                         <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
469                                 </itemizedlist>\r
470                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue the command <command>exit</command>.</para>\r
471                         </note>\r
472                         <section>\r
473                                 <title>Installing OpenSRF</title>\r
474                                 <para>Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see <xref linkend="serversideinstallation-opensrf"/>.</para>\r
475                                 <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>\r
476                         </section>\r
477                         <section>\r
478                                 <title>Download and Unpack Latest Evergreen Version</title>\r
479                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of Evergreen. The latest version can be found here: <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz"></ulink></para>\r
480                                 <figure>\r
481                                         <title>Commands to download and unpack Evergreen</title>\r
482                                         <screen>\r
483                                         $ su - opensrf\r
484                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz\r
485                                         $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz\r
486                                         </screen>\r
487                                 </figure>\r
488                                 <para>The new directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7</filename> will be created.</para>\r
489                         </section>\r
490                         <section>\r
491                                 <title>Install Prerequisites to Build Evergreen</title>\r
492                                 <para>In this section you will install and configure a set of prerequisites that will be used to build Evergreen. In a following step you will actually build the software using the <command>make</command> utility.</para>\r
493                                 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[distribution]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-2">"Keywords"</link> figure below.</para>\r
494                                 <figure>\r
495                                         <title>Commands to install prerequisites for Evergreen</title>\r
496                                         <screen>\r
497                                         $ su - root\r
498                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7\r
499                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]\r
500                                         ...\r
501                                         </screen>\r
502                                 </figure>\r
503                                 <table xml:id="serversideinstallation-keywords-figure-2">\r
504                                         <title>Keywords Targets for <application>"make"</application> Command</title>\r
505                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
506                                                 <colspec colnum="1" colwidth="1.0*"/>\r
507                                                 <colspec colnum="2" colwidth="3.0*"/>\r
508                                                 <thead>\r
509                                                         <row>\r
510                                                                 <entry>Keyword</entry>\r
511                                                                 <entry>Description</entry>\r
512                                                         </row>\r
513                                                 </thead>\r
514                                                 <tbody>\r
515                                                         <row>\r
516                                                                 <entry>debian-lenny</entry>\r
517                                                                 <entry>for Debian Lenny (5.0), the most recent version</entry>\r
518                                                         </row>\r
519                                                         <row>\r
520                                                                 <entry>debian-etch</entry>\r
521                                                                 <entry>for Debian Etch (4.0)</entry>\r
522                                                         </row>\r
523                                                         <row>\r
524                                                                 <entry>ubuntu-karmic</entry>\r
525                                                                 <entry>for Ubuntu Lucid (10.04) [same as for Karmic]</entry>\r
526                                                         </row>\r
527                                                         <row>\r
528                                                                 <entry>ubuntu-karmic</entry>\r
529                                                                 <entry>for Ubuntu Karmic (9.10)</entry>\r
530                                                         </row>\r
531                                                         <row>\r
532                                                                 <entry>ubuntu-intrepid</entry>\r
533                                                                 <entry>for Ubuntu Intrepid (8.10)</entry>\r
534                                                         </row>\r
535                                                         <row>\r
536                                                                 <entry>ubuntu-hardy</entry>\r
537                                                                 <entry>for Ubuntu Hardy (8.04)</entry>\r
538                                                         </row>\r
539                                                         <row>\r
540                                                                 <entry>ubuntu-gutsy</entry>\r
541                                                                 <entry>for Ubuntu Gutsy (7.10)</entry>\r
542                                                         </row>\r
543                                                         <row>\r
544                                                                 <entry>gentoo</entry>\r
545                                                                 <entry>generic for Gentoo versions</entry>\r
546                                                         </row>\r
547                                                         <row>\r
548                                                                 <entry>centos</entry>\r
549                                                                 <entry>generic for Centos versions</entry>\r
550                                                         </row>\r
551                                                 </tbody>\r
552                                         </tgroup>\r
553                                 </table>\r
554                                 <indexterm>\r
555                                         <primary>ZZZ-REVIEW</primary>\r
556                                         <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>\r
557                                 </indexterm>\r
558                                 <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>\r
559                         </section>\r
560                         <section xml:id="serversideinstallation-postgresql-default">\r
561                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>\r
562                                 <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>\r
563                                 <para>For further information on manually installing PostgreSQL, see <xref linkend="serversideinstallation-postgresql"/>.</para>\r
564                                 <para>If your PostgreSQL server will be on the same system as your Evergreen software, then as the <systemitem class="username">root</systemitem> user install the required PostgreSQL server packages:</para>\r
565                                 <figure>\r
566                                         <title>Commands to install the PostgreSQL server</title>\r
567                                         <screen>\r
568                                         $ su - root\r
569         \r
570                                         # Debian Lenny and Ubuntu Hardy (8.04)\r
571                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83\r
572                                         ...\r
573 \r
574                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)\r
575                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84\r
576                                         ...\r
577                                         </screen>\r
578                                 </figure>\r
579                                 <note>\r
580                                         <para>\r
581                                                 <emphasis>PostgreSQL 8.1 is deprecated and will become unsupported in a future Evergreen release, though existing installations upgrading from Evergreen 1.4 or before will continue to work. Please upgrade your PostgreSQL installation soon.</emphasis>\r
582                                         </para>\r
583                                 </note>\r
584                                 <indexterm>\r
585                                         <primary>ZZZ-REVIEW</primary>\r
586                                         <secondary>ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU CURRENTLY HAVE</secondary>\r
587                                 </indexterm>\r
588                                 <caution>ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU CURRENTLY HAVE</caution>\r
589                         </section>\r
590                         <section>\r
591                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>\r
592                                 <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>\r
593                                 <para>Otherwise, if your PostgreSQL server is running on another system, then as the <systemitem class="username">root</systemitem> user install the following Perl modules on that system:</para>\r
594                                 <figure>\r
595                                         <title>Commands to install Perl modules</title>\r
596                                         <screen>\r
597                                         # ensure the gcc compiler is installed\r
598                                         $ su - root\r
599                                         $ apt-get install gcc\r
600                                         ...\r
601         \r
602                                         # install the Perl modules\r
603                                         $ perl -MCPAN -e shell\r
604                                         cpan> install JSON::XS\r
605                                         cpan> install MARC::Record\r
606                                         cpan> install MARC::File::XML\r
607                                         </screen>\r
608                                 </figure>\r
609                                 <indexterm>\r
610                                         <primary>ZZZ-REVIEW</primary>\r
611                                         <secondary>ADD INFO ON HOW TO INSTALL THE PERL MODULES </secondary>\r
612                                 </indexterm>\r
613                                 <caution>ADD INFO ON HOW TO INSTALL THE PERL MODULES </caution>\r
614                                 <indexterm>\r
615                                         <primary>ZZZ-REVIEW</primary>\r
616                                         <secondary>ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </secondary>\r
617                                 </indexterm>\r
618                                 <caution>ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED </caution>\r
619                         </section>\r
620                         <section>\r
621                                 <title>Update the System Dynamic Library Path</title>\r
622                                 <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/eg.conf</filename> containing two new library paths, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>\r
623                                 <figure>\r
624                                         <title>Commands to modify system dynamic library path</title>\r
625                                         <screen>\r
626                                         $ su - root\r
627                                         $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE\r
628                                         /usr/local/lib\r
629                                         /usr/local/lib/dbd\r
630                                         ENDOFFILE\r
631                                         $ ldconfig\r
632                                         </screen>\r
633                                 </figure>\r
634                         </section>\r
635                         <section>\r
636                                 <title>(OPTIONAL) Restart the PostgreSQL Server</title>\r
637                                 <para>If PostgreSQL is running on the same system as the rest of Evergreen, as the <systemitem class="username">root</systemitem> user you must restart the PostgreSQL server to avoid a problem where the library <filename>plperl.so</filename> cannot be found. If your PostgreSQL server is running on another system, just skip this step.</para>\r
638                                 <indexterm>\r
639                                         <primary>ZZZ-REVIEW</primary>\r
640                                         <secondary>ADD INFO ON OTHER VERSIONS OF POSTGRESQL </secondary>\r
641                                 </indexterm>\r
642                                 <caution>ADD INFO ON OTHER VERSIONS OF POSTGRESQL </caution>\r
643                                 <figure>\r
644                                         <title>Commands to restart PostgreSQL server</title>\r
645                                         <screen>\r
646                                         $ su - root\r
647                                         $ /etc/init.d/postgresql-PGSQL_VERSION restart\r
648                                         </screen>\r
649                                 </figure>\r
650                                 <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</emphasis>\r
651                         </section>\r
652                         <section xml:id="serversideinstallation-configure">\r
653                                 <title>Configure Evergreen</title>\r
654                                 <para>As the <systemitem class="username">opensrf</systemitem> user, return to the Evergreen build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software:</para>\r
655                                 <figure>\r
656                                         <title>Commands to configure Evergreen</title>\r
657                                         <screen>\r
658                                         $ su - opensrf\r
659                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7\r
660                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf\r
661                                         $ make\r
662                                         ...\r
663                                         </screen>\r
664                                 </figure>\r
665                         </section>\r
666                         <section xml:id="serversideinstallation-compilingevergreen">\r
667                                 <title>Compile, Link and Install Evergreen</title>\r
668                                 <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>\r
669                                 <para>As the <systemitem class="username">root</systemitem> user, return to the Evergreen build directory and use the <command>make</command> utility as shown below. The Staff Client will also be automatically built, but you must remember to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the Staff Client you will use to connect to the Evergreen server.</para>\r
670                                 <para>For further information on manually building the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>\r
671                                 <figure>\r
672                                         <title>Commands to build, link and install Evergreen</title>\r
673                                         <screen>\r
674                                         $ su - root\r
675                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7\r
676                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install\r
677                                         ...\r
678                                         </screen>\r
679                                         <para>The above commands will create a new subdirectory <filename class="directory">/openils/var/web/xul/rel_1_6_0_7</filename> containing the Staff Client.</para>\r
680                                 </figure>\r
681                                 <para>To complete the Staff Client installation, as the <systemitem class="username">root</systemitem> user create a symbolic link named <emphasis>server</emphasis> in the head of the Staff Client directory <filename class="directory">/openils/var/web/xul</filename> that points to the subdirectory <filename class="directory">/server</filename> of the new Staff Client build:</para>\r
682                                 <figure>\r
683                                         <title>Commands to create symbolic link</title>\r
684                                         <screen>\r
685                                         $ su - root\r
686                                         $ cd /openils/var/web/xul\r
687                                         $ ln -sf rel_1_6_0_7/server server\r
688                                         </screen>\r
689                                 </figure>\r
690                         </section>\r
691                         <section>\r
692                                 <title>Copy the OpenSRF Configuration Files</title>\r
693                                 <para>As the <systemitem class="username">root</systemitem> user, copy the example OpenSRF configuration files into place. This replaces the configuration files that you set up in a previous step when you installed and tested OpenSRF. You should also create backup copies of the old files for troubleshooting purposes. Finally, change the ownership on the installed files to the <systemitem class="username">opensrf</systemitem> user:</para>\r
694                                 <figure>\r
695                                         <title>Commands to copy OpenSRF configuration files</title>\r
696                                         <screen>\r
697                                         $ su - root\r
698                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml\r
699                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml\r
700                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml\r
701                                         $ chown -R opensrf:opensrf /openils/\r
702                                         </screen>\r
703                                 </figure>\r
704                         </section>\r
705                         <section>\r
706                                 <title>Create and Configure PostgreSQL Database</title>\r
707                                 <para>As the <systemitem class="username">postgres</systemitem> user on your PostgreSQL server, create the Evergreen database.</para>\r
708                                 <para>In the commands below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis> repository to match your PostgreSQL server layout. For example, if you built PostgreSQL from source the path would be <filename class="directory">/usr/local/share/contrib</filename>; if you installed the PostgreSQL 8.3 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>, the path would be <filename class="directory">/usr/share/postgresql/8.3/contrib/</filename>.</para>\r
709                                 <procedure>\r
710                                         <step>\r
711                                                 <para>\r
712                                                         <emphasis role="bold">Create and configure the database</emphasis>\r
713                                                 </para>\r
714                                                 <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>\r
715                                                 <figure>\r
716                                                         <title>Commands to create database and adjust the path</title>\r
717                                                         <screen>\r
718                                                         # create the database\r
719                                                         $ su - postgres\r
720                                                         $ createdb -E UNICODE evergreen\r
721                                                         $ createlang plperl   evergreen\r
722                                                         $ createlang plperlu  evergreen\r
723                                                         $ createlang plpgsql  evergreen\r
724                 \r
725                                                         # adjust the paths\r
726                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen\r
727                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen\r
728                                                         $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen\r
729                                                         </screen>\r
730                                                 </figure>\r
731                                                 <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</emphasis>\r
732                                         </step>\r
733                                         <step>\r
734                                                 <para>\r
735                                                         <emphasis role="bold">Create new Evergreen superuser</emphasis>\r
736                                                 </para>\r
737                                                 <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system, create the new database <systemitem class="username">evergreen</systemitem> user and assign a password:</para>\r
738                                                 <figure>\r
739                                                         <title>Commands to create the <systemitem class="username">evergreen</systemitem> user</title>\r
740                                                         <screen>\r
741                                                         # create superuser 'evergreen' and set the password\r
742                                                         $ su - postgres\r
743                                                         $ createuser -P -s evergreen\r
744                                                         Enter password for new role: MYNEWPASSWORD\r
745                                                         Enter it again: MYNEWPASSWORD\r
746                                                         </screen>\r
747                                                 </figure>\r
748                                                 <emphasis>Where <literal>MYNEWPASSWORD</literal> is the password chosen.</emphasis>\r
749                                         </step>\r
750                                 </procedure>\r
751                         </section>\r
752                         <section>\r
753                                 <title>Create Database Schema</title>\r
754                                 <para>As the <systemitem class="username">root</systemitem> user, create the database schema and configure your system with the corresponding database authentication details for the <emphasis>evergreen</emphasis> database user that you created in the previous step.</para>\r
755                                 <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>\r
756                                 <figure>\r
757                                         <title>Commands to create Evergreen database schema</title>\r
758                                         <screen>\r
759                                         $ su - root\r
760                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7\r
761                                         $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \\r
762                                                 --service all --create-schema --create-bootstrap --create-offline \\r
763                                                 --hostname HOSTNAME --port PORT \\r
764                                                 --user evergreen --password PASSWORD --database DATABASENAME\r
765                                         </screen>\r
766                                 </figure>\r
767                                 <emphasis>Where, on most systems, <emphasis>HOSTNAME</emphasis> will be <emphasis role="bold">localhost</emphasis>, <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>, and <emphasis>PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> will be those assigned when PostgreSQL was installed in the previous step.</emphasis>\r
768                                 <note>\r
769                                         <para>\r
770                                                 <emphasis>If you are entering the above command on a single line, do not include the <literal>\</literal> (backslash) characters. If you are using the <command>bash</command> shell, these should only be used at the end of a line at a bash prompt to indicate that the command is continued on the next line.</emphasis>\r
771                                         </para>\r
772                                 </note>\r
773                         </section>\r
774                         <section xml:id="serversideinstallation-modify-apache">\r
775                                 <title>Modify the Apache Configuration</title>\r
776                                 <para>The Apache configuration must be updated in several ways to support Evergreen.</para>\r
777                                 <section>\r
778                                         <title>Configure the Apache Server</title>\r
779                                         <para>Enable some built-in Apache modules with the utility <command>a2enmod</command>, and install some additional Apache configuration files. As the <systemitem class="username">root</systemitem> user, enable some modules in the Apache server, then copy the new configuration files to the Apache server directories:</para>\r
780                                         <figure>\r
781                                                 <title>Commands to configure the Apache server</title>\r
782                                                 <screen>\r
783                                                 # configure the Apache server\r
784                                                 $ su - root\r
785                                                 $ a2enmod ssl        # enable mod_ssl\r
786                                                 $ a2enmod rewrite    # enable mod_rewrite\r
787                                                 $ a2enmod expires    # enable mod_expires\r
788                                                 $ cd /home/opensrf/Evergreen-ILS-1.x.x.x\r
789                 \r
790                                                 # copy files\r
791                                                 $ cp Open-ILS/examples/apache/eg.conf    /etc/apache2/sites-available/\r
792                                                 $ cp Open-ILS/examples/apache/eg_vhost.conf   /etc/apache2/\r
793                                                 $ cp Open-ILS/examples/apache/startup.pl      /etc/apache2/\r
794                                                 </screen>\r
795                                         </figure>\r
796                                 </section>\r
797                                 <section xml:id="serversideinstallation-createsslkey">\r
798                                         <title>Create a Security Certificate (SSL Key)</title>\r
799                                         <para>Create a new SSL key for the Apache server with the command <command>openssl</command>. 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>\r
800                                         <figure>\r
801                                                 <title>Commands to create an SSL key</title>\r
802                                                 <screen>\r
803                                                 $ mkdir /etc/apache2/ssl\r
804                                                 $ cd /etc/apache2/ssl\r
805                                                 $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key\r
806                                                 </screen>\r
807                                         </figure>\r
808                                         <warning>\r
809                                                 <para>\r
810                                                         <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>\r
811                                                 </para>\r
812                                                 <para>For further information on getting a proper SSL certificate, see <xref linkend="serversideinstallation-ssl"/>.</para>\r
813                                         </warning>\r
814                                 </section>\r
815                                 <section>\r
816                                         <title>Modify the Apache Configuration File</title>\r
817                                         <para>Several changes are needed in the new Apache configuration file <filename>/etc/apache2/sites-available/eg.conf</filename>. As the <systemitem class="username">root</systemitem> user, edit the file and make the following changes:</para>\r
818                                         <procedure>\r
819                                                 <step>\r
820                                                         <para>Comment out the line <literal>Allow from 10.0.0.0/8</literal>, then uncomment the line <literal>Allow from all</literal>.</para>\r
821                                                         <para>\r
822                                                                 <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>\r
823                                                         </para>\r
824                                                         <warning>\r
825                                                                 <para>\r
826                                                                         <emphasis>You must remove these changes after testing is completed. See <xref linkend="serversideinstallation-postinstallation"/> for further details on removing this change after the Evergreen installation is complete.</emphasis>\r
827                                                                 </para>\r
828                                                         </warning>\r
829                                                 </step>\r
830                                                 <step>\r
831                                                         <para>Comment out the line <literal>Listen 443</literal>, since it conflicts with the same declaration in the configuration file: <filename>/etc/apache2/ports.conf</filename>. <systemitem class="osname">Debian Etch</systemitem> users should not do this.</para>\r
832                                                         <indexterm>\r
833                                                                 <primary>ZZZ-REVIEW</primary>\r
834                                                                 <secondary>ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </secondary>\r
835                                                         </indexterm>\r
836                                                         <caution>ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS </caution>\r
837                                                 </step>\r
838                                                 <step>\r
839                                                         <warning>\r
840                                                                 <para>The following updates are needed to allow the logs to function properly, but it may break other Apache applications on your server.</para>\r
841                                                         </warning>\r
842                                                         <itemizedlist>\r
843                                                                 <listitem>\r
844                                                                         <para>For the <systemitem class="osname">Linux</systemitem> distributions <systemitem class="osname">Ubuntu Hardy</systemitem> or <systemitem class="osname">Debian Etch</systemitem>, as the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and change the phrase: <literal>User www-data</literal> to the phrase: <literal>User opensrf</literal>.</para>\r
845                                                                 </listitem>\r
846                                                                 <listitem>\r
847                                                                         <para>For the <systemitem class="osname">Linux</systemitem> distributions <systemitem class="osname">Ubuntu Karmic</systemitem> or <systemitem class="osname">Ubuntu Lucid</systemitem> or <systemitem class="osname">Debian Lenny</systemitem>, as the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/envvars</filename> and change the phrase: <literal>export APACHE_RUN_USER=www-data</literal> to the phrase: <literal>export APACHE_RUN_USER=opensrf</literal>.</para>\r
848                                                                 </listitem>\r
849                                                         </itemizedlist>\r
850                                                 </step>\r
851                                                 <step>\r
852                                                         <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and add the lines <literal>KeepAliveTimeout 1</literal> and <literal>MaxKeepAliveRequests 100</literal>, or modify any existing lines.</para>\r
853                                                 </step>\r
854                                         </procedure>\r
855                                 </section>\r
856                                 <section>\r
857                                         <title>(OPTIONAL) Performance Modifications for Apache</title>\r
858                                         <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>\r
859                                         <procedure>\r
860                                                 <step>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename>, locate and modify the section related to <emphasis>prefork configuration</emphasis> to suit the load on your system.</step>\r
861                                                 <figure>\r
862                                                         <title>(OPTIONAL) Example of updates to Apache configuration</title>\r
863                                                         <programlisting language="xml"><![CDATA[\r
864                                                         <IfModule mpm_prefork_module>\r
865                                                            StartServers           20\r
866                                                            MinSpareServers         5\r
867                                                            MaxSpareServers        15\r
868                                                            MaxClients            150\r
869                                                            MaxRequestsPerChild 10000\r
870                                                         </IfModule>\r
871                                                         ]]></programlisting>\r
872                                                 </figure>\r
873                                         </procedure>\r
874                                 </section>\r
875                                 <section>\r
876                                         <title>Enable the Evergreen Web Site</title>\r
877                                         <para>Finally, as the <systemitem class="username">root</systemitem> user, execute the following Apache configuration commands to disable the default <emphasis>It Works</emphasis> web page and to enable the Evergreen web site:</para>\r
878                                         <figure>\r
879                                                 <title>Commands to enable the Evergreen Web Site</title>\r
880                                                 <screen>\r
881                                                 $ su - root\r
882         \r
883                                                 # disable the default site\r
884                                                 $ a2dissite default\r
885                 \r
886                                                 # enable the Evergreen web site\r
887                                                 $ a2ensite eg.conf\r
888                                                 </screen>\r
889                                         </figure>\r
890                                 </section>\r
891                         </section>\r
892                         <section xml:id="serversideinstallation-opensrf-config">\r
893                                 <title>Modify the OpenSRF Configuration File</title>\r
894                                 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename> to update the Jabber usernames and passwords, and to specify the domain from which we will accept and to which we will make connections.</para>\r
895                                 <para>If you are installing Evergreen on a single server and using the <systemitem class="domainname">private.localhost</systemitem> / <systemitem class="domainname">public.localhost</systemitem> domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values.</para>\r
896                                 <note>\r
897                                         <para>\r
898                                                 <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>\r
899                                         </para>\r
900                                 </note>\r
901                                 <indexterm>\r
902                                         <primary>ZZZ-REVIEW</primary>\r
903                                         <secondary>ADD A BETTER DIAGRAM HERE </secondary>\r
904                                 </indexterm>\r
905                                 <caution>ADD A BETTER DIAGRAM HERE </caution>\r
906                                 <figure>\r
907                                         <title>Updates needed in the file <filename>/openils/conf/opensrf_core.xml</filename></title>\r
908                                         <screen>\r
909                                         /config/opensrf/username = opensrf\r
910         \r
911                                         /config/opensrf/passwd = password for "private.localhost" opensrf user\r
912         \r
913                                         /config/gateway/username = opensrf\r
914         \r
915                                         /config/gateway/passwd = password for "public.localhost" opensrf user\r
916         \r
917                                         # first entry, where "transport/server" == "public.localhost" :\r
918                                         /config/routers/router/transport \r
919                                             username = router\r
920                                             password = password for "public.localhost" router user\r
921 \r
922                                         # second entry, where "transport/server" == "private.localhost" :\r
923                                         /config/routers/router/transport\r
924                                             username = router\r
925                                             password = password for "private.localhost" router user\r
926                                         </screen>\r
927                                 </figure>\r
928                         </section>\r
929                         <section xml:id="serversideinstallation-srfsh">\r
930                                 <title>Create Configuration Files for Users Needing <application>"srfsh"</application></title>\r
931                                 <para>The software installation will automatically create a utility named <application>"srfsh"</application> (surf shell). This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See <xref linkend="serversideinstallation-testing"/> for further information.</para>\r
932                                 <para>In this section you will set up a special configuration file for each user who will need to run the utility. Copy the short sample configuration file <filename>/openils/conf/srfsh.xml.example</filename> to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of each user who will use <application>"srfsh"</application>. Finally, edit each users' <filename>.srfsh.xml</filename> file and make the following changes:</para>\r
933                                 <procedure>\r
934                                         <step>Modify <emphasis role="bold">domain</emphasis> to be the router hostname (following our domain examples, <systemitem class="domainname">private.localhost</systemitem>> will give <application>"srfsh"</application> access to all OpenSRF services, while <systemitem class="domainname">public.localhost</systemitem> will only allow access to those OpenSRF services that are publicly exposed).</step>\r
935                                         <step>Modify <emphasis role="bold">username</emphasis> and <emphasis role="bold">password</emphasis> to match the <systemitem class="username">opensrf</systemitem> Jabber user for the chosen domain</step>\r
936                                         <step>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</step>\r
937                                         <step>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</step>\r
938                                 </procedure>\r
939                                 <figure>\r
940                                         <title>Example of user's file <filename>.srfsh.xml</filename></title>\r
941                                         <programlisting language="xml"><![CDATA[\r
942                                         <?xml version="1.0"?>\r
943                                         <!-- This file follows the standard bootstrap config file layout -->\r
944                                         <!-- found in opensrf_core.xml -->\r
945                                         <srfsh>\r
946                                         <router_name>router</router_name>\r
947                                         <domain>private.localhost</domain>\r
948                                         <username>opensrf</username>\r
949                                         <passwd>evergreen</passwd>\r
950                                         <port>5222</port>\r
951                                         <logfile>/tmp/srfsh.log</logfile>\r
952                                         <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->\r
953                                         <loglevel>4</loglevel>\r
954                                         </srfsh>\r
955                                         ]]></programlisting>\r
956                                 </figure>\r
957                         </section>\r
958                         <section xml:id="serversideinstallation-opensrf-env">\r
959                                 <title>Modify the OpenSRF Environment</title>\r
960                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change the permissions of <emphasis>.cgi</emphasis> files in the directory <filename class="directory">/openils/var/cgi-bin</filename> to <emphasis>executable</emphasis>, then modify the shell configuration file <filename>~/.bashrc</filename> for <systemitem class="username">opensrf</systemitem> by adding a Perl environmental variable. Finally, execute the shell configuration file to load the new variables into your current environment.</para>\r
961                                 <note>\r
962                                         <para>\r
963                                                 <emphasis>In a multi-server environment, you must add any modifications to <filename>~/.bashrc</filename> to the top of the file <emphasis>before</emphasis> the line <literal>[ -z "$PS1" ] &amp;&amp; return </literal>. This will allow headless (scripted) logins to load the correct environment.</emphasis>\r
964                                         </para>\r
965                                 </note>\r
966                                 <figure>\r
967                                         <title>Commands to modify the OpenSRF environment</title>\r
968                                         <screen>\r
969                                         # change permissions\r
970                                         $ su - opensrf\r
971                                         $ chmod 755 /openils/var/cgi-bin/*.cgi\r
972         \r
973                                         # add environmental variable\r
974                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc\r
975         \r
976                                         # inherit the new environment\r
977                                         $ . ~/.bashrc\r
978                                         </screen>\r
979                                 </figure>\r
980                         </section>\r
981                         <section xml:id="serversideinstallation-localization">\r
982                                 <title>(OPTIONAL) Enabling and Disabling Language Localizations</title>\r
983                                 <para>Current versions of Evergreen (after version 1.4) are bundled with support for a number of languages beyond American English (<emphasis role="bold">en-US</emphasis>). The translated interfaces are split between static files that are automatically installed with Evergreen, and dynamic labels that can be stored in the Evergreen database. Evergreen is installed with additional SQL files that contain translated dynamic labels for a number of languages, and to make the set of translated labels available in all interfaces. Only a few steps are required to enable or disable one or more languages.</para>\r
984                                 <section>\r
985                                         <title>Enabling a Localization</title>\r
986                                         <para>To enable the translated labels for a given language to display in Evergreen, just populate the database with the translated labels and enable the localization. The following example illustrates how to enable Canadian French (<emphasis role="bold">fr-CA</emphasis>) support in the database. These same steps can be used with any of the languages bundled with Evergreen, or you can create and add your own localization.</para>\r
987                                         <orderedlist>\r
988                                                 <listitem>\r
989                                                         <para>The translated labels for each locale are stored in SQL files named "950.data.seed-values-xx-YY.sql" where "xx-YY" represents the locale code for the translation. Load the translated labels into the Evergreen database using the command <command>psql</command>, substituting your user, host and database connection information accordingly:</para>\r
990 <programlisting language="xml"><![CDATA[\r
991 $ psql -U <username> -h <hostname> -d <database> -f /path/to/Evergreen-source/Open-ILS/src/sql/Pg/950.data.seed-values-fr-CA.sql\r
992 ]]></programlisting>\r
993                                                 </listitem>\r
994                                                 <listitem>\r
995                                                         <para>Ensure the locale is enabled in the Evergreen database by using the utility <command>psql</command> to check for the existence of the locale in the table <literal>config.i18n_locale</literal>:</para>\r
996                                                         <figure>\r
997                                                                 <title>Commands to check for localization</title>\r
998                                                                 <screen>\r
999                                                                 SELECT code, marc_code, name, description\r
1000                                                                 FROM config.i18n_locale\r
1001                                                                 WHERE code = 'fr-CA';\r
1002                                                                 </screen>\r
1003                                                         </figure>\r
1004                                                         <para>As shown in the following example, if one row of output is returned, then the locale is already enabled:</para>\r
1005                                                         <figure>\r
1006                                                                 <title>Results of an installed localization</title>\r
1007                                                                 <screen>\r
1008                                                                 code  | marc_code |      name       |   description   \r
1009                                                                 ------+-----------+-----------------+-----------------\r
1010                                                                 fr-CA | fre       | French (Canada) | Canadian French\r
1011                                                                 (1 row)\r
1012                                                                 </screen>\r
1013                                                         </figure>\r
1014                                                         <para>If zero rows of output are returned, then the locale is not enabled:</para>\r
1015                                                         <figure>\r
1016                                                                 <title>Results of no installed localizations</title>\r
1017                                                                 <screen>\r
1018                                                                 code | marc_code | name | description \r
1019                                                                 ------+-----------+------+-------------\r
1020                                                                 (0 rows)\r
1021                                                                 </screen>\r
1022                                                         </figure>\r
1023                                                         <para>To enable a locale, use <command>psql</command> to insert a row into the table <literal>config.i18n_locale</literal> as follows:</para>\r
1024                                                         <figure>\r
1025                                                                 <title>Commands to enable a locale in the database</title>\r
1026                                                                 <screen>\r
1027                                                                 INSERT INTO config.i18n_locale (code, marc_code, name, description)\r
1028                                                                 VALUES ('fr-CA', 'fre', 'French (Canada)', 'Canadian French');\r
1029                                                                 </screen>\r
1030                                                         </figure>\r
1031                                                 </listitem>\r
1032                                         </orderedlist>\r
1033                                 </section>\r
1034                                 <section>\r
1035                                         <title>Disabling a Localization</title>\r
1036                                         <para>You might not want to offer all of the localizations that are preconfigured in Evergreen. If you choose to disable the dynamic labels for a locale, just delete those entries from the table <literal>config.i18n_locale</literal> using the <command>psql</command> utility:</para>\r
1037                                         <figure>\r
1038                                                 <title>Commands to delete localization from table</title>\r
1039                                                 <screen>\r
1040                                                 DELETE FROM config.i18n_locale\r
1041                                                 WHERE code = 'fr-CA';\r
1042                                                 </screen>\r
1043                                         </figure>\r
1044                                 </section>\r
1045                         </section>\r
1046                         <section xml:id="serversideinstallation-starting">\r
1047                                 <title>Starting Evergreen</title>\r
1048                                 <procedure>\r
1049                                         <step>\r
1050                                                 <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services (if they are not already running):</para>\r
1051                                                 <figure>\r
1052                                                         <title>Commands to start <systemitem class="service">ejabberd</systemitem> and <systemitem class="service">memcached</systemitem> services</title>\r
1053                                                         <screen>\r
1054                                                         $ su - root\r
1055                                                         $ /etc/init.d/ejabberd start\r
1056                                                         $ /etc/init.d/memcached start\r
1057                                                         </screen>\r
1058                                                 </figure>\r
1059                                         </step>\r
1060                                         <step>\r
1061                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, start Evergreen.</para>\r
1062                                                 <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>\r
1063                                                 <figure>\r
1064                                                         <title>Commands to start Evergreen</title>\r
1065                                                         <screen>\r
1066                                                         $ su - opensrf\r
1067 \r
1068                                                         # ensure you have the needed path\r
1069                                                         $ export PATH=$PATH:/openils/bin\r
1070 \r
1071                                                         # start the OpenSRF service:\r
1072                                                         # use "-l" to force hostname to be "localhost"\r
1073                                                         $ osrf_ctl.sh -l -a start_all     \r
1074                                                         </screen>\r
1075                                                 </figure>\r
1076                                                 <note>\r
1077                                                         <para>\r
1078                                                                 <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but the <command>osrf_ctl.sh</command> utility must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>\r
1079                                                         </para>\r
1080                                                         <para>Execute the following command to determine the fully qualified domain name of your system:</para>\r
1081                                                         <figure>\r
1082                                                                 <title>(OPTIONAL) Commands to determine the fully qualified domain name</title>\r
1083                                                                 <screen>\r
1084                                                                 $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'\r
1085                                                                 </screen>\r
1086                                                         </figure>\r
1087                                                 </note>\r
1088                                                 <indexterm>\r
1089                                                         <primary>ZZZ-REVIEW</primary>\r
1090                                                         <secondary>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </secondary>\r
1091                                                 </indexterm>\r
1092                                                 <caution>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>\r
1093                                                 <itemizedlist>\r
1094                                                         <listitem>\r
1095                                                                 <para>If you receive an error message similar to <emphasis>osrf_ctl.sh: command not found</emphasis>, then your environment \r
1096                                                                 variable <envar>PATH</envar> does not include the directory <filename class="directory">/openils/bin</filename>. \r
1097                                                                 As the <systemitem class="username">opensrf</systemitem> user, edit the configuration file <filename>/home/opensrf/.bashrc</filename> \r
1098                                                                 and add the following line: <literal>export PATH=$PATH:/openils/bin</literal></para>\r
1099                                                         </listitem>\r
1100                                                         <listitem>\r
1101                                                                 <para>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 <filename class="directory">/openils/lib/perl5</filename>. As the <systemitem class="username">opensrf</systemitem> user, edit the configuration file <filename>/home/opensrf/.bashrc</filename> and add the following line: <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>\r
1102                                                         </listitem>\r
1103                                                 </itemizedlist>\r
1104                                         </step>\r
1105                                         <step>\r
1106                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, generate the Web files needed by the Staff Client and catalog, and calculate the proximity of locations in the Organizational Unit tree (which allows <emphasis>Holds</emphasis> to work properly).</para>\r
1107                                                 <para>You must do this the first time you start Evergreen, and after making any changes to the library hierarchy in the configuration file <filename>config.cgi</filename>.</para>\r
1108                                                 <figure>\r
1109                                                         <title>Commands to generate web files</title>\r
1110                                                         <screen>\r
1111                                                         $ su - opensrf\r
1112                                                         $ cd /openils/bin\r
1113                                                         $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u\r
1114                                                         Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'\r
1115                                                         Updating fieldmapper\r
1116                                                         ...\r
1117                                                         </screen>\r
1118                                                 </figure>\r
1119                                                 <indexterm>\r
1120                                                         <primary>ZZZ-REVIEW</primary>\r
1121                                                         <secondary>ADD RESULTS OF TESTS FROM "autogen.sh" </secondary>\r
1122                                                 </indexterm>\r
1123                                                 <caution>ADD RESULTS OF TESTS FROM <filename>autogen.sh</filename> </caution>\r
1124                                         </step>\r
1125                                         <step>\r
1126                                                 <para>As the <systemitem class="username">root</systemitem> user, restart the Apache Web server:</para>\r
1127                                                 <figure>\r
1128                                                         <title>Commands to restart Apache web server</title>\r
1129                                                         <screen>\r
1130                                                         $ su - root\r
1131                                                         $ /etc/init.d/apache2 restart\r
1132                                                         </screen>\r
1133                                                 </figure>\r
1134                                                 <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>\r
1135                                         </step>\r
1136                                 </procedure>\r
1137                         </section>\r
1138                         <section xml:id="serversideinstallation-testing">\r
1139                                 <title>Testing the Installation</title>\r
1140                                 <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>\r
1141                                 <section xml:id="serversideinstallation-testing-connections">\r
1142                                         <title>Testing Connections to Evergreen</title>\r
1143                                         <para>Once you have installed and started Evergreen, test your connection to Evergreen. As the <systemitem class="username">opensrf</systemitem> user start the <application>"srfsh"</application> application and try logging onto the Evergreen server using the default administrator username and password. Following is sample output generated by executing that script after a successful Evergreen installation:</para>\r
1144                                         <figure>\r
1145                                                 <title>Commands to test Evergreen with <application>"srfsh"</application></title>\r
1146                                                 <screen>\r
1147                                                 $ su - opensrf\r
1148                                                 $ /openils/bin/srfsh\r
1149                                                 srfsh% login admin open-ils\r
1150                                                 Received Data: "250bf1518c7527a03249858687714376"\r
1151                                                 ------------------------------------\r
1152                                                 Request Completed Successfully\r
1153                                                 Request Time in seconds: 0.045286\r
1154                                                 ------------------------------------\r
1155                                                 Received Data: {\r
1156                                                    "ilsevent":0,\r
1157                                                    "textcode":"SUCCESS",\r
1158                                                    "desc":" ",\r
1159                                                    "pid":21616,\r
1160                                                    "stacktrace":"oils_auth.c:304",\r
1161                                                    "payload":{\r
1162                                                       "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",\r
1163                                                       "authtime":420\r
1164                                                    }\r
1165                                                 }\r
1166                                                 ------------------------------------\r
1167                                                 Request Completed Successfully\r
1168                                                 Request Time in seconds: 1.336568\r
1169                                                 ------------------------------------\r
1170                                                 </screen>\r
1171                                         </figure>\r
1172                                 </section>\r
1173                                 <section>\r
1174                                         <title>Other Connection Tests with <application>"srfsh"</application></title>\r
1175                                         <para></para>\r
1176                                         <para>There is another <application>"srfsh"</application> command called <command>math_bench</command> that sends queries to the math servers. Note that the <systemitem class="service">opensrf.math</systemitem> and <systemitem class="service">opensrf.dbmath</systemitem> must be running for this command to work:</para>\r
1177 <screen>\r
1178 <prompt>srfsh#</prompt> <userinput>math_bench 10</userinput>\r
1179 |.........|.........|.........|.........|.........|.........|.........|.........|.........\r
1180 ++++++++++++++++++++++++++++++++++++++++\r
1181 Average round trip time: 0.033425\r
1182 srfsh#\r
1183 </screen>\r
1184                                         <para>The first argument is how many sets of 4 queries (+ - * /) are sent to <systemitem class="service">opensrf.math</systemitem>. When the response is successful, you will see the string of <literal>+</literal> symbols. If the system is not running correctly, you will either get an exception or no result at all.</para>\r
1185                                         <para>For other <application>"srfsh"</application> commands, type <userinput>help</userinput> in at the prompt.</para>\r
1186                                         <para/>\r
1187                                         <para>If this does not work, try the troubleshooting steps in the following section.</para>\r
1188                                 </section>\r
1189                                 <section>\r
1190                                         <title>Testing with <application>"settings-tester.pl"</application></title>\r
1191                                         <para>As the <systemitem class="username">opensrf</systemitem> user, run the script <command>settings-tester.pl</command> to see if it finds any system configuration problems. Following is sample output generated by executing that script after a successful Evergreen installation:</para>\r
1192                                         <section>\r
1193                                                 <title>Example of execution of <command>settings-tester.pl</command></title>\r
1194 <screen>\r
1195 <userinput>su - root</userinput>\r
1196 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.0</userinput>\r
1197 <userinput>perl Open-ILS/src/support-scripts/settings-tester.pl</userinput>\r
1198 LWP::UserAgent version 5.810\r
1199 XML::LibXML version 1.70\r
1200 XML::LibXML::XPathContext version 1.70\r
1201 XML::LibXSLT version 1.70\r
1202 Net::Server::PreFork version 0.97\r
1203 Cache::Memcached version 1.24\r
1204 Class::DBI version 0.96\r
1205 Class::DBI::AbstractSearch version 0.07\r
1206 Template version 2.19\r
1207 DBD::Pg version 2.8.2\r
1208 Net::Z3950::ZOOM version 1.24\r
1209 MARC::Record version 2.0.0\r
1210 MARC::Charset version 1.1\r
1211 MARC::File::XML version 0.92\r
1212 Text::Aspell version 0.04\r
1213 CGI version 3.29\r
1214 DateTime::TimeZone version 0.7701\r
1215 DateTime version 0.42\r
1216 DateTime::Format::ISO8601 version 0.06\r
1217 DateTime::Format::Mail version 0.3001\r
1218 Unix::Syslog version 1.1\r
1219 GD::Graph3d version 0.63\r
1220 JavaScript::SpiderMonkey version 0.19\r
1221 Log::Log4perl version 1.16\r
1222 Email::Send version 2.192\r
1223 Text::CSV version 1.06\r
1224 Text::CSV_XS version 0.52\r
1225 Spreadsheet::WriteExcel::Big version 2.20\r
1226 Tie::IxHash version 1.21\r
1227 Parse::RecDescent version 1.95.1\r
1228 SRU version 0.99\r
1229 JSON::XS version 2.27\r
1230 \r
1231 Checking Jabber connection for user opensrf, domain private.localhost\r
1232 * Jabber successfully connected\r
1233 \r
1234 Checking Jabber connection for user opensrf, domain public.localhost\r
1235 * Jabber successfully connected\r
1236 \r
1237 Checking Jabber connection for user router, domain public.localhost\r
1238 * Jabber successfully connected\r
1239 \r
1240 Checking Jabber connection for user router, domain private.localhost\r
1241 * Jabber successfully connected\r
1242 </screen>\r
1243 <screen>\r
1244 Checking database connections\r
1245 * /opensrf/default/reporter/setup :: Successfully connected to database dbi:Pg:dbname=evergreen;host=localhost;port=5432\r
1246   * Database has the expected server encoding UTF8.\r
1247 * /opensrf/default/apps/open-ils.storage/app_settings/databases :: Successfully connected to database dbi:...\r
1248   * Database has the expected server encoding UTF8.\r
1249 * /opensrf/default/apps/open-ils.cstore/app_settings :: Successfully connected to database dbi:Pg:dbname...\r
1250   * Database has the expected server encoding UTF8.\r
1251 * /opensrf/default/apps/open-ils.pcrud/app_settings :: Successfully connected to database dbi:Pg:dbname...\r
1252   * Database has the expected server encoding UTF8.\r
1253 * /opensrf/default/apps/open-ils.reporter-store/app_settings :: Successfully connected to database dbi:Pg:dbname...\r
1254   * Database has the expected server encoding UTF8.\r
1255 \r
1256 Checking database drivers to ensure &lt;driver&gt; matches &lt;language&gt;\r
1257 * OK: Pg language is undefined for reporter base configuration\r
1258 * OK: Pg language is undefined for reporter base configuration\r
1259 * OK: Pg language is perl in /opensrf/default/apps/open-ils.storage/language\r
1260 * OK: pgsql language is C in /opensrf/default/apps/open-ils.cstore/language\r
1261 * OK: pgsql language is C in /opensrf/default/apps/open-ils.pcrud/language\r
1262 * OK: pgsql language is C in /opensrf/default/apps/open-ils.reporter-store/language\r
1263 \r
1264 Checking libdbi and libdbi-drivers\r
1265   * OK - found locally installed libdbi.so and libdbdpgsql.so in shared library path\r
1266 \r
1267 Checking hostname\r
1268  * OK: found hostname 'localhost' in &lt;hosts&gt; section of opensrf.xml\r
1269 $\r
1270 </screen>\r
1271                                         </section>\r
1272                                         <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. \r
1273                                         Follow the steps in the troubleshooting guide in <xref linkend="troubleshooting"/>.</para>\r
1274                                         <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 \r
1275                                         configuration files and log files and contact the <ulink url="http://open-ils.org/listserv.php">Evergreen development mailing list</ulink> for \r
1276                                         assistance before making any drastic changes to your system configuration.</para>\r
1277                                 </section>\r
1278                                 <section xml:id="serversideinstallation-testing-opac">\r
1279                                         <title>Testing the Catalog</title>\r
1280                                         <para>By default, the OPAC will live at the URL <uri>http://my.domain.com/opac/</uri>.</para>\r
1281                                         <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 highty recommend testing with the <application>"Firefox"</application> browser because of the helpful javascript debugging tools.</para>\r
1282                                         <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>\r
1283                                         <indexterm>\r
1284                                                 <primary>ZZZ-REVIEW</primary>\r
1285                                                 <secondary>ADD OTHER SIMPLE FUNCTIONAL TESTS </secondary>\r
1286                                         </indexterm>\r
1287                                         <caution>ADD OTHER SIMPLE FUNCTIONAL TESTS </caution>\r
1288                                 </section>\r
1289                                 <section>\r
1290                                         <title>Running the Evergreen Staff Client</title>\r
1291                                         <para>Run the Evergreen Staff Client by using the application <application>"XULRunner"</application> (installed automatically and by \r
1292                                         default with Firefox version 3.0 and later on <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem> \r
1293                                         distributions).</para>\r
1294                                         <para>For example, if the source files for the Evergreen installation are in the directory \r
1295                                         <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7/</filename>, start the Staff Client as follows:</para>\r
1296 <screen>\r
1297 $ su - opensrf\r
1298 $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini\r
1299 </screen>\r
1300                                         \r
1301                                 </section>\r
1302                                 <section xml:id="serversideinstallation-starting-apache-server">\r
1303                                         <title>Testing the Apache Web Server</title>\r
1304                                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>\r
1305                                         <para>As the <systemitem class="username">root</systemitem> user, execute the following commands. Note the use of <emphasis>restart</emphasis> to \r
1306                                         force the new Evergreen modules to be reloaded even if the Apache server is already running. Any problems found with your configuration files should \r
1307                                         be displayed:</para>\r
1308                                         <figure>\r
1309                                                 <title>Commands to test the Apache Web Server</title>\r
1310                                                 <screen>\r
1311                                                 $ su - root\r
1312                                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart\r
1313                                                 </screen>\r
1314                                         </figure>\r
1315                                 </section>\r
1316                         </section>\r
1317                         <section xml:id="serversideinstallation-stopping">\r
1318                                 <title>Stopping Evergreen</title>\r
1319                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all Evergreen services by using the following command:</para>\r
1320                                 <figure>\r
1321                                         <title>Commands to stop Evergreen</title>\r
1322                                         <screen>\r
1323                                         $ su - opensrf\r
1324 \r
1325                                         # stop the server:\r
1326                                         # use "-l" to force hostname to be "localhost"\r
1327                                         $ osrf_ctl.sh -l -a stop_all\r
1328                                         </screen>\r
1329                                 </figure>\r
1330                                 <note>\r
1331                                         <para>\r
1332                                                 <emphasis>You can also stop Evergreen services <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but the <command>osrf_ctl.sh</command> utility must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a previous step.</emphasis>\r
1333                                         </para>\r
1334                                 </note>\r
1335                                 <indexterm>\r
1336                                         <primary>ZZZ-REVIEW</primary>\r
1337                                         <secondary>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </secondary>\r
1338                                 </indexterm>\r
1339                                 <caution>ADD EXPLANATION FOR CONFIGURING "opensrf.xml" </caution>\r
1340                         </section>\r
1341                         <section xml:id="serversideinstallation-postinstallation">\r
1342                                 <title>Post-Installation Chores</title>\r
1343                                 <para>There are a few additional steps to complete after Evergreen has been successfully installed and tested.</para>\r
1344                                 <section>\r
1345                                         <title>Remove temporary changes from Apache configuration file</title>\r
1346                                         <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/sites-available/eg.conf</filename> again and make the following change:</para>\r
1347                                         <para>Uncomment the line <literal>Allow from 10.0.0.0/8</literal>, then comment out the line <literal>Allow from all</literal>. You modified this file in an earlier step as a temporary measure to expedite testing (see <xref linkend="serversideinstallation-modify-apache"/> for further information). Those changes must now be reversed in order to deny unwanted access to your CGI scripts from users on other public networks. You <emphasis role="bold">must</emphasis> secure this for a public production system.</para>\r
1348                                 </section>\r
1349                                 <section>\r
1350                                         <title>Configure a permanent SSL key</title>\r
1351                                         <para>In a previous step, we used the command <command>openssl</command> to temporarily create a new SSL key for the Apache server. For a public production server you should configure or purchase a signed SSL certificate. For further information on getting a proper SSL certificate, see <xref linkend="serversideinstallation-ssl"/>.</para>\r
1352                                         <warning>\r
1353                                                 <para>\r
1354                                                         <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>\r
1355                                                 </para>\r
1356                                         </warning>\r
1357                                 </section>\r
1358                                 <section>\r
1359                                         <title>Set Up Support For Reports</title>\r
1360                                         <para>Evergreen reports are extremely powerful, but some configuration is required. See <xref linkend="reports"/> for details.</para>\r
1361                                         <itemizedlist>\r
1362                                                 <listitem>\r
1363                                                         <para>Starting the Reporter Daemon</para>\r
1364                                                         <para>Once the <systemitem class="daemon">open-ils.reporter</systemitem> process is running and enabled on the gateway, you can start the reporter daemon. That process periodically checks for requests for new reports or scheduled reports and gets them running.</para>\r
1365                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, start the reporter daemon using the following command:</para>\r
1366                                                         <figure>\r
1367                                                                 <title>Commands to start the Reporter daemon</title>\r
1368                                                                 <screen>\r
1369                                                                 $ su - opensrf\r
1370                                                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/src/reporter\r
1371                                                                 $ ./clark-kent.pl --daemon\r
1372                                                                 </screen>\r
1373                                                         </figure>\r
1374                                                         <para>You can also specify other options with this utility:</para>\r
1375                                                         <itemizedlist>\r
1376                                                                 <listitem><option>--sleep=interval</option> : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>\r
1377                                                                 <listitem><option>--lockfile=filename</option> : where to place the lockfile for the process; defaults to <filename>/tmp/reporter-LOCK</filename></listitem>\r
1378                                                                 <listitem><option>--concurrency=integer</option> : number of reporter daemon processes to run; defaults to <literal>1</literal></listitem>\r
1379                                                                 <listitem><option>--bootstrap=filename</option> : OpenSRF bootstrap configuration file; defaults to <filename>/openils/conf/opensrf_core.xml</filename></listitem>\r
1380                                                         </itemizedlist>\r
1381                                                 </listitem>\r
1382                                                 <listitem>\r
1383                                                         <para>Stopping the Reporter Daemon</para>\r
1384                                                         <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>\r
1385                                                         <note>\r
1386                                                                 <para>\r
1387                                                                         <emphasis>It is possible that several processes are running; see the optional commands in the previous section. As the <systemitem class="username">opensrf</systemitem> user, perform the following commands to stop the Reporter daemon:</emphasis>\r
1388                                                                 </para>\r
1389                                                         </note>\r
1390                                                         <figure>\r
1391                                                                 <title>Commands to stop the Reporter daemon</title>\r
1392                                                                 <screen>\r
1393                                                                 $ su - opensrf\r
1394                                                                 # find and kill the process ID number(s)\r
1395                                                                 $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`\r
1396                                                                 # remove the lock file\r
1397                                                                 $ rm /tmp/reporter-LOCK\r
1398                                                                 </screen>\r
1399                                                         </figure>\r
1400                                                 </listitem>\r
1401                                         </itemizedlist>\r
1402                                 </section>\r
1403                                 <section xml:id="serversideinstallation-organizationandpolicy">\r
1404                                         <title>Organization and Policy Editing</title>\r
1405                                         <para>After installing Evergreen, you will want to make configuration changes to reflect the organizational hierarchy and the policies of your library or libraries. See <xref linkend="orgunits"/> for further information. Examples of what can be configured include:</para>\r
1406                                         <itemizedlist>\r
1407                                                 <listitem>Adding a branch library</listitem>\r
1408                                                 <listitem>Changing circulation rules for an existing library</listitem>\r
1409                                                 <listitem>Adding a new staff position or user group</listitem>\r
1410                                         </itemizedlist>\r
1411                                         <indexterm>\r
1412                                                 <primary>ZZZ-REVIEW</primary>\r
1413                                                 <secondary>ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </secondary>\r
1414                                         </indexterm>\r
1415                                         <caution>ADD CONTENT FOR ORGANIZATION AND POLICY EDITING </caution>\r
1416                                 </section>\r
1417                                 <section xml:id="serversideinstallation-ssl">\r
1418                                         <title>Getting a Signed SSL Certificate</title>\r
1419                                         <para>This section describes how to get a properly signed SSL certificate.</para>\r
1420                                         <para>For temporary testing purposes, you can use the command <command>openssl</command> to create a new SSL key for your Apache server. This is just a self-signed certificate and will generate warnings in the Staff Client and browser during testing and development. For a public production server you should configure or purchase a properly signed SSL certificate.</para>\r
1421                                         <indexterm>\r
1422                                                 <primary>ZZZ-REVIEW</primary>\r
1423                                                 <secondary>ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </secondary>\r
1424                                         </indexterm>\r
1425                                         <caution>ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE </caution>\r
1426                                 </section>\r
1427                         </section>\r
1428                 </section>\r
1429                 <section xml:id="serversideinstallation-virtual">\r
1430                         <title>Installing In Virtualized Unix Environments</title>\r
1431                         <para>Evergreen software currently runs as a native application on any of several well-known <systemitem class="osname">Linux</systemitem> distributions (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). It does not run as a native application on the <systemitem class="osname">Windows</systemitem> operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can be installed and run on <systemitem class="osname">Windows</systemitem> via a virtualized Linux-guest Operating System (using, for example, <application>"VirtualBox"</application> or <application>"VMware"</application> to emulate a <systemitem class="osname">Linux</systemitem> environment).</para>\r
1432                         <indexterm>\r
1433                                 <primary>ZZZ-REVIEW</primary>\r
1434                                 <secondary>ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </secondary>\r
1435                         </indexterm>\r
1436                         <caution>ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS </caution>\r
1437                         <section xml:id="serversideinstallation-virtualized-virtualbox">\r
1438                                 <title>VirtualBox</title>\r
1439                                 <indexterm>\r
1440                                         <primary>ZZZ-REVIEW</primary>\r
1441                                         <secondary>ADD CONTENT FOR VirtualBox </secondary>\r
1442                                 </indexterm>\r
1443                                 <caution>ADD CONTENT FOR VirtualBox </caution>\r
1444                         </section>\r
1445                         <section xml:id="serversideinstallation-virtualized-vmware">\r
1446                                 <title>VMware</title>\r
1447                                 <indexterm>\r
1448                                         <primary>ZZZ-REVIEW</primary>\r
1449                                         <secondary>ADD CONTENT FOR VMware </secondary>\r
1450                                 </indexterm>\r
1451                                 <caution>ADD CONTENT FOR VMware </caution>\r
1452                         </section>\r
1453                         <section xml:id="serversideinstallation-virtualized-virtualpc">\r
1454                                 <title>VirtualPC</title>\r
1455                                 <indexterm>\r
1456                                         <primary>ZZZ-REVIEW</primary>\r
1457                                         <secondary>ADD CONTENT FOR VirtualPC </secondary>\r
1458                                 </indexterm>\r
1459                                 <caution>ADD CONTENT FOR VirtualPC </caution>\r
1460                         </section>\r
1461                 </section>\r
1462                 <section xml:id="serversideinstallation-previousversions">\r
1463                         <title>Installing Previous Versions of Evergreen</title>\r
1464                         <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>\r
1465                         <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.7</emphasis></emphasis>.</para>\r
1466                         <section xml:id="serversideinstallation-evergreen-previous">\r
1467                                 <title>Installing Evergreen 1.4.0.6 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>\r
1468                                 <para>This section outlines the installation process for the previous version 1.4.0.6 of Evergreen.</para>\r
1469                                 <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>\r
1470                                 <note>\r
1471                                         <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 <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server edition.</para>\r
1472                                         <para>If you are starting with a clean install of <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem>, you are strongly recommended <emphasis role="bold">not</emphasis> to install the packaged PostgreSQL server. This can confuse port numbers and system configuration. Evergreen 1.4 requires PostgreSQL 8.2.</para>\r
1473                                 </note>\r
1474                                 <section>\r
1475                                         <title>Installing OpenSRF 1.0.7</title>\r
1476                                         <para>Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see <xref linkend="serversideinstallation-opensrf-previous"/>.</para>\r
1477                                         <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>\r
1478                                 </section>\r
1479                                 <section>\r
1480                                         <title>Download and Unpack Evergreen Version 1.4.0.6</title>\r
1481                                         <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of Evergreen. The latest version can be found here: <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.4.0.6.tar.gz"></ulink></para>\r
1482                                         <figure>\r
1483                                                 <title>Commands to download and unpack Evergreen</title>\r
1484                                                 <screen>\r
1485                                                 $ su - opensrf\r
1486                                                 $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.4.0.6.tar.gz\r
1487                                                 $ tar zxf Evergreen-ILS-1.4.0.6.tar.gz\r
1488                                                 </screen>\r
1489                                         </figure>\r
1490                                         <para>The new directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.4.0.6</filename> will be created.</para>\r
1491                                 </section>\r
1492                                 <section>\r
1493                                         <title>Install Prerequisites to Build Evergreen</title>\r
1494                                         <para>In this section you will install and configure a set of prerequisites that will be used to build Evergreen. In a following step you will actually build the software using the <command>make</command> utility.</para>\r
1495                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[distribution]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-2-a">"Keywords"</link> figure below.</para>\r
1496                                         <figure>\r
1497                                                 <title>Commands to install prerequisites for Evergreen</title>\r
1498                                                 <screen>\r
1499                                                 $ su - root\r
1500                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6\r
1501                                                 $ make -f Open-ILS/src/extras/Makefile.install [distribution]\r
1502                                                 ...\r
1503                                                 </screen>\r
1504                                         </figure>\r
1505                                         <table xml:id="serversideinstallation-keywords-figure-2-a">\r
1506                                                 <title>Keywords Targets for <application>"make"</application> Command</title>\r
1507                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
1508                                                         <colspec colnum="1" colwidth="1.0*"/>\r
1509                                                         <colspec colnum="2" colwidth="3.0*"/>\r
1510                                                         <thead>\r
1511                                                                 <row>\r
1512                                                                         <entry>Keyword</entry>\r
1513                                                                         <entry>Description</entry>\r
1514                                                                 </row>\r
1515                                                         </thead>\r
1516                                                         <tbody>\r
1517                                                                 <row>\r
1518                                                                         <entry>debian-lenny</entry>\r
1519                                                                         <entry>for Debian Lenny (5.0)</entry>\r
1520                                                                 </row>\r
1521                                                                 <row>\r
1522                                                                         <entry>debian-etch</entry>\r
1523                                                                         <entry>for Debian Etch (4.0)</entry>\r
1524                                                                 </row>\r
1525                                                                 <row>\r
1526                                                                         <entry>ubuntu-intrepid</entry>\r
1527                                                                         <entry>for Ubuntu Intrepid (8.10)</entry>\r
1528                                                                 </row>\r
1529                                                                 <row>\r
1530                                                                         <entry>ubuntu-hardy</entry>\r
1531                                                                         <entry>for Ubuntu Hardy (8.04)</entry>\r
1532                                                                 </row>\r
1533                                                         </tbody>\r
1534                                                 </tgroup>\r
1535                                         </table>\r
1536                                 </section>\r
1537                                 <section>\r
1538                                         <title>Update the System Dynamic Library Path</title>\r
1539                                         <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/eg.conf</filename> containing two new library paths, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>\r
1540                                         <figure>\r
1541                                                 <title>Commands to modify system dynamic library path</title>\r
1542                                                 <screen>\r
1543                                                 $ su - root\r
1544                                                 $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE\r
1545                                                 /usr/local/lib\r
1546                                                 /usr/local/lib/dbd\r
1547                                                 ENDOFFILE\r
1548                                                 $ ldconfig\r
1549                                                 </screen>\r
1550                                         </figure>\r
1551                                 </section>\r
1552                                 <section>\r
1553                                         <title>Restart the PostgreSQL Server</title>\r
1554                                         <para>If PostgreSQL is running on the same system as the rest of Evergreen, as the <systemitem class="username">root</systemitem> user you must restart the PostgreSQL server to avoid a problem where the library <filename>plperl.so</filename> cannot be found. If your PostgreSQL server is running on another system, just skip this step.</para>\r
1555                                         <figure>\r
1556                                                 <title>Commands to restart PostgreSQL server</title>\r
1557                                                 <screen>\r
1558                                                 $ su - root\r
1559                                                 $ /etc/init.d/postgresql-8.2 restart\r
1560                                                 </screen>\r
1561                                         </figure>\r
1562                                 </section>\r
1563                                 <section>\r
1564                                         <title>Configure Evergreen</title>\r
1565                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to the Evergreen build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software:</para>\r
1566                                         <figure>\r
1567                                                 <title>Commands to configure Evergreen</title>\r
1568                                                 <screen>\r
1569                                                 $ su - opensrf\r
1570                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6\r
1571                                                 $ ./configure --prefix=/openils --sysconfdir=/openils/conf\r
1572                                                 $ make\r
1573                                                 ...\r
1574                                                 </screen>\r
1575                                         </figure>\r
1576                                 </section>\r
1577                                 <section>\r
1578                                         <title>Compile, Link and Install Evergreen</title>\r
1579                                         <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>\r
1580                                         <para>As the <systemitem class="username">root</systemitem> user, return to the Evergreen build directory and use the <command>make</command> utility as shown below. The Staff Client will also be automatically built, but you must remember to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the Staff Client you will use to connect to the Evergreen server.</para>\r
1581                                         <para>For further information on manually building the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>\r
1582                                         <figure>\r
1583                                                 <title>Commands to build, link and install Evergreen</title>\r
1584                                                 <screen>\r
1585                                                 $ su - root\r
1586                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6\r
1587                                                 $ make STAFF_CLIENT_BUILD_ID=rel_1_4_0_6 install\r
1588                                                 ...\r
1589                                                 </screen>\r
1590                                                 <para>The above commands will create a new subdirectory <filename class="directory">/openils/var/web/xul/rel_1_4_0_6</filename> containing the Staff Client.</para>\r
1591                                         </figure>\r
1592                                 </section>\r
1593                                 <section>\r
1594                                         <title>Copy the OpenSRF Configuration Files</title>\r
1595                                         <para>As the <systemitem class="username">root</systemitem> user, copy the example OpenSRF configuration files into place. This replaces the configuration files that you set up in a previous step when you installed and tested OpenSRF. You should also create backup copies of the old files for troubleshooting purposes. Finally, change the ownership on the installed files to the <systemitem class="username">opensrf</systemitem> user:</para>\r
1596                                         <figure>\r
1597                                                 <title>Commands to copy OpenSRF configuration files</title>\r
1598                                                 <screen>\r
1599                                                 $ su - root\r
1600                                                 $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml\r
1601                                                 $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml\r
1602                                                 $ chown -R opensrf:opensrf /openils/\r
1603                                                 </screen>\r
1604                                         </figure>\r
1605                                 </section>\r
1606                                 <section>\r
1607                                         <title>Create and Configure PostgreSQL Database</title>\r
1608                                         <para>As the <systemitem class="username">postgres</systemitem> user on your PostgreSQL server, create the Evergreen database.</para>\r
1609                                         <para>In the commands below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis> repository to match your PostgreSQL server layout. For example, if you built PostgreSQL from source the path would be <filename class="directory">/usr/local/share/contrib</filename>; if you installed the PostgreSQL 8.2 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>, the path would be <filename class="directory">/usr/share/postgresql/8.2/contrib/</filename>.</para>\r
1610                                         <procedure>\r
1611                                                 <step>\r
1612                                                         <para>\r
1613                                                                 <emphasis role="bold">Create and configure the database</emphasis>\r
1614                                                         </para>\r
1615                                                         <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>\r
1616                                                         <figure>\r
1617                                                                 <title>Commands to create database and adjust the path</title>\r
1618                                                                 <screen>\r
1619                                                                 # create the database\r
1620                                                                 $ su - postgres\r
1621                                                                 $ createdb -E UNICODE evergreen\r
1622                                                                 $ createlang plperl   evergreen\r
1623                                                                 $ createlang plperlu  evergreen\r
1624                                                                 $ createlang plpgsql  evergreen\r
1625                         \r
1626                                                                 # adjust the paths\r
1627                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen\r
1628                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen\r
1629                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen\r
1630                                                                 </screen>\r
1631                                                         </figure>\r
1632                                                         <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.2</literal>).</emphasis>\r
1633                                                 </step>\r
1634                                                 <step>\r
1635                                                         <para>\r
1636                                                                 <emphasis role="bold">Create new Evergreen superuser</emphasis>\r
1637                                                         </para>\r
1638                                                         <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system, create the \r
1639                                                         new database <systemitem class="username">evergreen</systemitem> user and assign a password:</para>\r
1640 <screen>\r
1641 # create superuser 'evergreen' and set the password\r
1642 <userinput>su - postgres</userinput>\r
1643 <userinput>createuser -P -s evergreen</userinput>\r
1644 <prompt>Enter password for new role:</prompt> <userinput>MYNEWPASSWORD</userinput>\r
1645 <prompt>Enter it again:</prompt><userinput>MYNEWPASSWORD</userinput>\r
1646 </screen>\r
1647                                                         <emphasis>Where <literal>MYNEWPASSWORD</literal> is the password chosen.</emphasis>\r
1648                                                 </step>\r
1649                                         </procedure>\r
1650                                 </section>\r
1651                                 <section>\r
1652                                         <title>Create Database Schema</title>\r
1653                                         <para>As the <systemitem class="username">root</systemitem> user, create the database schema and configure your system with the corresponding database authentication details for the <emphasis>evergreen</emphasis> database user that you created in the previous step.</para>\r
1654                                         <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>\r
1655                                         <figure>\r
1656                                                 <title>Commands to create Evergreen database schema</title>\r
1657                                                 <screen>\r
1658                                                 $ su - root\r
1659                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6\r
1660                                                 $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \\r
1661                                                         --service all --create-schema --create-bootstrap --create-offline \\r
1662                                                         --hostname HOSTNAME --port PORT \\r
1663                                                         --user evergreen --password PASSWORD --database DATABASENAME\r
1664                                                 </screen>\r
1665                                         </figure>\r
1666                                         <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>\r
1667                                         <note>\r
1668                                                 <para>\r
1669                                                         <emphasis>If you are entering the above command on a single line, do not include the <literal>\</literal> (backslash) characters. If you are using the <command>bash</command> shell, these should only be used at the end of a line at a bash prompt to indicate that the command is continued on the next line.</emphasis>\r
1670                                                 </para>\r
1671                                         </note>\r
1672                                 </section>\r
1673                                 <section>\r
1674                                         <title>Evergreen installation - (continued)</title>\r
1675                                         <para><emphasis>The remainder of the Evergreen installation procedure is identical to that for installing the latest version of Evergreen. Continue with the instructions found in</emphasis> <xref linkend="serversideinstallation-modify-apache"/>.</para>\r
1676                                 </section>\r
1677                         </section>\r
1678                         <section xml:id="serversideinstallation-opensrf-previous">\r
1679                                 <title>Installing OpenSRF 1.0.7 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>\r
1680                                 <para>This section describes the installation of the previous version of the Open Service Request Framework (OpenSRF), a major component of the Evergreen server-side software, on <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> systems. Evergreen software is integrated with and depends on the OpenSRF software system.</para>\r
1681                                 <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>\r
1682                                 <note>\r
1683                                         <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) platforms. OpenSRF 1.0.7 has been tested on <systemitem class="osname">Debian Etch (4.0)</systemitem>, <systemitem class="osname">Debian Lenny</systemitem>, <systemitem class="osname">Ubuntu Hardy Heron (8.04)</systemitem>, and <systemitem class="osname">Ubuntu Intrepid Ibex (8.10)</systemitem>.</para>\r
1684                                         <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>\r
1685                                         <itemizedlist>\r
1686                                                 <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
1687                                                 <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
1688                                         </itemizedlist>\r
1689                                         <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue the command <command>exit"</command>.</para>\r
1690                                 </note>\r
1691                                 <section>\r
1692                                         <title>Add the OpenSRF User</title>\r
1693                                         <para>As the <systemitem class="username">root</systemitem> user, add the opensrf user to the system. The default shell for the new user is automatically set to <command>/bin/bash</command> to inherit a reasonable environment:</para>\r
1694                                         <figure>\r
1695                                                 <title>Commands to add <systemitem class="username">opensrf</systemitem> user</title>\r
1696                                                 <screen>\r
1697                                         $ su - opensrf\r
1698                                         $ useradd -m -s /bin/bash opensrf\r
1699                                         $ passwd opensrf\r
1700                                         Enter new UNIX password: ******\r
1701                                         Retype new UNIX password: ******\r
1702                                         passwd: password updated successfully\r
1703                                         $\r
1704                                         </screen>\r
1705                                         </figure>\r
1706                                 </section>\r
1707                                 <section>\r
1708                                         <title>Download and Unpack Latest OpenSRF Version</title>\r
1709                                         <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of OpenSRF. The latest version can be found here: <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.0.7.tar.gz"></ulink></para>\r
1710                                         <figure>\r
1711                                                 <title>Commands to download and unpack OpenSRF</title>\r
1712                                                 <screen>\r
1713                                         $ su - opensrf\r
1714                                         $ wget http://evergreen-ils.org/downloads/OpenSRF-1.0.7.tar.gz\r
1715                                         $ tar zxf OpenSRF-1.0.7.tar.gz\r
1716                                         </screen>\r
1717                                         </figure>\r
1718                                         <para>The new directory <filename class="directory">/home/opensrf/OpenSRF-1.0.7</filename> will be created.</para>\r
1719                                 </section>\r
1720                                 <section>\r
1721                                         <title>Install Prerequisites to Build OpenSRF</title>\r
1722                                         <para>In this section you will install and configure a set of prerequisites that will be used to build OpenSRF. In a following step you will actually build the software using the <command>make</command> utility.</para>\r
1723                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-1a">"Keywords"</link> figure below.</para>\r
1724                                         <figure>\r
1725                                                 <title>Commands to install prerequisites for OpenSRF</title>\r
1726                                                 <screen>\r
1727                                         $ su - root\r
1728                                         $ cd /home/opensrf/OpenSRF-1.0.7\r
1729                                         $ make -f src/extras/Makefile.install [DISTRIBUTION]\r
1730                                         ...\r
1731                                         </screen>\r
1732                                         </figure>\r
1733                                         <table xml:id="serversideinstallation-keywords-figure-1a">\r
1734                                                 <title>Keywords Targets for <application>"make"</application> Command</title>\r
1735                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
1736                                                         <colspec colnum="1" colwidth="1.0*"/>\r
1737                                                         <colspec colnum="2" colwidth="3.0*"/>\r
1738                                                         <thead>\r
1739                                                                 <row>\r
1740                                                                         <entry>Keyword</entry>\r
1741                                                                         <entry>Description</entry>\r
1742                                                                 </row>\r
1743                                                         </thead>\r
1744                                                         <tbody>\r
1745                                                                 <row>\r
1746                                                                         <entry>debian-lenny</entry>\r
1747                                                                         <entry>for Debian Lenny (5.0)</entry>\r
1748                                                                 </row>\r
1749                                                                 <row>\r
1750                                                                         <entry>debian-etch</entry>\r
1751                                                                         <entry>for Debian Etch (4.0)</entry>\r
1752                                                                 </row>\r
1753                                                                 <row>\r
1754                                                                         <entry>ubuntu-intrepid</entry>\r
1755                                                                         <entry>for Intrepid (8.10)</entry>\r
1756                                                                 </row>\r
1757                                                                 <row>\r
1758                                                                         <entry>ubuntu-hardy</entry>\r
1759                                                                         <entry>for Ubuntu Hardy (8.04)</entry>\r
1760                                                                 </row>\r
1761                                                         </tbody>\r
1762                                                 </tgroup>\r
1763                                         </table>\r
1764                                         <para>This will install a number of packages on the system that are required by OpenSRF, including some Perl modules from CPAN. You can say <literal>No</literal> to the initial CPAN configuration prompt to allow it to automatically configure itself to download and install Perl modules from CPAN. The CPAN installer will ask you a number of times whether it should install prerequisite modules - say <literal>Yes</literal>.</para>\r
1765                                 </section>\r
1766                                 <section>\r
1767                                         <title>Configure OpenSRF</title>\r
1768                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to the OpenSRF build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software. You can include the  <option>--enable-python</option> and <option>--enable-java</option> configuration options if you wish to include support for Python and Java, respectively:</para>\r
1769                                         <figure>\r
1770                                                 <title>Commands to configure OpenSRF</title>\r
1771                                                 <screen>\r
1772                                         $ su - opensrf\r
1773                                         $ cd /home/opensrf/OpenSRF-1.0.7\r
1774                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf\r
1775                                         $ make\r
1776                                         ...\r
1777                                         </screen>\r
1778                                         </figure>\r
1779                                 </section>\r
1780                                 <section>\r
1781                                         <title>Compile, Link and Install OpenSRF</title>\r
1782                                         <para>As the <systemitem class="username">root</systemitem> user, return to the OpenSRF build directory and use the <command>make</command> utility to compile, link and install OpenSRF:</para>\r
1783                                         <figure>\r
1784                                                 <title>Commands to build, link and install OpenSRF</title>\r
1785                                                 <screen>\r
1786                                         $ su - opensrf\r
1787                                         $ cd /home/opensrf/OpenSRF-1.0.7\r
1788                                         $ make install\r
1789                                         ...\r
1790                                         </screen>\r
1791                                         </figure>\r
1792                                 </section>\r
1793                                 <section>\r
1794                                         <title>Update the System Dynamic Library Path</title>\r
1795                                         <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a new library path, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>\r
1796                                         <figure>\r
1797                                                 <title>Commands to modify system dynamic library path</title>\r
1798                                                 <screen>\r
1799                                         $ su - root\r
1800                                         $ echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf\r
1801                                         $ ldconfig\r
1802                                         </screen>\r
1803                                         </figure>\r
1804                                 </section>\r
1805                                 <section>\r
1806                                         <title>Define Public and Private OpenSRF Domains</title>\r
1807                                         <para>Define your public and private OpenSRF domains. For security purposes, OpenSRF uses Jabber domains to separate services into public and private realms. Throughout these instructions, we will use the example domains <systemitem class="domainname">public.localhost</systemitem> for the public domain and <systemitem class="domainname">private.localhost</systemitem> for the private domain. On a single-server system, the easiest way to define public and private domains is to define separate host names by adding entries to the file <filename>/etc/hosts</filename>.</para>\r
1808                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/hosts</filename> and add the following entries for our example domains:</para>\r
1809                                         <figure>\r
1810                                                 <title>Example public and private domains in /etc/hosts</title>\r
1811                                                 <screen>\r
1812                                         127.0.1.2       public.localhost        public\r
1813                                         127.0.1.3       private.localhost       private\r
1814                                         </screen>\r
1815                                         </figure>\r
1816                                 </section>\r
1817                                 <section>\r
1818                                         <title>Change File Ownerships</title>\r
1819                                         <para>As the <systemitem class="username">root</systemitem> user, change the ownership of files installed in the directory <filename class="directory">/openils</filename> to the <systemitem class="username">opensrf</systemitem> user:</para>\r
1820                                         <figure>\r
1821                                                 <title>Commands to change file ownerships</title>\r
1822                                                 <screen>\r
1823                                         $ chown -R opensrf:opensrf /openils\r
1824                                         </screen>\r
1825                                         </figure>\r
1826                                 </section>\r
1827                                 <section>\r
1828                                         <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>\r
1829                                         <para>As the <systemitem class="username">root</systemitem> user, stop the <systemitem class="service">ejabberd</systemitem> service:</para>\r
1830                                         <figure>\r
1831                                                 <title>Commands to stop the <systemitem class="service">ejabberd</systemitem> service</title>\r
1832                                                 <screen>\r
1833                                         $ /etc/init.d/ejabberd stop\r
1834                                         </screen>\r
1835                                         </figure>\r
1836                                         <para>If <systemitem class="service">ejabberd</systemitem> reports that it is already stopped, it may have run into a problem starting back at the installation stage. One possible fix is to kill any remaining <systemitem class="daemon">beam</systemitem> and <systemitem class="daemon">epmd</systemitem> processes, then edit the configuration file <filename>/etc/ejabberd/ejabberd.cfg</filename> to hardcode a domain:</para>\r
1837                                         <figure>\r
1838                                                 <title>Commands to recover from <systemitem class="service">ejabberd</systemitem> errors</title>\r
1839                                                 <screen>\r
1840                                         $ su - root\r
1841                                         $ epmd -kill\r
1842                                         $ killall beam; killall beam.smp\r
1843                                         $ rm /var/lib/ejabberd/*\r
1844                                         $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd\r
1845                                         </screen>\r
1846                                         </figure>\r
1847                                 </section>\r
1848                                 <section>\r
1849                                         <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>\r
1850                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>\r
1851                                         <itemizedlist>\r
1852                                                 <listitem>Change <literal>{hosts, ["localhost"]}.</literal> to <literal>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</literal></listitem>\r
1853                                                 <listitem>Change <literal>{max_user_sessions, 10}.</literal> to <literal>{max_user_sessions, 1000}.</literal> If you see something like this instead: <literal>{access, max_user_sessions, [{10, all}]}.</literal>, then change it to <literal>{access, max_user_sessions, [{1000, all}]}.</literal></listitem>\r
1854                                                 <listitem>Change all three occurrences of <literal>max_stanza_size</literal> to <literal>2000000</literal>.</listitem>\r
1855                                                 <listitem>Change both occurrences of <literal>maxrate</literal> to <literal>500000</literal>.</listitem>\r
1856                                                 <listitem>Comment out the line <literal>{mod_offline, []}</literal> by placing two <literal>%</literal> comment signs in front.</listitem>\r
1857                                         </itemizedlist>\r
1858                                 </section>\r
1859                                 <section>\r
1860                                         <title>OpenSRF installation - (continued)</title>\r
1861                                         <para>\r
1862                                                 <emphasis>The remainder of the OpenSRF installation procedure is identical to that for installing the latest version of OpenSRF. Continue with the instructions found in <xref linkend="serversideinstallation-opensrf-continued"/>.</emphasis>\r
1863                                         </para>\r
1864                                 </section>\r
1865                         </section>\r
1866                 </section>\r
1867                 <section xml:id="serversideinstallation-postgresql">\r
1868                         <title>Installing PostgreSQL</title>\r
1869                         <para>In production Evergreen systems, the PostgreSQL database server may reside on the same system on which Evergreen is installed or on another standalone system so, by default, PostgreSQL is not automatically installed along with Evergreen. This section details the steps needed to manually install PostgreSQL on a <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> system.</para>\r
1870                         <para>If your PostgreSQL server will be on the same system as your Evergreen software, return to the previous section <xref linkend="serversideinstallation-postgresql-default"/> and follow those instructions. Otherwise, to manually install PostgreSQL on a system, continue with the instructions below.</para>\r
1871                         <note>\r
1872                                 <para>Some <systemitem class="osname">Linux</systemitem> distributions, such as <systemitem class="osname">Debian Etch (4.0)</systemitem>, do not offer PostgreSQL version 8.2 as an installable package. Before you continue, examine the software dependencies listed in <xref linkend="serversideinstall-software-dependencies"/> to ensure that your Linux distribution supports the required version of PostgreSQL.</para>\r
1873                         </note>\r
1874                         <procedure>\r
1875                                 <step>\r
1876                                         <para>Install the application <application>"stow"</application> on your system if it is not already installed. Issue the following command as the <systemitem class="username">root</systemitem> user:</para>\r
1877                                         <figure>\r
1878                                                 <title>Installing <application>"stow"</application></title>\r
1879                                                 <screen>\r
1880                                                 $ apt-get install stow\r
1881                                                 ...\r
1882                                                 </screen>\r
1883                                         </figure>\r
1884                                 </step>\r
1885                                 <step>\r
1886                                         <para>Download, compile, and install the latest release for PostgreSQL 8.2 (which was version <literal>8.2.12</literal> at the time of this writing). As the <systemitem class="username">root</systemitem> user, follow these steps:</para>\r
1887                                         <figure>\r
1888                                                 <title>Installing PostgreSQL</title>\r
1889                                                 <screen>\r
1890                                                 $ wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.2.17/postgresql-8.2.17.tar.bz2\r
1891                                                 $ tar xzf postgresql-8.2.17.tar.gz\r
1892                                                 $ cd postgresql-8.2.17\r
1893                                                 $ ./configure --with-perl --enable-integer-datetimes --with-openssl --prefix=/usr/local/stow/pgsql\r
1894                                                 ...\r
1895                                                 $ make\r
1896                                                 ...\r
1897                                                 $ make install\r
1898                                                 ...\r
1899                                                 $ cd contrib\r
1900                                                 $ make\r
1901                                                 ...\r
1902                                                 $ make install\r
1903                                                 $ cd xml2\r
1904                                                 $ make\r
1905                                                 ...\r
1906                                                 $ make install\r
1907                                                 $ cd /usr/local/stow\r
1908                                                 $ stow pgsql\r
1909                                                 </screen>\r
1910                                         </figure>\r
1911                                 </step>\r
1912                                 <step>\r
1913                                         <para>Create the new user <systemitem class="username">postgres</systemitem> to run the PostgreSQL processes. As the <systemitem class="username">root</systemitem> user, execute this command:</para>\r
1914                                         <figure>\r
1915                                                 <title>Adding <systemitem class="username">postgres</systemitem></title>\r
1916                                                 <screen>\r
1917                                                 $ adduser postgres\r
1918                                                 </screen>\r
1919                                         </figure>\r
1920                                 </step>\r
1921                                 <step>\r
1922                                         <para>Initialize the database directory and start up PostgreSQL. As the <systemitem class="username">root</systemitem> user, follow these steps:</para>\r
1923                                         <figure>\r
1924                                                 <title>Adding <systemitem class="username">postgres</systemitem></title>\r
1925                                                 <screen>\r
1926                                                 $ mkdir -p /usr/local/pgsql/data\r
1927                                                 $ chown postgres /usr/local/pgsql/data\r
1928                                                 $ su - postgres\r
1929                                                 $ initdb -D /usr/local/pgsql/data -E UNICODE --locale=C\r
1930                                                 $ pg_ctl -D /usr/local/pgsql/data -l /home/postgres/logfile start\r
1931                                                 </screen>\r
1932                                         </figure>\r
1933                                         <note>\r
1934                                                 <para>If an error occurs during the final step above, review the path of the home directory for the <systemitem class="username">postgres</systemitem> user. It may be <literal>/var/lib/postresql</literal> instead of <literal>/home/postres</literal>.</para>\r
1935                                         </note>\r
1936                                 </step>\r
1937                                 <step>\r
1938                                         <para>The values of several PostreSQL configuration parameters may be changed for enhanced performance. The following table lists the default values and some suggested updates for several useful parameters:</para>\r
1939                                         <table>\r
1940                                                 <title>Suggested configuration values</title>\r
1941                                                 <tgroup align="left" cols="3" colsep="1" rowsep="1">\r
1942                                                         <colspec colnum="1" colwidth="1.0*"/>\r
1943                                                         <colspec colnum="2" colwidth="1.0*"/>\r
1944                                                         <colspec colnum="3" colwidth="1.0*"/>\r
1945                                                         <thead>\r
1946                                                                 <row>\r
1947                                                                         <entry>Parameter</entry>\r
1948                                                                         <entry>Default</entry>\r
1949                                                                         <entry>Suggested</entry>\r
1950                                                                 </row>\r
1951                                                         </thead>\r
1952                                                         <tbody>\r
1953                                                                 <row>\r
1954                                                                         <entry>default_statistics_target</entry>\r
1955                                                                         <entry>10</entry>\r
1956                                                                         <entry>100</entry>\r
1957                                                                 </row>\r
1958                                                                 <row>\r
1959                                                                         <entry>work_mem</entry>\r
1960                                                                         <entry>4Mb</entry>\r
1961                                                                         <entry>128Mb</entry>\r
1962                                                                 </row>\r
1963                                                                 <row>\r
1964                                                                         <entry>shared_buffers</entry>\r
1965                                                                         <entry>8Mb</entry>\r
1966                                                                         <entry>512Mb</entry>\r
1967                                                                 </row>\r
1968                                                                 <row>\r
1969                                                                         <entry>effective_cache_size</entry>\r
1970                                                                         <entry>128Mb</entry>\r
1971                                                                         <entry>4Gb</entry>\r
1972                                                                 </row>\r
1973                                                         </tbody>\r
1974                                                 </tgroup>\r
1975                                         </table>\r
1976                                         <indexterm>\r
1977                                                 <primary>ZZZ-REVIEW</primary>\r
1978                                                 <secondary>ADD CONTENT ON HOW TO UPDATE POSTRESQL PARAMETERS</secondary>\r
1979                                         </indexterm>\r
1980                                         <caution>ADD CONTENT ON HOW TO UPDATE POSTRESQL PARAMETERS </caution>\r
1981                                 </step>\r
1982                         </procedure>\r
1983                 </section>\r
1984                 <section xml:id="serversideinstallation-apache">\r
1985                         <title>Installing Apache</title>\r
1986                         <section>\r
1987                                 <title>Securing Apache (httpd)</title>\r
1988                                 <para>The main consideration is to secure the directory <filename class="directory">cgi-bin</filename>. The only persons that need access to this directory are Evergreen system administrators. This directory should be restricted by both IP (to those workstations designated as Evergeen Administration systems), and by username/password.</para>\r
1989                                 <indexterm>\r
1990                                         <primary>ZZZ-REVIEW</primary>\r
1991                                         <secondary>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </secondary>\r
1992                                 </indexterm>\r
1993                                 <caution>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </caution>\r
1994                                 <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>\r
1995                         </section>\r
1996                         <indexterm>\r
1997                                 <primary>ZZZ-REVIEW</primary>\r
1998                                 <secondary>ADD MORE CONTENT FOR APACHE </secondary>\r
1999                         </indexterm>\r
2000                         <caution>ADD MORE CONTENT FOR APACHE </caution>\r
2001                 </section>\r
2002         </section>\r
2003         <section>\r
2004                 <title>Installing the Staff Client</title>\r
2005                 <para>You can install the Staff Client from pre-built images and packages without actually having to first build it. Pre-built packages are currently available for <systemitem class="osname">Windows</systemitem>, <systemitem class="osname">Mac OS X</systemitem>, and <systemitem class="osname">Linux</systemitem>. If you need to manually build the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>\r
2006                 <section xml:id="serversideinstallation-prebuilt-staffclient">\r
2007                         <title>Installing a Pre-Built Staff Client</title>\r
2008                         <para>This section reviews the process of installing pre-built versions of the Staff Client in various environments.</para>\r
2009                         <section>\r
2010                                 <title>Installing on <systemitem class="osname">Windows</systemitem></title>\r
2011                                 <para>A standard <systemitem class="osname">Windows</systemitem> installer that contains the current version of the Staff Client is available from the downloads section of the Evergreen website at <ulink url="http://www.evergreen-ils.org/downloads.php">http://www.evergreen-ils.org/downloads.php</ulink>. Download the Staff Client installer, then run it. A screen that looks similar to this should appear:</para>\r
2012                                 <figure>\r
2013                                         <title>Running the Staff Client installer</title>\r
2014                                         <mediaobject>\r
2015                                                 <imageobject>\r
2016                                                         <imagedata fileref="../media/serversideinstallation-staffclient-1.png" scalefit="1" width="70%"/>\r
2017                                                 </imageobject>\r
2018                                         </mediaobject>\r
2019                                 </figure>\r
2020                                 <para>Click <guibutton>Next</guibutton> to continue through the guided install process. The install wizard will ask you to agree to the end-user license, ask you where to install the software, ask about where to place icons, and then will install the software on your workstation.</para>\r
2021                                 <para>When you run the Staff Client for the first time, a screen similar to this should appear:</para>\r
2022                                 <figure>\r
2023                                         <title>Running the Staff Client for the first time</title>\r
2024                                         <mediaobject>\r
2025                                                 <imageobject>\r
2026                                                         <imagedata fileref="../media/serversideinstallation-staffclient-2.png" scalefit="1" width="70%"/>\r
2027                                                 </imageobject>\r
2028                                         </mediaobject>\r
2029                                 </figure>\r
2030                                 <para>First, configure the server you would like to connect to in the <emphasis role="bold">Server</emphasis> section. For example, the PINES demo system is <systemitem class="domain">demo.gapines.org</systemitem>. After selecting a server, click <guibutton>Re-Test Server</guibutton>.</para>\r
2031                                 <para>Because this is the initial run of the Staff Client, the <emphasis role="bold">Workstation</emphasis> section in the upper-right states: <emphasis role="bold">Not yet configured for the specified server</emphasis>. The first thing that must be done to the Staff Client on every workstation is to assign it a workstation name. This is covered in <xref linkend="serversideinstallation-workstationnames"/>.</para>\r
2032                         </section>\r
2033                         <section>\r
2034                                 <title>Installing on <systemitem class="osname">Mac OS X</systemitem></title>\r
2035                                 <para>A <systemitem class="osname">Mac OS X</systemitem> package that contains the current version of the Staff Client is available for use with <application>"xulrunner"</application>.</para>\r
2036                                 <section>\r
2037                                         <title>Evergreen Indiana Pkg file [Evergreen v1.2.3.0]</title>\r
2038                                         <procedure>\r
2039                                                 <step>Download and install the latest version of <application>"xulrunner"</application> for <systemitem class="osname">Mac OS X</systemitem>. Release notes for the latest version can be found here: <ulink url="http://developer.mozilla.org/en/docs/XULRunner_1.8.0.4_Release_Notes">http://developer.mozilla.org/en/docs/XULRunner_1.8.0.4_Release_Notes</ulink>. Note, later versions may not work correctly.</step>\r
2040                                                 <step>Download and install the <systemitem class="osname">Mac OS X</systemitem> Installation package for the 1_2_3_0 Version Staff Client from <ulink url="http://evergreen.lib.in.us/opac/extras/files/evergreen_osx_staff_client_1_2_3.zip">http://evergreen.lib.in.us/opac/extras/files/evergreen_osx_staff_client_1_2_3.zip</ulink>.</step>\r
2041                                                 <step>To upgrade to a more recent version of the Staff Client, you can copy the directory <emphasis>build</emphasis> from a working <systemitem class="osname">Windows</systemitem> installation of the desired version of the Staff Client to your Mac. The required files may be located in a directory like this on the <systemitem class="osname">Windows</systemitem> machine: <filename class="directory">C:\Program Files\Evergreen Staff Client\build</filename>. Copy these files into the folder <filename class="directory">Resources</filename> within the Open-ILS package in your Applications directory on the Mac, overwriting files with the same names.</step>\r
2042                                                 <step>Drag the application's icon into your toolbar for easier access.</step>\r
2043                                         </procedure>\r
2044                                         <para/>\r
2045                                         <para>When you run the Staff Client installer, a screen will appear that looks similar to this:</para>\r
2046                                         <figure>\r
2047                                                 <title>Running the Staff Client installer</title>\r
2048                                                 <mediaobject>\r
2049                                                         <imageobject>\r
2050                                                                 <imagedata fileref="../media/serversideinstallation-staffclient-3.png" scalefit="1" width="20%"/>\r
2051                                                         </imageobject>\r
2052                                                 </mediaobject>\r
2053                                         </figure>\r
2054                                         <caution> FIX BAD LINK: http://es.zionsville.lib.in.us/atheos/eg_osx_a.gif </caution>\r
2055                                         <para>Click <guibutton>Continue</guibutton>, accept the license, then finish the installation. The application will be located at the destination you selected during installation. You will then be able to drag the application into your toolbar for easier access.</para>\r
2056                                         <figure>\r
2057                                                 <title>Finishing the installation</title>\r
2058                                                 <mediaobject>\r
2059                                                         <imageobject>\r
2060                                                                 <imagedata fileref="../media/serversideinstallation-staffclient-4.png" scalefit="1" width="20%"/>\r
2061                                                         </imageobject>\r
2062                                                 </mediaobject>\r
2063                                         </figure>\r
2064                                         <caution> FIX BAD LINK: http://es.zionsville.lib.in.us/atheos/eg_osx_a.gif </caution>\r
2065                                 </section>\r
2066                                 <section>\r
2067                                         <title>Running directly using <application>"xulrunner"</application></title>\r
2068                                         <para>You must install an appropriate version of <application>"xulrunner"</application> to match the Evergreen version. See the following table for the recommended version of <application>"xulrunner"</application>:</para>\r
2069                                         <table>\r
2070                                                 <title>Evergreen / XULRunner Dependencies</title>\r
2071                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
2072                                                         <colspec colnum="1" colwidth="1.0*"/>\r
2073                                                         <colspec colnum="2" colwidth="3.0*"/>\r
2074                                                         <tbody>\r
2075                                                                 <row>\r
2076                                                                         <entry>Evergreen 1.6.x.x</entry>\r
2077                                                                         <entry>XULrunner 1.9</entry>\r
2078                                                                 </row>\r
2079                                                                 <row>\r
2080                                                                         <entry>Evergreen 1.4.x.x</entry>\r
2081                                                                         <entry>XULrunner 1.8.0.4 or XULrunner 1.8.0.3</entry>\r
2082                                                                 </row>\r
2083                                                                 <row>\r
2084                                                                         <entry>Evergreen 1.2.x.x</entry>\r
2085                                                                         <entry>XULrunner 1.8.0.4 or XULrunner 1.8.0.3</entry>\r
2086                                                                 </row>\r
2087                                                         </tbody>\r
2088                                                 </tgroup>\r
2089                                         </table>\r
2090                                         <note>If you have issues removing previously installed <application>"xulrunner"</application> versions see <xref linkend="serversideinstallation-staffclient-remove-xulrunner"/> for information on removing previous <application>"XULRunner"</application> versions.</note>\r
2091                                         <para>The Staff Client data from the directory <filename class="directory">./staff_client/build</filename> must be placed somewhere on the machine (e.g. <emphasis>~/Desktop/Evergreen_Staff_Client</emphasis>). Remember to call <application>"XULRunner"</application> with the full path to the binary, followed by the install command and the path to the client data. See the following command:</para>\r
2092                                         <figure>\r
2093                                                 <title>Executing <application>"xulrunner"</application></title>\r
2094                                                 <screen>\r
2095                                                 /Library/Frameworks/XUL.framework/xulrunner-bin --install-app ~/Desktop/Evergreen_Staff_Client\r
2096                                                 </screen>\r
2097                                         </figure>\r
2098                                         <para>This command should exit quietly. A folder will be created, named <emphasis>/Applications/OpenILS</emphasis>, containing a launcher named <emphasis>open_ils_staff_client</emphasis>.</para>\r
2099                                 </section>\r
2100                                 <section xml:id="serversideinstallation-staffclient-remove-xulrunner">\r
2101                                         <title>Removing previously installed <application>"xulrunner"</application> versions</title>\r
2102                                         <para>If you already have a newer version installed, per the release notes, you will need to remove the entire directory <filename class="directory">/Library/Frameworks/XUL.framework</filename> before downgrading.</para>\r
2103                                         <para>In addition, you may also need to remove the previous file <filename>/Library/Receipts/xulrunner-ver-mak.pkg</filename>.</para>\r
2104                                         <para>If there is no file <filename>/Library/Receipts/xulrunner-ver-mak.pkg</filename> (possibly in newer OSX releases) you need to flush the file <emphasis>receiptdb</emphasis>.</para>\r
2105                                         <note>If you install a newer version over a previous (older) install, the older one is not removed but the symlinks get changed to the newer one.</note>\r
2106                                         <para>First, get the package identifier, then purge/forget the build that was initially installed:</para>\r
2107                                         <figure>\r
2108                                                 <title>Purging previous build</title>\r
2109                                                 <screen>\r
2110                                                 sudo pkgutil --pkgs > /tmp/pkgs.txt\r
2111                                                 sudo pkgutil --forget org.mozilla.xulrunner\r
2112                                                 </screen>\r
2113                                         </figure>\r
2114                                         <note>It may not be necessary to edit the file <filename>/Library/Receipts/InstallHistory.plist</filename> after deleting the folder <emphasis>XUL.framework</emphasis>.</note>\r
2115                                 </section>\r
2116                                 <section>\r
2117                                         <title>Creating an APP file: Staff Client &amp; <application>"xulrunner"</application> Bundled</title>\r
2118                                         <para>An APP file is basically a folder. Start with a folder structure like this:</para>\r
2119                                         <figure>\r
2120                                                 <title>Sample APP file folder structure</title>\r
2121                                                 <screen>\r
2122                                                 * Evergreen.app\r
2123                                                   * Contents\r
2124                                                     * Frameworks\r
2125                                                     * Resources\r
2126                                                     * MacOS\r
2127                                                 </screen>\r
2128                                         </figure>\r
2129                                         <para>Create an APP folder structure with the following commands:</para>\r
2130                                         <figure>\r
2131                                                 <title>Creating a folder structure</title>\r
2132                                                 <screen>\r
2133                                                 mkdir -p Evergreen.app/Contents/Frameworks\r
2134                                                 mkdir -p Evergreen.app/Contents/Resources\r
2135                                                 mkdir -p Evergreen.app/Contents/MacOS\r
2136                                                 </screen>\r
2137                                         </figure>\r
2138                                         <para/>\r
2139                                         <procedure>\r
2140                                                 <step>\r
2141                                                         <para>Create a new file in the folder <emphasis>Evergreen.app/Contents/Info.plist</emphasis> containing the following data (adjust for your version of Evergreen):</para>\r
2142                                                         \r
2143                                                                 \r
2144 <programlisting language="xml"><![CDATA[\r
2145 <?xml version="1.0" encoding="UTF-8"?>\r
2146 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\r
2147 <plist version="1.0">\r
2148 <dict>\r
2149         <key>CFBundleExecutable</key>\r
2150         <string>xulrunner</string>\r
2151         <key>CFBundleGetInfoString</key>\r
2152         <string>OpenILS open_ils_staff_client rel_1_6_0_7</string>\r
2153         <key>CFBundleInfoDictionaryVersion</key>\r
2154         <string>6.0</string>\r
2155         <key>CFBundleName</key>\r
2156         <string>Evergreen Staff Client</string>\r
2157         <key>CFBundlePackageType</key>\r
2158         <string>APPL</string>\r
2159         <key>CFBundleShortVersionString</key>\r
2160         <string>rel_1_6_0_7</string>\r
2161         <key>CFBundleVersion</key>\r
2162         <string>rel_1_6_0_7.rel_1_6_0_7</string>\r
2163         <key>NSAppleScriptEnabled</key>\r
2164         <true/>\r
2165         <key>CFBundleTypeIconFile</key>\r
2166         <string>Evergreen.icns</string>\r
2167 </dict>\r
2168 </plist>\r
2169 ]]></programlisting>\r
2170                                                         \r
2171                                                 </step>\r
2172                                                 <step>Download and install an appropriate <systemitem class="osname">Mac OS X</systemitem>package of <application>"XULRunner"</application> from \r
2173                                                 the Mozilla website (see above for recommendations).</step>\r
2174                                                 <step>\r
2175                                                         <para>Make a copy of <emphasis>/Library/Frameworks/XUL.Framework</emphasis> inside your APP file. It should look something like this:</para>\r
2176                                                         \r
2177 <screen>\r
2178 * Evergreen.app/\r
2179 __* Contents/\r
2180 ____* Frameworks/\r
2181 ______* XUL.Framework/\r
2182 ______* Versions/\r
2183 ________* Current -> 1.9.1.3 (symlink)\r
2184 ________* 1.9.1.3/\r
2185 ______* XUL -> Versions/Current/XUL\r
2186 ______* libxpcom.dylib -> Versions/Current/libxpcom.dylib\r
2187 ______* xulrunner-bin -> Versions/Current/xulrunner-bin\r
2188 </screen>\r
2189                                                 </step>\r
2190                                                 <step>Copy <emphasis>XUL.Framework/Versions/Current/xulrunner</emphasis> into <emphasis>Evergreen.app/MacOS</emphasis> \r
2191                                                 (do not symlink; copy the file).</step>\r
2192                                                 <step>\r
2193                                                         <para>Make <emphasis>Evergreen.app/Resources</emphasis> the root of your Evergreen application files like this:</para>\r
2194                                                         <figure>\r
2195                                                                 <title>Example APP file</title>\r
2196                                                                 <screen>\r
2197                                                                 * Evergreen.app/\r
2198                                                                 __* Contents/\r
2199                                                                 ____* Resources/\r
2200                                                                 ______* BUILD_ID\r
2201                                                                 ______* application.ini\r
2202                                                                 ______* chrome/\r
2203                                                                 ______* components/\r
2204                                                                 ______* etc.\r
2205                                                                 </screen>\r
2206                                                         </figure>\r
2207                                                 </step>\r
2208                                                 <step>Put a <systemitem class="osname">Mac</systemitem> format icon file named <emphasis>Evergreen.icns</emphasis> in Resources.</step>\r
2209                                         </procedure>\r
2210                                 </section>\r
2211                         </section>\r
2212                         <section xml:id="serversideinstallation-staffclient">\r
2213                                 <title>Installing on <systemitem class="osname">Linux</systemitem></title>\r
2214                                 <section>\r
2215                                         <title>Quick Upgrade of the Staff Client</title>\r
2216                                         <para>A <systemitem class="osname">Linux</systemitem> Staff Client is automatically built on the server as part of the normal \r
2217                                         <emphasis>make install</emphasis> process for Evergreen server-side software. To upgrade the Staff Client on a remote workstation with a new version, \r
2218                                         just copy the directory tree containing the Staff Client from the server to the remote workstation.</para>\r
2219                                         <para>The following example assumes you already have an <systemitem class="username">opensrf</systemitem> user account on both the server and the \r
2220                                         remote workstation. Remember to replace <literal>user</literal>, <literal>client.linux.machine</literal> and <literal>eg-client-x.x.x.x</literal> with \r
2221                                         the proper user name, client machine name, and \r
2222                                         version number in the following example.</para>\r
2223                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then recursively copy \r
2224                                         the entire directory tree to the remote workstation:</para>                     \r
2225 <screen>\r
2226 <userinput>su - opensrf</userinput>\r
2227 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2228 <userinput>scp -r build user@client.linux.machine:~/eg-client-x.x.x.x/</userinput>\r
2229 </screen>\r
2230                                         <para>To test the newly copied Staff Client, as the <systemitem class="username">opensrf</systemitem> user log into the remote workstation and execute \r
2231                                         it as shown:</para>                             \r
2232 <screen>\r
2233 <userinput>su - opensrf</userinput>\r
2234 <userinput>xulrunner ~/eg-client-x.x.x.x/build/application.ini</userinput>\r
2235 </screen>\r
2236                                         \r
2237                                 </section>\r
2238                                 <section>\r
2239                                         <title>Building the Staff Client on the Server</title>\r
2240                                         <para>A <systemitem class="osname">Linux</systemitem> Staff Client is automatically built on the server as part of the normal \r
2241                                         <emphasis>make install</emphasis> process for Evergreen server-side software.</para>\r
2242                                         <para>In order to install a compatible Staff Client on another <systemitem class="osname">Linux</systemitem> system, just copy the applicable files from \r
2243                                         the server to that system, or even manually build it on that system. Ensure that the BUILD_ID you choose on the server matches the BUILD_ID for each Staff \r
2244                                         Client you use on other systems.</para>\r
2245                                         <para>If you will be using a pre-packaged <systemitem class="osname">Windows</systemitem> version on some systems, you may want to choose the BUILD_ID  \r
2246                                         on both server and other versions to match that of the <systemitem class="osname">Windows</systemitem> Staff Client. To determine which BUILD_ID is used \r
2247                                         in an existing Staff Client installation, just click <guibutton>About this Client</guibutton> on the running Staff Client.</para>\r
2248                                         <para>If you are allowed to make changes on the Evergreen server, another option is to create a symbolic link. In order for a copy of the Staff Client and \r
2249                                         server to work together, the BUILD_ID must match the name of the directory containing the server components of the Staff Client, or the name of a symbolic \r
2250                                         link to that directory.</para>\r
2251 <screen>\r
2252 <userinput>su - root</userinput>\r
2253 <userinput>cd /openils/var/web/xul</userinput>\r
2254 <userinput>ln -s SERVER_BUILD_ID/ CLIENT_BUILD_ID</userinput>\r
2255 </screen>       \r
2256                                 </section>\r
2257                                 <section>\r
2258                                         <title>Building the Staff Client on the client Machine</title>\r
2259                                         <para>This section is directed toward end-users who wish to use <systemitem class="osname">Linux</systemitem> rather than \r
2260                                         <systemitem class="osname">Windows</systemitem> for client machines, but have limited <systemitem class="osname">Linux</systemitem> experience. You can \r
2261                                         build the Staff Client on a <systemitem class="osname">Linux</systemitem> system without installing the Evergreen Server component. This is a relatively \r
2262                                         simple process compared to server installation, but does require some command-line work. The following directions are for building Staff Client version \r
2263                                         1.2.1.4 on <systemitem class="osname">Kubuntu 7.10</systemitem>; you must modify them for other distributions (the instructions should work as-is for \r
2264                                         <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> derivatives).</para>\r
2265                                         <procedure>\r
2266                                                 <step>\r
2267                                                         <para>Prerequisites</para>\r
2268                                                         <para>Both <application>"subversion"</application> and <application>"xulrunner"</application> are required to build the Staff Client.\r
2269                                                         As the <systemitem class="username">root</systemitem> user, use <application>"apt-get"</application> to install packages \r
2270                                                         for <application>"subversion"</application> and <application>"xulrunner"</application>. You can also use <application>"synaptic"</application>, \r
2271                                                         the graphical user interface for <application>"apt-get"</application>. For <application>"subversion"</application>, select the latest \r
2272                                                         version; for <application>"xulrunner"</application>, select version <emphasis>1.8.1.4-2ubuntu5</emphasis>.</para>\r
2273                                                         \r
2274 <screen>\r
2275 <userinput>sudo apt-get install subversion</userinput>\r
2276 <userinput>sudo apt-get install xulrunner</userinput>\r
2277 </screen>\r
2278                                                 </step>\r
2279                                                 <step>\r
2280                                                         <para>Download the Source Code</para>\r
2281                                                         <itemizedlist>\r
2282                                                                 <listitem>\r
2283                                                                         <para>Determine which version is needed</para>\r
2284                                                                         <para>For most end-users, a specific version is required to communicate properly with the Evergreen server. Check with your system administrator, IT person, or HelpDesk to determine which Staff Client versions are supported.</para>\r
2285                                                                         <para>Next, you need to determine which <emphasis>tag</emphasis> to use when downloading the source code. Tags are markers in the source code to create a snapshot of the code as it existed at a certain time; tags usually point to tested and stable code, or at least a community-recognized release version.</para>\r
2286                                                                         <para>To determine which tag to use, browse to <ulink url="http://svn.open-ils.org/trac/ILS/browser">http://svn.open-ils.org/trac/ILS/browser</ulink>. Look in the <guibutton>Visit</guibutton> drop-down box; see the list of Branches and, further down, a list of Tags. You may have to do some guesswork, but it is fairly straightforward to determine which tag to use. If the server is version 1.2.1.4, you will want to use the tag that looks most appropriate. For example, as you look through the tag list, notice the tag named 'rel_1_2_1_4'. This is the tag you need; make a note of it for the next step.</para>\r
2287                                                                 </listitem>\r
2288                                                                 <listitem>\r
2289                                                                         <para>Download the Code</para>\r
2290                                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, open a terminal (command-line prompt) and navigate to the directory in which you wish to download the Staff Client. Use the following commands to download the proper version of the source code by tag name:</para>\r
2291                                                                         \r
2292 <screen>\r
2293 <userinput>su - opensrf</userinput>\r
2294 <userinput>cd /YOUR/DOWNLOAD/DIRECTORY</userinput>\r
2295 <userinput>svn co svn://svn.open-ils.org/ILS/tags/rel_1_2_1_4/</userinput>\r
2296 </screen>\r
2297                                                                         <para>Remember to change <literal>rel_1_2_1_4</literal> to the appropriate tag for your installation.</para>\r
2298                                                                 </listitem>\r
2299                                                         </itemizedlist>\r
2300                                                 </step>\r
2301                                                 <step>\r
2302                                                         <para>Build the Staff Client</para>\r
2303                                                         <section>\r
2304                                                                 <title>Evergreen 1.2.x</title>\r
2305                                                                 <para>In the following example, navigate to the directory in which the source code was downloaded, then navigate to the proper subdirectory and run the <command>make</command> utility to actually build the Staff Client. Remember to check with your system administrator about which Staff Client BUILD_ID to use. The server checks the Staff Client BUILD_ID against itself to determine whether or not a connecting client is supported. For instance, for the PINES installation (version 1.2.1.4) the supported BUILD_ID is <literal>rel_1_2_1_4</literal>. Modify the following commands accordingly.</para>\r
2306                                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands to build the Staff \r
2307                                                                 Client:</para>                                                  \r
2308 <screen>\r
2309 <userinput>su - opensrf</userinput>\r
2310 <userinput>cd /YOUR/DOWNLOAD/DIRECTORY</userinput>\r
2311 <userinput>cd Open-ILS/xul/staff_client</userinput>\r
2312 <userinput>make STAFF_CLIENT_BUILD_ID='rel_1_2_1_4'</userinput>\r
2313 ...\r
2314 </screen>\r
2315                                                         </section>\r
2316                                                         <section>\r
2317                                                                 <title>Evergreen 1.4.x</title>\r
2318                                                                 <para>The 1.4 series of Evergreen has complicated the build process for the Staff Client a bit. If you downloaded a .tar.gz (compressed tar archive) of Evergreen, then your steps will resemble the following:</para>\r
2319                                                                 <caution>FIXME -- Need instructions for getting certain Javascript files from OpenSRF, preferably without actually installing OpenSRF.\r
2320 </caution>                                                      \r
2321 <screen>\r
2322 <userinput>su - opensrf</userinput>\r
2323 <userinput>wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.4.0.4.tar.gz</userinput>\r
2324 <userinput>tar xfz Evergreen-ILS-1.4.0.4.tar.gz</userinput>\r
2325 <userinput>cd Evergreen-ILS-1.4.0.4/</userinput>\r
2326 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>\r
2327 <userinput>cd Open-ILS/xul/staff_client/</userinput>\r
2328 <userinput>make STAFF_CLIENT_BUILD_ID='rel_1_4_0_4' install</userinput>\r
2329 </screen>\r
2330                                                                 <para/>\r
2331                                                                 <para>If you're installing from a Subversion checkout:</para>\r
2332 \r
2333 <screen>\r
2334 <userinput>su - opensrf</userinput>\r
2335 <userinput>svn co svn://svn.open-ils.org/ILS/tags/rel_1_4_0_4/</userinput>\r
2336 <userinput>cd rel_1_4_0_4</userinput>\r
2337 <userinput>./autogen.sh</userinput>   # If you downloaded a .tar.gz of Evergreen, you may skip this step\r
2338 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>\r
2339 <userinput>cd Open-ILS/xul/staff_client/</userinput>\r
2340 <userinput>make STAFF_CLIENT_BUILD_ID='rel_1_4_0_4' install</userinput>\r
2341 </screen>\r
2342 \r
2343                                                         </section>\r
2344                                                 </step>\r
2345                                                 <step>\r
2346                                                         <para>Run the Staff Client (from the command line)</para>\r
2347                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, navigate to the directory <filename class="directory">build/</filename> (not <filename class="directory">staff_client/</filename>) and run the following command:</para>                                   \r
2348 <screen>\r
2349 <userinput>su - opensrf</userinput>\r
2350 <userinput>xulrunner application.ini</userinput>\r
2351 </screen>\r
2352                                                 </step>\r
2353                                                 <step>\r
2354                                                         <para>(OPTIONAL) Cleaning Up / Creating Shortcuts</para>\r
2355                                                         <para>The source code download included many files that are needed to build the Staff Client, but are not necessary to run it. You may \r
2356                                                         wish to remove them to save space, or to create a clean directory containing the built Staff Client that can be copied to other machines. To \r
2357                                                         create a clean "staging" directory in which to place the finished Staff Client, issue the following commands:</para>                                            \r
2358 <screen>\r
2359 <userinput>mkdir ~/&lt;Destination Directory&gt;</userinput>\r
2360 <userinput>cd ~/&lt;Download Directory>/Open-ILS/xul/</userinput>\r
2361 <userinput>cp -r staff_client ~/&lt;Destination Directory~/&gt;</userinput>\r
2362 </screen>\r
2363                                                         <para>Finally, test the Staff Client to verify that all the necessary files were moved to the destination directory:</para>\r
2364                                                         \r
2365 <screen>\r
2366 <userinput>cd ~/&lt;Destination Directory>/staff_client/build</userinput>\r
2367 <userinput>xulrunner application.ini</userinput>\r
2368 </screen>\r
2369                                                         \r
2370                                                         <para>If there were no problems, then finish the cleanup by removing the original download directory and all subdirectories:</para>\r
2371 <screen>\r
2372 <userinput>rm -r -f ~/&lt;Download Directory&gt;</userinput>\r
2373 </screen>\r
2374                                                         \r
2375                                                         <para>Finally, test the copied Staff Client. You can create "Desktop / Start Menu / K-Menu" shortcuts for the Staff Client by using the following command as the target:</para>                                         \r
2376 <screen>\r
2377 <userinput>xulrunner ~/&lt;Destination Directory&gt;/staff_client/build/application.ini</userinput>\r
2378 </screen>\r
2379                                                 \r
2380                                                 </step>\r
2381                                         </procedure>\r
2382                                 </section>\r
2383                                 <section>\r
2384                                         <title>Using <application>"Wine"</application> to Install On Linux</title>\r
2385                                         <para>The <systemitem class="osname">Linux</systemitem> application <application>"Wine"</application> is another alternative for those who wish to install the packaged <systemitem class="osname">Windows</systemitem> versions rather than building the Staff Client manually. <application>"Wine"</application> is a <systemitem class="osname">Linux</systemitem> application that allows users to directly run <systemitem class="osname">Windows</systemitem> executables, and is a simple way for casual <systemitem class="osname">Linux</systemitem> users to use the Staff Client. More information about <application>"Wine"</application> can be found at <ulink url="http://www.winehq.org/site/docs/wineusr-guide/getting-wine">http://www.winehq.org/site/docs/wineusr-guide/getting-wine</ulink>.</para>\r
2386                                         <para>As the <systemitem class="username">root</systemitem> user, use <application>"apt-get"</application> to install the package for <application>"Wine"</application>. You can also use <application>"synaptic"</application>, the graphical user interface.</para>\r
2387                                         <procedure>\r
2388                                                 <step>\r
2389                                                         <para>Install <application>"Wine"</application></para>\r
2390                                                                                                                 \r
2391 <screen>\r
2392 <userinput>sudo apt-get install wine</userinput>\r
2393 </screen>\r
2394                                                 </step>\r
2395                                                 <step>\r
2396                                                         <para>Download <systemitem class="osname">Windows</systemitem> installer for the Staff Client</para>\r
2397                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands to download the <systemitem class="osname">Windows</systemitem> installer for the proper Staff Client from the <emphasis>open-ils.org</emphasis> website and place it in a temporary directory:</para>\r
2398 <screen>\r
2399 <userinput>su - opensrf</userinput>\r
2400 <userinput>cd /YOUR/DOWNLOAD/DIRECTORY</userinput>\r
2401 <userinput>wget http://open-ils.org/downloads/evergreen-setup-rel_version-number.exe</userinput>\r
2402 </screen>\r
2403 \r
2404                                                 </step>\r
2405                                                 <step>\r
2406                                                         <para>Run the downloaded <systemitem class="osname">Windows</systemitem> installer</para>\r
2407                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, navigate to the directory where you downloaded the <systemitem class="osname">Windows</systemitem> executable file, then execute it:</para>\r
2408 <screen>\r
2409 <userinput>su - opensrf</userinput>\r
2410 <userinput>cd /YOUR/DOWNLOAD/DIRECTORY</userinput>\r
2411 <userinput>wine evergreen-setup-rel_version-number.exe</userinput>\r
2412 </screen>\r
2413                                                         \r
2414                                                         <para>If this step fails, you may need to configure Wine first to properly emulate <systemitem class="osname">WindowsXP</systemitem>. To do so, type the command <command>winecfg</command> from the command line; in the <guibutton>Applications</guibutton> tab of the window that pops up, select <guibutton>Default Settings</guibutton> and choose <guibutton>Windows XP</guibutton> from the drop-down menu, then click <guibutton>Apply</guibutton>.</para>\r
2415                                                 </step>\r
2416                                                 <step>\r
2417                                                         <para>Launch the Staff Client</para>\r
2418                                                         <para>A new entry for the Staff Client should now appear somewhere in the <guibutton>All Applications</guibutton> menu of your <systemitem class="osname">Linux</systemitem> desktop. Also, find a new desktop shortcut for the Staff Client. To launch the Staff Client, visit the <guibutton>All Applications</guibutton> menu, find a section similar to <emphasis><menuchoice><guimenu>Wine</guimenu><guimenuitem>Program Files</guimenuitem><guimenuitem>Evergreen Staff Client</guimenuitem><guimenuitem>Evergreen Staff Client</guimenuitem></menuchoice></emphasis>\r
2419 , or else launch the Staff Client from the desktop shortcut.</para>\r
2420                                                 </step>\r
2421                                         </procedure>\r
2422                                 </section>\r
2423                                 <section>\r
2424                                         <title>Running the Staff Client over an SSH Tunnel</title>\r
2425                                         <para>The Staff Client can use an SSH tunnel as a SOCKS 5 proxy. For more details, see <xref linkend="serversideinstallation-proxy"/>.</para>\r
2426                                 </section>\r
2427                         </section>\r
2428                         <section xml:id="serversideinstallation-workstationnames">\r
2429                                 <title>Assigning Workstation Names</title>\r
2430                                 <para>The Staff Client must be assigned to a library and given a unique name before it will connect fully to the Evergreen server. The only restriction is that the workstation's name must be unique within the assigned library. Make sure to select a workstation name that you will remember later, and reflects the role, purpose, and/or location of a particular computer. These names will come up later in statistical reporting, and can also be handy when troubleshooting.</para>\r
2431 <mediaobject>\r
2432         <imageobject>\r
2433                 <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-1.png" scalefit="1" width="70%"/>\r
2434         </imageobject>\r
2435 </mediaobject>\r
2436                                 <para>In order to assign a workstation a name, a user with appropriate permissions must login to the Staff Client. In PINES, the local system administrator (OPSM) has the ability to assign workstation names in his or her library system. Library managers (LIBM's) have the ability within their branch. To assign a workstation a name, login to the system. You will be prompted to assign the workstation a library and a name:</para>\r
2437 <mediaobject>\r
2438         <imageobject>\r
2439                 <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-2.png" scalefit="1" width="70%"/>\r
2440         </imageobject>\r
2441 </mediaobject>\r
2442                                 <para>Select the library this workstation physically operates in from the drop down menu. In this example, we have selected <literal>MGRL-MA</literal>. Type in a friendly name for the workstation. In this example, we are installing the Staff Client on the director's personal system, and have named it as such. Then hit <emphasis role="bold">Register</emphasis>.</para>\r
2443                                 <para>Once you have registered your workstation with the server, your screen will look like this:</para>\r
2444 <mediaobject>\r
2445         <imageobject>\r
2446                 <imagedata fileref="../media/serversideinstallation-staffclient-workstationnames-3.png" scalefit="1" width="70%"/>\r
2447         </imageobject>\r
2448 </mediaobject>\r
2449                                 <para>You are now ready to log into the Staff Client for the first time. Type in your password again, and hit <emphasis role="bold">Login</emphasis>.</para>\r
2450                         </section>\r
2451                 </section>\r
2452                 <section xml:id="serversideinstallation-building-staffclient">\r
2453                         <title>Manually Building the Staff Client</title>\r
2454                         <para>This section reviews the process of manually building the Staff Client in various environments.</para>\r
2455                         <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 <xref linkend="serversideinstallation-compilingevergreen"/> to review details related to building the Staff Client in the final compile/link/install phase of the default Evergreen build process.</para>\r
2456                         <section>\r
2457                                 <title>Building the Staff Client</title>\r
2458                                 <para>You can also manually build the Staff Client by using the <command>make</command> utility in the Staff Client source directory (e.g., the directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</filename> for the current Evergreen version). There are a number of possible options to manually build special versions of the Staff Client on a <systemitem class="osname">Linux</systemitem> system. Following is a list of environment variables that can be passed to <command>make</command> to influence the manual build process:</para>\r
2459                                 <section>\r
2460                                         <title>Option STAFF_CLIENT_BUILD_ID</title>\r
2461                                         <para>During the normal <emphasis>make install</emphasis> Evergreen server-side software build process, the variable defaults to an automatically generated date/time string, but you can also override the value of BUILD_ID.</para>\r
2462                                         <para>The following commands could be used during the normal build process:</para>\r
2463 <screen>\r
2464 <userinput>su - root</userinput>\r
2465 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7</userinput>\r
2466 <userinput>make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install</userinput>\r
2467 ...\r
2468 </screen>                                       \r
2469                                         <para>The following commands will manually build the Staff Client using a different BUILD_ID.</para>\r
2470                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then set the variable and \r
2471                                         build the Staff Client:</para>                                  \r
2472 <screen>\r
2473 <userinput>su - opensrf</userinput>\r
2474 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2475 <userinput>make STAFF_CLIENT_BUILD_ID=my_test_id  build</userinput>\r
2476 ...\r
2477 </screen>               \r
2478                                 </section>\r
2479                                 <section>\r
2480                                         <title>Option STAFF_CLIENT_VERSION</title>\r
2481                                         <para>During the normal <emphasis>make install</emphasis> Evergreen server-side software build process, the variable is pulled automatically from a README file in the Evergreen source root. The variable defaults to <emphasis>0trunk.revision</emphasis>, where the value of <literal>revision</literal> is automatically generated. You can override the value of VERSION similarly to the BUILD_ID.</para>\r
2482                                         <para>The following commands could be used during the normal build process:</para>\r
2483 <screen>\r
2484 <userinput>$ su - root</userinput>\r
2485 <userinput>$ cd /home/opensrf/Evergreen-ILS-1.6.0.7</userinput>\r
2486 <userinput>$ make STAFF_CLIENT_VERSION=0mytest.200 install</userinput>\r
2487 ...\r
2488 </screen>\r
2489 \r
2490                                         <para>The following commands will manually build the Staff Client using a different VERSION.</para>\r
2491                                         <para>If you plan to make extensions update automatically, the VERSION needs to conform to the format recommended in \r
2492                                         <ulink url="https://developer.mozilla.org/en/Toolkit_version_format">Toolkit Version Format</ulink> and newer versions need to be "higher" \r
2493                                         than older versions.</para>\r
2494                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then set the variable and build the Staff Client:</para>\r
2495 <screen>\r
2496 <userinput>su - opensrf</userinput>\r
2497 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2498 <userinput>make STAFF_CLIENT_VERSION=0mytest.200  build</userinput>\r
2499 ...\r
2500 </screen>\r
2501                                 </section>\r
2502                                 <section>\r
2503                                         <title>Option STAFF_CLIENT_STAMP_ID variable</title>\r
2504                                         <para>During the normal <emphasis>make install</emphasis> Evergreen server-side software build process, this variable is generated from STAFF_CLIENT_VERSION. \r
2505                                         You can override the value of STAMP_ID similarly to the BUILD_ID.</para>\r
2506                                         <para>The following commands could be used during the normal build process:</para>\r
2507 <screen>\r
2508 <userinput>su - root</userinput>\r
2509 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7</userinput>\r
2510 <userinput>make STAFF_CLIENT_STAMP_ID=my_test_stamp install</userinput>\r
2511 ...\r
2512 </screen>\r
2513                                         <para>The following commands will manually build the Staff Client using a different STAMP_ID.</para>\r
2514                                         <para>It is possible to have multiple versions of the Staff Client by specifying a different STAMP_ID for each, possibly for different uses or \r
2515                                         client-side customizations.</para>\r
2516                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then set the variable and \r
2517                                         build the Staff Client:</para>\r
2518 <screen>\r
2519 <userinput>su - opensrf</userinput>\r
2520 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2521 <userinput>make STAFF_CLIENT_STAMP_ID=my_test_stamp  build</userinput>\r
2522 ...\r
2523 </screen>                               \r
2524                                 </section>\r
2525                         </section>\r
2526                         <section>\r
2527                                 <title>Advanced Build Options</title>\r
2528                                 <para>In addition to the basic options listed above, there are a number of advanced options for building the Staff Client. Most are target names for \r
2529                                 the <command>make</command> utility and require that you build the Staff Client from its source directory. See the following table for a list of possible \r
2530                                 <command>make</command> target keywords:</para>\r
2531                                 <table>\r
2532                                         <title>Keywords Targets for <application>"make"</application> Command</title>\r
2533                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
2534                                                 <colspec colnum="1" colwidth="1.0*"/>\r
2535                                                 <colspec colnum="2" colwidth="3.0*"/>\r
2536                                                 <thead>\r
2537                                                         <row>\r
2538                                                                 <entry>Keyword</entry>\r
2539                                                                 <entry>Description</entry>\r
2540                                                         </row>\r
2541                                                 </thead>\r
2542                                                 <tbody>\r
2543                                                         <row>\r
2544                                                                 <entry>clients</entry>\r
2545                                                                 <entry>Runs "make win-client", "make linux-client", and "make generic-client" individually</entry>\r
2546                                                         </row>\r
2547                                                         <row>\r
2548                                                                 <entry>client_dir</entry>\r
2549                                                                 <entry>Builds a client directory from the build directory, without doing a rebuild. The same as "copy everything but server/".</entry>\r
2550                                                         </row>\r
2551                                                         <row>\r
2552                                                                 <entry>client_app</entry>\r
2553                                                                 <entry>Prerequisite "client_dir"; removes "install.rdf" from client directory so an APP bundle can't be installed as an extension</entry>\r
2554                                                         </row>\r
2555                                                         <row>\r
2556                                                                 <entry>client_ext</entry>\r
2557                                                                 <entry>Prerequisite "client_dir"; remove "application.ini", "autoupdate.js", "standalone_xul_app.js" from client directory so an \r
2558                                                                 extension won't break Firefox</entry>\r
2559                                                         </row>\r
2560                                                         <row>\r
2561                                                                 <entry>extension</entry>\r
2562                                                                 <entry>Prerequisite "client_ext"; rewritten to use "client_ext"</entry>\r
2563                                                         </row>\r
2564                                                         <row>\r
2565                                                                 <entry>generic-client</entry>\r
2566                                                                 <entry>Prerequisite "client_app"; makes an XPI file suitable for use with "xulrunner --install-app""</entry>\r
2567                                                         </row>\r
2568                                                         <row>\r
2569                                                                 <entry>win-xulrunner</entry>\r
2570                                                                 <entry>Prerequisite "client_app"; adds Windows xulrunner to client build</entry>\r
2571                                                         </row>\r
2572                                                         <row>\r
2573                                                                 <entry>linux-xulrunner</entry>\r
2574                                                                 <entry>Prerequisite "client_app"; adds Linux xulrunner to client build</entry>\r
2575                                                         </row>\r
2576                                                         <row>\r
2577                                                                 <entry>win-client</entry>\r
2578                                                                 <entry>Prerequisite "win-xulrunner"; builds "setup exe" (requires that "nsis" package be installed, will add options for \r
2579                                                                 automatic update if configured and developer options if client build was a "make devbuild")</entry>\r
2580                                                         </row>\r
2581                                                         <row>\r
2582                                                                 <entry>linux-client</entry>\r
2583                                                                 <entry>Prerequisite "linux_xulrunner"; builds a "tar.bz2" bundle of the Linux client</entry>\r
2584                                                         </row>\r
2585                                                         <row>\r
2586                                                                 <entry>[generic-|win-|linux-|extension-]updates[-client]</entry>\r
2587                                                                 <entry>Calls external/make_updates.sh to build full and partial updates generic/win/linux/extension prefix limit to \r
2588                                                                 that distribution; Adding the string "-client" builds clients and copies them to a subdirectory of the directory \r
2589                                                                 <filename class="directory">updates</filename> as well; the target "extension-updates-client" doesn't exist.</entry>\r
2590                                                         </row>\r
2591                                                 </tbody>\r
2592                                         </tgroup>\r
2593                                 </table>\r
2594                                 <para>Descriptions of other special build options follow:</para>\r
2595                                 <itemizedlist>\r
2596                                         <listitem>\r
2597                                                 <para>Developer Build</para>\r
2598                                                 <para>You can create a so-called "developer build" of the Staff Client by substituting <literal>devbuild</literal> for <literal>build</literal> \r
2599                                                 when running <command>make</command>. The build will contain an extra configuration file that enables some developer options.</para>\r
2600                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>make</command> from the Staff Client source directory:</para>\r
2601                                                         <title>Commands to do a "developer build"</title>\r
2602 <screen>\r
2603 <userinput>su - opensrf</userinput>\r
2604 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2605 <userinput>make devbuild</userinput>\r
2606 ...\r
2607 </screen>                       \r
2608                                         </listitem>\r
2609                                         <listitem>\r
2610                                                 <para>Compressed Javascript</para>\r
2611                                                 <para>You can execute the Google application <application>"Closure Compiler"</application> to automatically review and compress Javascript code after the build process completes, by substituting <literal>compress-javascript</literal> for <literal>build</literal> when running <command>make</command>. For more information see <ulink url="http://code.google.com/closure/compiler/">Google "Closure Compiler"</ulink>.</para>\r
2612                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands from the Staff Client source directory:</para>\r
2613                                                 \r
2614 <screen>\r
2615 <userinput>su - opensrf</userinput>\r
2616 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2617 <userinput>make compress-javascript</userinput>\r
2618 ...\r
2619 </screen>\r
2620                                                 <para>You can also combine Javascript review and compression, and also perform a "developer build".</para>\r
2621                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run the following commands from the Staff Client source directory:</para>\r
2622 \r
2623 <screen>\r
2624 <userinput>su - opensrf</userinput>\r
2625 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2626 \r
2627 # order of options is important!\r
2628 <userinput>make  devbuild  compress-javascript</userinput>\r
2629 ...\r
2630 </screen>                       \r
2631                                         </listitem>\r
2632                                         <listitem>\r
2633                                                 <para>Automatic Update Host</para>\r
2634                                                 <para>The host used to check for automatic Staff Client updates can be overridden by specifying the AUTOUPDATE_HOST option. \r
2635                                                 The following commands could have been used during the normal build process:</para>\r
2636                                                 <figure>\r
2637                                                         <title>Commands to set AUTOUPDATE_HOST for normal Evergreen build</title>\r
2638                                                         <screen>\r
2639                                                         $ su - root\r
2640                                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7\r
2641                                                         $ make AUTOUPDATE_HOST=localhost install\r
2642                                                         ...\r
2643                                                         </screen>\r
2644                                                 </figure>\r
2645                                                 <para>You can manually set AUTOUPDATE_HOST to set up automatic update checking. The following commands will manually build the Staff \r
2646                                                 Client using a different AUTOUPDATE_HOST.</para>\r
2647                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then set the \r
2648                                                 variable and build the Staff Client:</para>\r
2649 <screen>\r
2650 <userinput>su - opensrf</userinput>\r
2651 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2652 <userinput>make AUTOUPDATE_HOST=localhost build</userinput>\r
2653 ...\r
2654 </screen>\r
2655                                                 \r
2656                                                 <para>For more information on Automatic Updates, see <xref linkend="serversideinstallation-staffclient-autoupdate"/>.</para>\r
2657                                         </listitem>\r
2658                                 </itemizedlist>\r
2659                         </section>\r
2660                         <section>\r
2661                                 <title>Installing and Activating a Manually Built Staff Client</title>\r
2662                                 <para>The Staff Client is automatically built, installed and activated as part of the normal <emphasis>make install</emphasis> process for Evergreen server-side \r
2663                                 software. However, if you manually build the Staff Client, then you need to take additional steps to properly install and activate it. You also have the option \r
2664                                 of installing the Staff Client on the same machine it was built on, or on a different machine.</para>\r
2665                                 <para>Assuming you have already built the Staff Client, and that your installation is in the directory <filename class="directory">/openils/var/web/xul</filename>, \r
2666                                 as the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>\r
2667 <screen>\r
2668 <userinput>su - opensrf</userinput>\r
2669 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2670 <userinput>mkdir -p "/openils/var/web/xul/$(cat build/BUILD_ID)"</userinput>\r
2671 <userinput>cp -R build/server "/openils/var/web/xul/$(cat build/BUILD_ID)"</userinput>\r
2672 </screen>\r
2673 \r
2674                         </section>\r
2675                         <section>\r
2676                                 <title>Packaging the Staff Client</title>\r
2677                                 <para>Once the Staff Client has been built, you can create several forms of client packages by using some targeted <command>make</command> commands in the Staff Client source directory.</para>\r
2678                                 <itemizedlist>\r
2679                                         <listitem>\r
2680                                                 <para>Packaging a Generic Client</para>\r
2681                                                 <para>This build creates a Staff Client packaged as an XPI file to use with <emphasis>XULRunner</emphasis>. It requires that you already have the <application>"zip"</application> utility installed on your system. It will create the output file <filename>evergreen_staff_client.xpi</filename>, suitable for use with the <emphasis>XULRunner</emphasis> option <option>--install-app</option>.</para>\r
2682                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>\r
2683 <screen>\r
2684 <userinput>su - opensrf</userinput>\r
2685 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2686 <userinput>make generic-client</userinput>\r
2687 ...\r
2688 </screen>\r
2689 \r
2690                                         </listitem>\r
2691                                         <listitem>\r
2692                                                 <para>Packaging a <systemitem class="osname">Windows</systemitem> Client</para>\r
2693                                                 <para>This build creates a Staff Client packaged as a <systemitem class="osname">Windows</systemitem> executable. It requires that you already have the <application>"unzip"</application> 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 <systemitem class="osname">Windows</systemitem> installers (the <application>"makensis"</application> utility is installed as part of the <application>"nsis"</application> package). We recommend using Version 2.45 or later. This build will create the output file <filename>evergreen_staff_client_setup.exe</filename>.</para>\r
2694                                                 <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 <filename>xulrunner-stub.exe</filename>. Place it in the Staff Client source directory and <application>"make"</application> will automatically use it instead of the one that comes with the downloaded <emphasis>XULRunner</emphasis> release. The version of <filename>xulrunner-stub.exe</filename> need not match exactly.</para>\r
2695                                                 <para>(OPTIONAL) You can also use a tool such as <ulink url="http://www.angusj.com/resourcehacker/">Resource Hacker</ulink> to embed icons. <application>"Resource Hacker"</application> is an open-source utility used to view, modify, rename, add, delete and extract resources in 32bit <systemitem class="osname">Windows</systemitem> executables. See the following table for some useful icon ID strings:</para>\r
2696                                                 <table>\r
2697                                                         <title>Useful icon ID strings</title>\r
2698                                                         <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
2699                                                                 <colspec colnum="1" colwidth="1.0*"/>\r
2700                                                                 <colspec colnum="2" colwidth="1.0*"/>\r
2701                                                                 <tbody>\r
2702                                                                         <row>\r
2703                                                                                 <entry>IDI_APPICON</entry>\r
2704                                                                                 <entry>Tray icon</entry>\r
2705                                                                         </row>\r
2706                                                                         <row>\r
2707                                                                                 <entry>32512</entry>\r
2708                                                                                 <entry>Default window icon</entry>\r
2709                                                                         </row>\r
2710                                                                 </tbody>\r
2711                                                         </tgroup>\r
2712                                                 </table>\r
2713                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>\r
2714 <screen>\r
2715 <userinput>su - opensrf</userinput>\r
2716 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2717 <userinput>make win-client</userinput>\r
2718 ...\r
2719 </screen>\r
2720                                         </listitem>\r
2721                                         <listitem>\r
2722                                                 <para>Packaging a <systemitem class="osname">Linux</systemitem> Client</para>\r
2723                                                 <para>This build creates a Staff Client package for <systemitem class="osname">Linux</systemitem> as a "tar.bz2" file with \r
2724                                                 <emphasis>XULRunner</emphasis> already bundled with it. It creates the output file <filename>evergreen_staff_client.tar.bz2</filename>.</para>\r
2725                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the \r
2726                                                 following commands:</para>\r
2727                                                 \r
2728                                                         \r
2729 <screen>\r
2730 <userinput>su - opensrf</userinput>\r
2731 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2732 <userinput>make linux-client</userinput>\r
2733 ...\r
2734 </screen>\r
2735                                                 \r
2736                                         </listitem>\r
2737                                         <listitem>\r
2738                                                 <para>Packaging a Firefox Extension</para>\r
2739                                                 <para>This build requires that you already have the <application>"zip"</application> utility installed on your system. It creates a \r
2740                                                 Staff Client packaged as a Firefox extension and creates the output file <filename>evergreen.xpi</filename>.</para>\r
2741                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then \r
2742                                                 execute the following commands:</para>                                                  \r
2743 <screen>\r
2744 <userinput>su - opensrf</userinput>\r
2745 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2746 <userinput>make extension</userinput>\r
2747 ...\r
2748 </screen>\r
2749                                                 \r
2750                                         </listitem>\r
2751                                 </itemizedlist>\r
2752                         </section>\r
2753                         <section xml:id="serversideinstallation-staffclient-autoupdate">\r
2754                                 <title>Staff Client Automatic Updates</title>\r
2755                                 <para>It is possible to set up support for automatic Staff Client updates, either during the normal Evergreen server-side build process, or by manually \r
2756                                 building the Staff Client with certain special options.</para>\r
2757                                 <section>\r
2758                                         <title>WARNINGS</title>\r
2759                                         <para>Automatic update server certificate requirements are more strict than normal server requirements. Firefox and \r
2760                                         <emphasis>XULRunner</emphasis> will both ignore any automatic update server that is not validated by a trusted certificate authority. \r
2761                                         Servers with exceptions added to force the Staff Client to accept them <emphasis>WILL NOT WORK</emphasis>.</para>\r
2762                                         <para>In addition, automatic updates have special requirements for the file <filename>update.rdf</filename>:</para>\r
2763                                         <orderedlist>\r
2764                                                 <listitem>It must be served from an SSL server, or</listitem>\r
2765                                                 <listitem>It must be signed with the <ulink url="https://developer.mozilla.org/en/McCoy">McCoy</ulink> tool.</listitem>\r
2766                                         </orderedlist>\r
2767                                         <para>You can pre-install the signing key into the file <filename>install.rdf</filename> directly, or install it into a copy as \r
2768                                         <emphasis>install.mccoy.rdf</emphasis>. If the latter exists it will be copied into the build instead of the original file \r
2769                                         <filename>install.rdf</filename>.</para>\r
2770                                 </section>\r
2771                                 <section>\r
2772                                         <title>Autoupdate Host</title>\r
2773                                         <para>The name of the automatic update host can be provided in either of two ways:</para>\r
2774                                         <orderedlist>\r
2775                                                 <listitem>At configuration time for the normal build of the Evergreen server-side software, or</listitem>\r
2776                                                 <listitem>During a manual Staff Client build process.</listitem>\r
2777                                         </orderedlist>\r
2778                                         <para/>\r
2779                                         <itemizedlist>\r
2780                                                 <listitem>\r
2781                                                         <para>At configuration time for the normal build of Evergreen server-side software</para>\r
2782                                                         <para>This must be done when the Evergreen server-side software is first configured (see <xref linkend="serversideinstallation-configure"/>). \r
2783                                                         As the <systemitem class="username">opensrf</systemitem> user, use the <command>configure</command> utility as shown:</para>\r
2784                                                         \r
2785 <screen>\r
2786 <userinput>su - opensrf</userinput>\r
2787 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7</userinput>\r
2788 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf --with-updateshost=hostname</userinput>\r
2789 <userinput>make</userinput>\r
2790 ...\r
2791 </screen>\r
2792                                                         \r
2793                                                 </listitem>\r
2794                                                 <listitem>\r
2795                                                         <para>During a manual Staff Client build process</para>\r
2796                                                         <para>You will used the variable AUTOUPDATE_HOST=hostname (see above). If you specify just a hostname (such as <uri>example.com</uri>) \r
2797                                                         then the URL will be a secure URL (such as <uri>https://example.com</uri>. If you wish to use a non-HTTPS URL then prefix the host \r
2798                                                         name with "http://" (such as <uri>http://example.com</uri>).</para>\r
2799                                                         <para>If neither option is used then, by default, the Staff Client will not include the automatic update preferences.</para>\r
2800                                                 </listitem>\r
2801                                         </itemizedlist>\r
2802                                 </section>\r
2803                                 <section>\r
2804                                         <title>Building Updates</title>\r
2805                                         <para>Similar to building clients, the targets <literal>generic-updates</literal>, <literal>win-updates</literal>, <literal>linux-updates</literal>, \r
2806                                         and <literal>extension-updates</literal> can be used individually with <command>make</command> to build the update files for the Staff Client. To build \r
2807                                         all the targets at once, simply use the target <literal>updates</literal>.</para>\r
2808                                         <para>A "full" update will be built for each specified target (or for all if you use the target <literal>updates</literal>). For all but extensions \r
2809                                         any previous "full" updates (archived by default in the directory <filename class="directory">/openils/var/updates/archives</filename>) will be used to \r
2810                                         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 \r
2811                                         full update will be used as a fallback. Extensions do not currently support partial updates.</para>\r
2812                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the \r
2813                                         following commands:</para>                      \r
2814 <screen>\r
2815 <userinput>su - opensrf</userinput>\r
2816 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2817 \r
2818 # command to build all updates at once:\r
2819 <userinput>make updates</userinput>\r
2820 ...\r
2821 \r
2822 # commands to build updates individually:\r
2823 <userinput>make generic-updates</userinput>\r
2824 ...\r
2825 <userinput>make win-updates</userinput>\r
2826 ...\r
2827 <userinput>make linux-updates</userinput>\r
2828 ...\r
2829 <userinput>make extension-updates</userinput>\r
2830 ...\r
2831 </screen>\r
2832                 \r
2833                                 </section>\r
2834                                 <section>\r
2835                                         <title>Building updates with clients</title>\r
2836                                         <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 <literal>win-updates-client</literal>. You can also specify <literal>updates-client</literal> to build all the targets at once. This does not work for extension-updates.</para>\r
2837                                         <para>The clients will be installed alongside the updates and listed on the web page <uri>manualupdate.html</uri>, rather than left in the Staff Client directory.</para>\r
2838                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>\r
2839 \r
2840 <screen>\r
2841 $ su - opensrf\r
2842 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2843 \r
2844 # command to build all updates at once:\r
2845 <userinput>make updates-client</userinput>\r
2846 ...\r
2847 \r
2848 # commands to build updates individually:\r
2849 <userinput>make generic-updates-client</userinput>\r
2850 ...\r
2851 <userinput>make win-updates-client</userinput>\r
2852 ...\r
2853 <userinput>make linux-updates-client</userinput>\r
2854 ...\r
2855 </screen>\r
2856                                 </section>\r
2857                                 <section>\r
2858                                         <title>Activating the Update Server</title>\r
2859                                         <para>This section reviews scripts associated with the update server, and requires some final adjustments to file permissions.</para>\r
2860                                         <para>The Apache example configuration creates a directory <filename class="directory">updates</filename> that, by default, points to the directory \r
2861                                         <filename class="directory">/openils/var/updates/pub</filename>. This directory contains one HTML file and several specially-named script files.</para>\r
2862                                         <para>The file <filename>updatedetails.html</filename> is the fallback web page for the update details. The <application>"check"</application> \r
2863                                         script is used for <emphasis>XULRunner</emphasis> updates. The <application>"update.rdf"</application> script is used for extension updates. \r
2864                                         The <application>"manualupdate.html"</application> script checks for clients to provide download links when automatic updates have failed and uses the \r
2865                                         download script to force a download of the generic client XPI (compared to Firefox trying to install it as an extension).</para>\r
2866                                         <para>The following scripts should be marked as executable: <emphasis>check, download, manualupdate.html, update.rdf</emphasis>. As the \r
2867                                         <systemitem class="username">root</systemitem> user, change directory to the updates directory, then execute the following commands:</para>\r
2868 <screen>\r
2869 <userinput>su - root</userinput>\r
2870 <userinput>cd /openils/var/updates/pub</userinput>\r
2871 <userinput>chmod +x  check  download  manualupdate.html  update.rdf</userinput>\r
2872 </screen>\r
2873                                         \r
2874                                 </section>\r
2875                         </section>\r
2876                         <section>\r
2877                                 <title>Other tips</title>\r
2878                                 <section>\r
2879                                         <title>Multiple workstations on one install</title>\r
2880                                         <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 <option>-profilemanager</option> or <option>-P</option> (uppercase "P") to force the Profile Manager to start. Unchecking the option <option>Don't ask at startup</option> will make this the default.</para>\r
2881                                         <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>\r
2882                                         <para>When building targets <literal>win-client</literal>, <literal>win-updates-client</literal>, or <literal>updates-client</literal>, you can specify <literal>NSIS_EXTRAOPTS=-DPROFILES</literal> to add an "Evergreen Staff Client Profile Manager" option to the start menu.</para>\r
2883                                         <para>As the <systemitem class="username">opensrf</systemitem> user, change directory to the Staff Client source directory, then execute the following commands:</para>\r
2884 <screen>\r
2885 <userinput>su - opensrf</userinput>\r
2886 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client</userinput>\r
2887 <userinput>make NSIS_EXTRAOPTS=-DPROFILES win-client</userinput>\r
2888 ...\r
2889 </screen>\r
2890                                         \r
2891                                 </section>\r
2892                                 <section>\r
2893                                         <title> Multiple Staff Clients</title>\r
2894                                         <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 \r
2895                                         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>\r
2896                                         <para>Once you have created the profiles, run <emphasis>XULRunner</emphasis> with the option <option>-no-remote</option> (in addition to \r
2897                                         <option>-profilemanger</option> or <option>-P</option> if needed). Instead of <emphasis>XULRunner</emphasis> opening a new login window on your existing \r
2898                                         session it will start a new session instead, which can then be logged in to a different server or workstation ID.</para>\r
2899                                 </section>\r
2900                         </section>\r
2901                 </section>\r
2902                 <section xml:id="serversideinstallation-running-staffclient">\r
2903                         <title>Running the Staff Client</title>\r
2904                         <para>Run the Staff Client on a <systemitem class="osname">Linux</systemitem> system by using the application <emphasis>XULRunner</emphasis> (installed automatically and by \r
2905                         default with Firefox version 3.0 and later on <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem> distributions).</para>\r
2906                         <para>For example, if the source files for the Evergreen installation are in the directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7/</filename>, \r
2907                         start the Staff Client as shown in the following command example:</para>\r
2908 <screen>\r
2909 <userinput>su - opensrf</userinput>\r
2910 <userinput>xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini</userinput>\r
2911 </screen>\r
2912                 </section>\r
2913                 <section xml:id="serversideinstallation-proxy">\r
2914                         <title>Configuring a Proxy for the Staff Client</title>\r
2915                         <para>By using an SSH proxy and an SSH tunnel, it is possible to provide secure (encrypted) network communications between the Staff Client and one or more Evergreen \r
2916                         servers. In addition to providing excellent data security, this method also buffers and caches data traveling to and from the Staff Client and can speed up access to resources \r
2917                         on remote Evergreen servers. This is important if your system architecture includes many Staff Clients and Evergreen servers in a busy environment, through network firewalls, \r
2918                         or must operate over insecure networks.</para>\r
2919                         <section>\r
2920                                 <title>Why Use a Proxy for the Staff Client?</title>\r
2921                                 <para>There are several reasons for sending network traffic for the Staff Client through an SSH proxy:</para>\r
2922                                 <itemizedlist>\r
2923                                         <listitem><emphasis role="bold">Firewalls</emphasis> may prevent you from reaching the server. This may happen when you are connecting the Staff Client \r
2924                                         to a test server that should not be available generally, or it may be the result of network design priorities other than ease of use.</listitem>\r
2925                                         <listitem>You may wish to <emphasis role="bold">improve security</emphasis> where Staff Client traffic may be susceptible to network eavesdropping. \r
2926                                         This is especially true when wireless is otherwise the best option for connecting a staff machine to the network.</listitem>\r
2927                                         <listitem>You may wish to buffer and cache data from remote Evergreen servers to speed up access from Staff Clients.</listitem>\r
2928                                 </itemizedlist>\r
2929                         </section>\r
2930                         <section>\r
2931                                 <title>Setting Up an SSH Tunnel</title>\r
2932                                 <para>You will need a server that has network access to the Evergreen server you want to reach, and allows you to log in there via SSH. Use your username and \r
2933                                 password for that SSH server to set up a tunnel.</para>\r
2934                                 <para>For <systemitem class="osname">Windows</systemitem> users, one good solution is the open-source utility \r
2935                                 <ulink url="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</ulink>, a free telnet/SSH client. An example of setting up a \r
2936                                 <application>"PuTTY"</application> session follows:</para>                      \r
2937 <mediaobject>\r
2938         <imageobject>\r
2939                 <imagedata fileref="../media/serversideinstallation-proxy-putty.png" scalefit="1" width="70%"/>\r
2940         </imageobject>\r
2941 </mediaobject>\r
2942                                 <procedure>\r
2943                                         <step>Use the menu on the left to go to <emphasis><menuchoice><guimenu>Connection</guimenu><guimenuitem>SSH</guimenuitem>\r
2944                                         <guimenuitem>Tunnels</guimenuitem></menuchoice></emphasis>.</step>\r
2945                                         <step>Enter <literal>9999</literal> in the "Source port".</step>\r
2946                                         <step>Choose <guibutton>Dynamic</guibutton>. Do not enter anything in the Destination text entry box.</step>\r
2947                                         <step>Click <guibutton>Add</guibutton>. "D9999" will now appear in the "Forwarded ports" list.</step>\r
2948                                         <step>Use the menu on the left to go back to "Session", and enter the host name of the SSH server.</step>\r
2949                                         <step>A window will open up so that you can enter your username and password. Once you are logged in, the tunnel is open.</step>\r
2950                                 </procedure>\r
2951                         </section>\r
2952                         <section>\r
2953                                 <title>Configuring the Staff Client to Use the SSH Tunnel</title>\r
2954                                 <para>In order to tell the Staff Client that all traffic should be sent through the SSH tunnel just configured, you must edit the file \r
2955                                 <filename>C:\Program Files\Evergreen Staff Client\greprefs\all.js</filename>. Search this file for the word <emphasis role="bold">socks</emphasis> to \r
2956                                 find the appropriate section for the following changes.</para>\r
2957                                         <mediaobject>\r
2958                                                 <imageobject>\r
2959                                                         <imagedata fileref="../media/serversideinstallation-proxy-socks-1.png" scalefit="1" width="70%"/>\r
2960                                                 </imageobject>\r
2961                                         </mediaobject>\r
2962                                 <para>Make the following changes:</para>\r
2963                                 <itemizedlist>\r
2964                                         <listitem>Change the value of <emphasis>network.proxy.socks</emphasis> from <emphasis role="bold">""</emphasis> to \r
2965                                         <emphasis role="bold">"localhost"</emphasis>.</listitem>\r
2966                                         <listitem>Change the value of <emphasis>network.proxy.socks_port</emphasis> from <emphasis role="bold">"0"</emphasis> to \r
2967                                         <emphasis role="bold">9999</emphasis>.</listitem>\r
2968                                 </itemizedlist>\r
2969                                         <mediaobject>\r
2970                                                 <imageobject>\r
2971                                                         <imagedata fileref="../media/serversideinstallation-proxy-socks-2.png" scalefit="1" width="70%"/>\r
2972                                                 </imageobject>\r
2973                                         </mediaobject>\r
2974                                 <para>If everything is working correctly, you should now be able to run the Staff Client and all its data will be sent encrypted through the SSH \r
2975                                 tunnel you have just configured.</para>\r
2976                         </section>\r
2977                 </section>\r
2978         </section>\r
2979         <index/>\r
2980 </chapter>\r