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