]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/serversideinstallation.xml
Fix splling and typos.
[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.\r
7                         Installation, configuration, testing and verification \r
8                         of the software is straightforward if you follow some simple directions.</para>\r
9                 </abstract>\r
10         </info>\r
11         <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current\r
12         stable software release. See <xref linkend="serversideinstallation-all"/> for instructions tailored to\r
13         installing on some particular distributions of the <systemitem class="osname">Linux</systemitem> operating\r
14         system.</para>\r
15         <para>The current version of the Evergreen server-side software runs as a native application on any of several\r
16         well-known <systemitem class="osname">Linux</systemitem> distributions \r
17         (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). \r
18         It does not currently run as a native application on the <systemitem class="osname">Microsoft Windows</systemitem> \r
19         operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP\r
20         Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can still be\r
21         installed and run on <systemitem class="osname">Windows</systemitem> via a so-called\r
22         <emphasis>virtualized</emphasis> Linux-guest Operating System (using, for example,\r
23         <application>"VirtualBox"</application>, or <application>"VMware"</application>, or\r
24         <application>"VirtualPC"</application> to emulate a <systemitem class="osname">Linux</systemitem>\r
25         environment). It can also be installed to run on other <systemitem class="osname">Linux</systemitem> \r
26         systems via virtualized environments (using, for example, <application>"VirtualBox"</application> or\r
27         <application>"VMware"</application>). More information on virtualized environments can be found in \r
28         <xref linkend="serversideinstallation-virtual"/>.</para>\r
29         <para>Installation of the Evergreen Staff Client software is reviewed in <xref linkend="staffclientinstallation"/>. </para>\r
30         <para>The Evergreen server-side software has dependencies on particular versions of certain major software\r
31         sub-components. Successful installation of Evergreen software requires that software versions agree with those\r
32         listed here:</para>\r
33         <table xml:id="serversideinstall-software-dependencies">\r
34                 <title>Evergreen Software Dependencies</title>\r
35                 <tgroup align="left" cols="3" colsep="1" rowsep="1">\r
36                         <colspec colname="Evergreen" colnum="1" colwidth="1.0*"/>\r
37                         <colspec colname="OpenSRF" colnum="2" colwidth="1.0*"/>\r
38                         <colspec colname="PostgreSQL" colnum="3" colwidth="1.0*"/>\r
39                         <thead>\r
40                                 <row>\r
41                                         <entry>Evergreen</entry>\r
42                                         <entry>OpenSRF</entry>\r
43                                         <entry>PostgreSQL</entry>\r
44                                 </row>\r
45                         </thead>\r
46                         <tbody>\r
47                                 <row>\r
48                                         <entry>1.6.1.x</entry>\r
49                                         <entry>1.4.0</entry>\r
50                                         <entry>8.2 / 8.3</entry>\r
51                                 </row>\r
52                                 <row>\r
53                                         <entry>1.6.0.x</entry>\r
54                                         <entry>1.2</entry>\r
55                                         <entry>8.2 / 8.3</entry>\r
56                                 </row>\r
57                                 <row>\r
58                                         <entry>1.4.x</entry>\r
59                                         <entry>1.0</entry>\r
60                                         <entry>8.1 / 8.2</entry>\r
61                                 </row>\r
62                                 <row>\r
63                                         <entry>1.2.x</entry>\r
64                                         <entry>0.9</entry>\r
65                                         <entry>8.1 / 8.2</entry>\r
66                                 </row>\r
67                         </tbody>\r
68                 </tgroup>\r
69         </table>\r
70         <section xml:id="serversideinstallation-all">\r
71                 <title>Installing Server-Side Software</title>\r
72                 <para>This section describes the installation of the major components of Evergreen server-side software.</para>\r
73                 <para>As far as possible, you should perform the following steps in the exact order given since the\r
74                 success of many steps relies on the successful completion of earlier steps. You should make backup\r
75                 copies of files and environments when you are instructed to do so. In the event of installation problems\r
76                 those copies can allow you to back out of a step gracefully and resume the installation from a known\r
77                 state. See <xref linkend="backingup"/> for further information.</para>\r
78                 <para>Of course, after you successfully complete and test the entire Evergreen installation you should\r
79                 take a final snapshot backup of your system(s). This can be the first in the series of regularly\r
80                 scheduled system backups that you should probably also begin.</para>\r
81                 <section xml:id="serversideinstallation-opensrf">\r
82                         <title>Installing OpenSRF 1.4.x On <systemitem class="osname">Ubuntu</systemitem> or\r
83                                 <systemitem class="osname">Debian</systemitem></title>\r
84                         <para>This section describes the installation of the latest version of the Open Service Request\r
85                         Framework (OpenSRF), a major component of the Evergreen server-side software, on \r
86                         <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem>\r
87                         systems. Evergreen software is integrated with and depends on the OpenSRF software\r
88                         system.</para>\r
89                         <para>Follow the steps outlined here and run the specified tests to ensure that OpenSRF is\r
90                         properly installed and configured. Do not continue with any further Evergreen installation steps\r
91                         until you have verified that OpenSRF has been successfully installed.</para>\r
92                         <note>\r
93                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit)\r
94                                 platforms. OpenSRF 1.4.0 has been tested on <systemitem class="osname">Debian Etch\r
95                                 (4.0)</systemitem>, <systemitem class="osname">Debian Lenny (5.0)</systemitem> and\r
96                                 <systemitem class="osname">Ubuntu Lucid Lynx (10.04)</systemitem>.</para>\r
97                                 <para>In the following instructions, you are asked to perform certain steps as either\r
98                                 the <systemitem class="username">root</systemitem> user, the \r
99                                 <systemitem class="username">opensrf</systemitem> user, or the \r
100                                 <systemitem class="username">postgres</systemitem> user.</para>\r
101                                 <itemizedlist>\r
102                                         <listitem>\r
103                                                 <para><systemitem class="osname">Debian</systemitem> -- To become the\r
104                                                 <systemitem class="username">root</systemitem> user, issue the command\r
105                                                 <command>su -</command> and enter the password of the\r
106                                                 <systemitem class="username">root</systemitem> user.</para>\r
107                                         </listitem>\r
108                                         <listitem>\r
109                                                 <para><systemitem class="osname">Ubuntu</systemitem> -- To become the\r
110                                                 <systemitem class="username">root</systemitem> user, issue the command\r
111                                                 <command>sudo su -</command> and enter the password of the \r
112                                                 <systemitem class="username">root</systemitem> user.</para>\r
113                                         </listitem>\r
114                                 </itemizedlist>\r
115                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a\r
116                                 different user, issue the command <command>su - USERNAME</command>. For example, to\r
117                                 switch from the <systemitem class="username">root</systemitem> user to the \r
118                                 <systemitem class="username">opensrf</systemitem> user, issue the command \r
119                                 <command>su - opensrf</command>. Once you have become a non-root user, to become \r
120                                 the <systemitem class="username">root</systemitem> user again, simply issue the command\r
121                                 <command>exit</command>.</para>\r
122                         </note>\r
123                         <procedure>\r
124                                 <step>\r
125                                         <title>Add the OpenSRF User</title>\r
126                                         <para>As the <systemitem class="username">root</systemitem> user, add the\r
127                                         opensrf user to the system. The default shell for the new user is automatically\r
128                                         set to <command>/bin/bash</command> to inherit a reasonable environment:</para>\r
129 <screen>\r
130 <userinput>useradd -m -s /bin/bash opensrf</userinput>\r
131 <userinput>passwd opensrf</userinput>\r
132 </screen>\r
133                                 </step>\r
134                                 <step>\r
135                                         <title>Download and Unpack Latest OpenSRF Version</title>\r
136                                         <para>As the <systemitem class="username">opensrf</systemitem> user, download\r
137                                         and extract the latest version of OpenSRF. The latest version can be found here:\r
138                                         <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.4.0.tar.gz"></ulink></para>\r
139 <screen>\r
140 <userinput>wget http://evergreen-ils.org/downloads/OpenSRF-1.4.0.tar.gz</userinput>\r
141 <userinput>tar zxf OpenSRF-1.4.0.tar.gz</userinput>\r
142 </screen>\r
143                                         <para>The new directory\r
144                                         <filename class="directory">/home/opensrf/OpenSRF-1.4.0</filename> will be created.</para>\r
145                                 </step>\r
146                                 <step>\r
147                                         <title>Install Prerequisites to Build OpenSRF</title>\r
148                                         <para>In this section you will install and configure a set of prerequisites that will be\r
149                                         used to build OpenSRF. In a following step you will actually build the OpenSRF software \r
150                                         using the <command>make</command> utility.</para>\r
151                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show\r
152                                         below to build the prerequisites from the software distribution that you just downloaded\r
153                                         and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the example with\r
154                                         the keyword corresponding to the name of the <systemitem class="osname">Linux</systemitem>\r
155                                         distribution listed in the distribution keywords table\r
156                                         <xref linkend="serversideinstallation-keywords-opensrf"/>. </para>\r
157 <screen>\r
158 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>\r
159 <userinput>make -f src/extras/Makefile.install [DISTRIBUTION]</userinput>\r
160 </screen>\r
161                                         <table xml:id="serversideinstallation-keywords-opensrf">\r
162                                                 <title>Keyword Targets for OpenSRF <application>"make"</application> Command</title>\r
163                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
164                                                         <colspec colnum="1" colwidth="1.0*"/>\r
165                                                         <colspec colnum="2" colwidth="3.0*"/>\r
166                                                         <thead>\r
167                                                                 <row>\r
168                                                                         <entry>Keyword</entry>\r
169                                                                         <entry>Description</entry>\r
170                                                                 </row>\r
171                                                         </thead>\r
172                                                         <tbody>\r
173                                                                 <row>\r
174                                                                         <entry>debian-etch</entry>\r
175                                                                         <entry>for Debian Etch (4.0)</entry>\r
176                                                                 </row>\r
177                                                                 <row>\r
178                                                                         <entry>debian-lenny</entry>\r
179                                                                         <entry>for Debian Lenny (5.0)</entry>\r
180                                                                 </row>\r
181                                                                 <row>\r
182                                                                         <entry>ubuntu-hardy</entry>\r
183                                                                         <entry>for Ubuntu Hardy Heron (8.04)</entry>\r
184                                                                 </row>\r
185                                                                 <row>\r
186                                                                         <entry>ubuntu-karmic</entry>\r
187                                                                         <entry>for Ubuntu Karmic Koala (9.10)</entry>\r
188                                                                 </row>\r
189                                                                 <row>\r
190                                                                         <entry>ubuntu-lucid</entry>\r
191                                                                         <entry>for Ubuntu Lucid Lynx (10.04)</entry>\r
192                                                                 </row>\r
193                                                         </tbody>\r
194                                                 </tgroup>\r
195                                         </table>\r
196                                         <para>This will install a number of packages on the system that are required by OpenSRF,\r
197                                         including some Perl modules from CPAN. You can say <literal>No</literal> to the initial\r
198                                         CPAN configuration prompt to allow it to automatically configure itself to download and\r
199                                         install Perl modules from CPAN. The CPAN installer will ask you a number of times whether\r
200                                         it should install prerequisite modules - say <literal>Yes</literal>.</para>\r
201                                 </step>\r
202                                 <step>\r
203                                         <title>Build OpenSRF</title>\r
204                                         <substeps>\r
205                                                 <step>\r
206                                                         <title>Configure OpenSRF</title>\r
207                                                         <para>As the <systemitem class="username">opensrf</systemitem>\r
208                                                         user, return to the OpenSRF build directory and use the\r
209                                                         <command>configure</command> utility to prepare for the next\r
210                                                         step of compiling and linking the software. If you wish to\r
211                                                         include support for Python and Java, add the configuration\r
212                                                         options <option>--enable-python</option> and\r
213                                                         <option>--enable-java</option>, respectively:</para>\r
214 <screen>\r
215 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>\r
216 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>\r
217 <userinput>make</userinput>\r
218 </screen>\r
219                                                 </step>\r
220                                                 <step>\r
221                                                         <title>Compile, Link and Install OpenSRF</title>\r
222                                                         <para>As the <systemitem class="username">root</systemitem>\r
223                                                         user, return to the OpenSRF build directory and use the\r
224                                                         <command>make</command> utility to compile, link and install\r
225                                                         OpenSRF:</para>\r
226 <screen>\r
227 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>\r
228 <userinput>make install</userinput>\r
229 </screen>\r
230                                                 </step>\r
231                                                 <step>\r
232                                                         <title>Update the System Dynamic Library Path</title>\r
233                                                         <para>You must update the system dynamic library path to force\r
234                                                         your system to recognize the newly installed libraries. As the\r
235                                                         <systemitem class="username">root</systemitem> user, do this by\r
236                                                         creating the new file\r
237                                                         <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a\r
238                                                         new library path, then run the command\r
239                                                         <command>ldconfig</command> to automatically read the file and\r
240                                                         modify the system dynamic library path:</para>\r
241 <screen>\r
242 <userinput>echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf</userinput>\r
243 <userinput>ldconfig</userinput>\r
244 </screen>\r
245                                                 </step>\r
246                                                 <step><title>Define Public and Private OpenSRF Domains</title><para>You must define your public and private OpenSRF\r
247                                                         domains. For security purposes, OpenSRF uses Jabber domains to\r
248                                                         separate services into public and private realms. Throughout\r
249                                                         these instructions, we will use the example domains <systemitem class="domainname">public.localhost</systemitem> for the public\r
250                                                         domain and <systemitem class="domainname">private.localhost</systemitem> for the\r
251                                                         private domain. On a single-server system, the easiest way to\r
252                                                         define public and private domains is to define separate host\r
253                                                         names by adding entries to the file\r
254                                                         <filename>/etc/hosts</filename>.</para> <para>As the <systemitem class="username">root</systemitem> user, edit the file\r
255                                                         <filename>/etc/hosts</filename> and add the following entries\r
256                                                         for our example domains:</para>\r
257 <screen>\r
258 <userinput>127.0.1.2    public.localhost        public</userinput>\r
259 <userinput>127.0.1.3    private.localhost       private</userinput>\r
260 </screen>\r
261                                                 </step>\r
262                                                 <step>\r
263                                                         <title>Change File Ownerships</title>\r
264                                                         <para>As the <systemitem class="username">root</systemitem>\r
265                                                         user, change the ownership of all files installed in the\r
266                                                         directory <filename class="directory">/openils</filename> to the\r
267                                                         user <systemitem class="username">opensrf</systemitem>:</para>\r
268                                                         <screen>\r
269                                                                 <userinput>chown -R opensrf:opensrf /openils</userinput>\r
270                                                         </screen>\r
271                                                 </step>\r
272                                         </substeps>\r
273                                 </step>\r
274                                 <step>\r
275                                         <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>\r
276                                         <para>As the <systemitem class="username">root</systemitem> user, stop the\r
277                                         <systemitem class="service">ejabberd</systemitem> service:</para>\r
278 <screen>\r
279 <userinput>/etc/init.d/ejabberd stop</userinput>\r
280 </screen>\r
281                                         <para>If <systemitem class="service">ejabberd</systemitem> reports that it is\r
282                                         already stopped, it may have run into a problem starting back at the\r
283                                         installation stage. One possible fix is to kill any remaining\r
284                                         <systemitem class="daemon">beam</systemitem> and \r
285                                         <systemitem class="daemon">epmd</systemitem> processes, then edit the\r
286                                         configuration file <filename>/etc/ejabberd/ejabberd.cfg</filename> \r
287                                         to hardcode a domain:</para>\r
288 <screen>\r
289 <userinput>epmd -kill</userinput>\r
290 <userinput>killall beam; killall beam.smp</userinput>\r
291 <userinput>rm /var/lib/ejabberd/*</userinput>\r
292 <userinput>echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd</userinput>\r
293 </screen>\r
294                                 </step>\r
295                                 <step>\r
296                                         <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>\r
297                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file\r
298                                         <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following\r
299                                         changes:</para>\r
300                                         <itemizedlist>\r
301                                                 <listitem>\r
302                                                         <para>Change\r
303                                                         <screen><userinput>{hosts, ["localhost"]}.</userinput></screen>\r
304                                                         to:\r
305                                                         <screen><userinput>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</userinput></screen></para>\r
306                                                 </listitem>\r
307                                                 <listitem>\r
308                                                         <para>Change\r
309                                                         <screen><userinput>{max_user_sessions, 10}.</userinput></screen> to\r
310                                                         <screen><userinput>{max_user_sessions, 10000}.</userinput></screen></para>\r
311                                                         <para>If you see something like this instead:\r
312                                                         <screen><userinput>{access, max_user_sessions, [{10, all}]}.</userinput></screen>\r
313                                                         then change it to:\r
314                                                         <screen><userinput>{access, max_user_sessions, [{10000, all}]}</userinput></screen></para>\r
315                                                 </listitem>\r
316                                                 <listitem>\r
317                                                         <para>Change all three occurrences of <literal>max_stanza_size</literal>\r
318                                                         to<literal>2000000</literal>.</para>\r
319                                                 </listitem>\r
320                                                 <listitem>\r
321                                                         <para>Change both occurrences of <literal>maxrate</literal> to\r
322                                                         <literal>500000</literal>.</para>\r
323                                                 </listitem>\r
324                                                 <listitem>\r
325                                                         <para>Comment out the line <literal>{mod_offline, []}</literal> \r
326                                                         by placing two <literal>%</literal> comment signs in front.</para>\r
327                                                 </listitem>\r
328                                         </itemizedlist>\r
329                                 </step>\r
330                                 <step xml:id="serversideinstallation-opensrf-continued">\r
331                                         <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>\r
332                                         <para>As the <systemitem class="username">root</systemitem> user, restart the\r
333                                         <systemitem class="service">ejabberd</systemitem> service to test the\r
334                                         configuration changes and to register your users:</para>\r
335 <screen>\r
336 <userinput>/etc/init.d/ejabberd start</userinput>\r
337 </screen>\r
338                                 </step>\r
339                                 <step>\r
340                                         <title>Register <systemitem class="username">router</systemitem> and\r
341                                                 <systemitem class="username">ejabberd</systemitem> users</title>\r
342                                         <para>On each domain, you need two \r
343                                         <systemitem class="service">ejabberd</systemitem> users to manage \r
344                                         the OpenSRF communications:</para>\r
345                                         <itemizedlist>\r
346                                                 <listitem>\r
347                                                         <para>a <systemitem class="username">router</systemitem> user,\r
348                                                         to whom all requests to connect to an OpenSRF service will be\r
349                                                         routed; this <systemitem class="service">ejabberd</systemitem>\r
350                                                         user must be named <systemitem class="username">router</systemitem></para>\r
351                                                 </listitem>\r
352                                                 <listitem>\r
353                                                         <para>an <systemitem class="username">opensrf</systemitem> user,\r
354                                                         which clients use to connect to OpenSRF services; this user can\r
355                                                         be named anything you like, but we will use\r
356                                                         <literal>opensrf</literal> in our examples</para>\r
357                                                 </listitem>\r
358                                         </itemizedlist>\r
359                                         <para>As the <systemitem class="username">root</systemitem> user, use the\r
360                                         <command>ejabberdctl</command> utility to register your ejabber users\r
361                                         <systemitem class="username">router</systemitem> and\r
362                                         <systemitem class="username">opensrf</systemitem> for the OpenSRF router service\r
363                                         on each domain. The users should have different passwords on each domain.\r
364                                         These users will correspond to those configured in the file\r
365                                         <filename>/openils/conf/opensrf_core.xml</filename>:</para>\r
366 <programlisting language="xml">\r
367 <![CDATA[\r
368 # The syntax for registering a user with ejabberdctl is\r
369 # ejabberdctl register <user> <domain> <password>\r
370 #\r
371 ejabberdctl register router private.localhost  <password>\r
372 ejabberdctl register opensrf private.localhost <password>\r
373 ejabberdctl register router public.localhost   <password>\r
374 ejabberdctl register opensrf public.localhost  <password>\r
375 ]]>\r
376 </programlisting>\r
377                                 </step>\r
378                                 <step>\r
379                                         <title>Create configuration files</title>\r
380                                         <para>As the <systemitem class="username">opensrf</systemitem> user, use the\r
381                                         example templates to create the configuration files\r
382                                         <filename>/openils/conf/opensrf_core.xml</filename> and\r
383                                         <filename>/openils/conf/opensrf.xml</filename> from the example templates:</para>\r
384 <screen>\r
385 <userinput>cd /openils/conf</userinput>\r
386 <userinput>cp opensrf.xml.example      opensrf.xml</userinput>\r
387 <userinput>cp opensrf_core.xml.example opensrf_core.xml</userinput>\r
388 </screen>\r
389                                 </step>\r
390                                 <step>\r
391                                         <title>Change Jabber usernames and passwords</title>\r
392                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the\r
393                                         OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>\r
394                                         to update the Jabber usernames and passwords to match the values shown in the\r
395                                         following table. The left-hand side of <xref linkend="serversideinstallation-xpath-table-1"/>\r
396                                         shows common XPath syntax to indicate the approximate position within the XML\r
397                                         file that needs changes. The right-hand side of the table shows the replacement\r
398                                         values.</para>\r
399                                         <table xml:id="serversideinstallation-xpath-table-1">\r
400                                                 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>\r
401                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
402                                                         <colspec colname="Xpath" colnum="1" colwidth="1.5*"/>\r
403                                                         <colspec colname="Value" colnum="2" colwidth="2.0*"/>\r
404                                                         <thead>\r
405                                                                 <row>\r
406                                                                         <entry>XPath location</entry>\r
407                                                                         <entry>Value</entry>\r
408                                                                 </row>\r
409                                                         </thead>\r
410                                                         <tbody>\r
411                                                                 <row>\r
412                                                                         <entry>/config/opensrf/username</entry>\r
413                                                                         <entry>\r
414                                                                                 <systemitem class="username">opensrf</systemitem>\r
415                                                                         </entry>\r
416                                                                 </row>\r
417                                                                 <row>\r
418                                                                         <entry>/config/opensrf/passwd </entry>\r
419                                                                         <entry>password for\r
420                                                                         <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">opensrf</systemitem> user\r
421                                                                         </entry>\r
422                                                                 </row>\r
423                                                                 <row>\r
424                                                                         <entry>/config/gateway/username</entry>\r
425                                                                         <entry>\r
426                                                                                 <systemitem class="username">opensrf</systemitem>\r
427                                                                         </entry>\r
428                                                                 </row>\r
429                                                                 <row>\r
430                                                                         <entry>/config/gateway/passwd</entry>\r
431                                                                         <entry>password for\r
432                                                                         <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">opensrf</systemitem> user\r
433                                                                         </entry>\r
434                                                                 </row>\r
435                                                                 <row>\r
436                                                                         <entry>/config/routers/router/transport, \r
437                                                                         first entry where transport/server == public.localhost: \r
438                                                                         username</entry>\r
439                                                                         <entry>\r
440                                                                                 <systemitem class="username">router</systemitem>\r
441                                                                         </entry>\r
442                                                                 </row>\r
443                                                                 <row>\r
444                                                                         <entry>/config/routers/router/transport,\r
445                                                                         first entry where transport/server == public.localhost: \r
446                                                                         password</entry>\r
447                                                                         <entry>password for \r
448                                                                         <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">router</systemitem> user\r
449                                                                         </entry>\r
450                                                                 </row>\r
451                                                                 <row>\r
452                                                                         <entry>/config/routers/router/transport,\r
453                                                                         second entry where transport/server == private.localhost:\r
454                                                                         username</entry>\r
455                                                                         <entry>\r
456                                                                                 <systemitem class="username">router</systemitem>\r
457                                                                         </entry>\r
458                                                                 </row>\r
459                                                                 <row>\r
460                                                                         <entry>/config/routers/router/transport,\r
461                                                                         second entry where transport/server == private.localhost:\r
462                                                                         password</entry>\r
463                                                                         <entry>password for \r
464                                                                         <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">router</systemitem> user\r
465                                                                         </entry>\r
466                                                                 </row>\r
467                                                         </tbody>\r
468                                                 </tgroup>\r
469                                         </table>\r
470                                         <para>You also need to specify the domains from which \r
471                                         <systemitem class="service">OpenSRF</systemitem> will accept and to which \r
472                                         <systemitem class="service">OpenSRF</systemitem> will make connections. \r
473                                         If you are installing <application>OpenSRF</application> on a single server\r
474                                          and using the <systemitem class="domainname">private.localhost</systemitem> / \r
475                                         <systemitem class="domainname">public.localhost</systemitem> domains, \r
476                                         these will already be set to the correct values. Otherwise, search and replace\r
477                                         to match your values.</para>\r
478                                 </step>\r
479                                 <step>\r
480                                         <title>Set location of persistent database</title>\r
481                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the\r
482                                         file <filename>/openils/conf/opensrf.xml</filename> to set the location of the\r
483                                         persistent database in the <literal>dbfile</literal> element near the end of the\r
484                                         file:</para>\r
485 <programlisting language="xml">\r
486 <![CDATA[\r
487 <!-- Example of an app-specific setting override -->\r
488 <opensrf.persist>\r
489   <app_settings>\r
490     <dbfile>/tmp/persist.db</dbfile>\r
491   </app_settings>\r
492 </opensrf.persist>\r
493 ]]>\r
494 </programlisting>\r
495                                 </step>\r
496                                 <step>\r
497                                         <title>Create Configuration Files for Users Needing <command>srfsh</command></title>\r
498                                         <para>In this section you will set up a special configuration file for each user\r
499                                         who will need to run the <command>srfsh</command> (pronounced <emphasis>surf\r
500                                         shell</emphasis>) utility.</para>\r
501                                         <para>The software installation will automatically create\r
502                                         <command>srfsh</command>. This is a command line diagnostic tool for testing and\r
503                                         interacting with <application>OpenSRF</application>. It will be used in a future\r
504                                         step to complete and test the Evergreen installation. See \r
505                                         <xref linkend="serversideinstallation-testing"/> for further information.</para>\r
506                                         <para>As the <systemitem class="username">root</systemitem> user, copy the short\r
507                                         sample configuration file <filename>/openils/conf/srfsh.xml.example</filename>\r
508                                         to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home\r
509                                         directory of each user who will use <command>srfsh</command>. Finally, edit each\r
510                                         file <filename>.srfsh.xml</filename> and make the following changes. When you\r
511                                         finish, remember to change the owner of the file to match the owner of the home\r
512                                         directory.</para>\r
513                                         <itemizedlist>\r
514                                                 <listitem>Modify <literal>domain</literal> to be the router hostname\r
515                                                 (following our domain examples,\r
516                                                 <systemitem class="domainname">private.localhost</systemitem> will give\r
517                                                 <command>srfsh</command> access to all OpenSRF services, while\r
518                                                 <systemitem class="domainname">public.localhost</systemitem> will only\r
519                                                 allow access to those OpenSRF services that are publicly\r
520                                                 exposed).</listitem>\r
521                                                 <listitem>Modify <literal>username</literal> and\r
522                                                 <literal>password</literal> to match the <literal>opensrf</literal>\r
523                                                 Jabber user for the chosen domain</listitem>\r
524                                                 <listitem>Modify <literal>logfile</literal> to be the full path for a\r
525                                                 log file to which the user has write access</listitem>\r
526                                                 <listitem>Modify <literal>loglevel</literal> as needed for testing</listitem>\r
527                                         </itemizedlist>\r
528 <programlisting language="xml">\r
529 <![CDATA[\r
530 <?xml version="1.0"?>\r
531 <!-- This file follows the standard bootstrap config file layout -->\r
532 <!-- found in opensrf_core.xml -->\r
533 <srfsh>\r
534 <router_name>router</router_name>\r
535 <domain>private.localhost</domain>\r
536 <username>opensrf</username>\r
537 <passwd>privsrf</passwd>\r
538 <port>5222</port>\r
539 <logfile>/tmp/srfsh.log</logfile>\r
540 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->\r
541 <loglevel>4</loglevel>\r
542 </srfsh>\r
543 ]]>\r
544 </programlisting>\r
545                                 </step>\r
546                                 <step>\r
547                                         <title>Modify Environmental Variable PATH for\r
548                                                 <systemitem class="username">opensrf</systemitem> User</title>\r
549                                         <para>As the <systemitem class="username">opensrf</systemitem> user, modify the\r
550                                         environmental variable <envar>PATH</envar> by adding a new file path to the\r
551                                         <systemitem class="username">opensrf</systemitem> user's shell configuration\r
552                                         file <filename>.bashrc</filename>:</para>\r
553 <screen>\r
554 <userinput>echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc</userinput>\r
555 </screen>\r
556                                 </step>\r
557                                 <step>\r
558                                         <title>Start OpenSRF</title>\r
559                                         <para>As the <systemitem class="username">root</systemitem> user, start the\r
560                                         <systemitem class="service">ejabberd</systemitem> and \r
561                                         <systemitem class="service">memcached</systemitem> services:</para>\r
562                                         <screen>\r
563                                                 <userinput>/etc/init.d/ejabberd start</userinput>\r
564                                                 <userinput>/etc/init.d/memcached start</userinput>\r
565                                         </screen>\r
566                                         <para>Finally, as the <systemitem class="username">opensrf</systemitem> user,\r
567                                         start OpenSRF. Use "-l" to force hostname to be "localhost":</para>\r
568 <screen>\r
569 <userinput>osrf_ctl.sh -l -a start_all</userinput>\r
570 </screen>\r
571                                         <note>\r
572                                                 <para>If you receive the error message <errortext>bash: osrf_ctl.sh:\r
573                                                 command not found</errortext>, then your environment variable\r
574                                                 <envar>PATH</envar> does not include the \r
575                                                 <filename class="directory">/openils/bin</filename> directory;\r
576                                                  this should have been set by <filename>.bashrc</filename> when you \r
577                                                 logged in as the <systemitem class="username">opensrf</systemitem> user, \r
578                                                 but you can manually set it using the following command:</para>\r
579 <screen>\r
580 <userinput>export PATH=$PATH:/openils/bin</userinput>\r
581 </screen>\r
582                                         </note>\r
583                                         <para>You can also start Evergreen <emphasis role="bold">without</emphasis> the\r
584                                         <option>-l</option> flag, but <command>osrf_ctl.sh</command> must know the fully\r
585                                         qualified domain name for the system on which it will execute. That hostname may\r
586                                         have been specified in the configuration file <filename>opensrf.xml</filename>,\r
587                                         which you configured in a previous step.</para>\r
588                                 </step>\r
589                                 <step>\r
590                                         <title>Test connections to OpenSRF</title>\r
591                                         <para>Once you have installed and started OpenSRF, as the \r
592                                         <systemitem class="username">root</systemitem> user, test your connection to \r
593                                         <systemitem class="service">OpenSRF</systemitem> using the <command>srfsh</command> \r
594                                         utility and trying to call the <command>add</command> method on the OpenSRF \r
595                                         <systemitem class="service">math</systemitem> service:</para>\r
596 <screen>\r
597 <userinput>/openils/bin/srfsh</userinput>\r
598 <computeroutput>\r
599 srfsh#\r
600 request opensrf.math add 2 2\r
601 Received Data: 4\r
602 ------------------------------------\r
603 Request Completed Successfully\r
604 Request Time in seconds: 0.007519\r
605 ------------------------------------\r
606 \r
607 srfsh#\r
608 </computeroutput>\r
609 </screen>\r
610                                         <para>For other <command>srfsh</command> commands, type in\r
611                                         <userinput>help</userinput> at the prompt.</para>\r
612                                 </step>\r
613                                 <step>\r
614                                         <title>Stopping OpenSRF</title>\r
615                                         <para>As the <systemitem class="username">opensrf</systemitem> user, stop OpenSRF:</para>\r
616 <screen>\r
617 <userinput>osrf_ctl.sh -l -a stop_all</userinput>\r
618 </screen>\r
619                                 </step>\r
620                         </procedure>\r
621                 </section>\r
622                 <section xml:id="serversideinstallation-ubuntudebian">\r
623                         <title>Installing Evergreen 1.6.1.x On <systemitem class="osname">Ubuntu</systemitem> or\r
624                                 <systemitem class="osname">Debian</systemitem></title>\r
625                         <para>This section outlines the installation process for the latest stable version of\r
626                         Evergreen.</para>\r
627                         <para>In this section you will download, unpack, install, configure and test the Evergreen\r
628                         system, including the Evergreen server and the PostgreSQL database system. You will make several\r
629                         configuration changes and adjustments to the software, including updates to configure the system\r
630                         for your own locale, and some updates needed to work around a few known issues.</para>\r
631                         <note>\r
632                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit)\r
633                                 architectures. There may be differences between the Desktop and Server editions of\r
634                                 <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server\r
635                                 edition.</para>\r
636                                 <para>In the following instructions, you are asked to perform certain steps as \r
637                                 either the <systemitem class="username">root</systemitem> user, the \r
638                                 <systemitem class="username">opensrf</systemitem> user, or the \r
639                                 <systemitem class="username">postgres</systemitem> user.</para>\r
640                                 <itemizedlist>\r
641                                         <listitem>\r
642                                                 <para><systemitem class="osname">Debian</systemitem> -- To become the\r
643                                                 <systemitem class="username">root</systemitem> user, issue the command\r
644                                                 <command>su -</command> and enter the password of the \r
645                                                 <systemitem class="username">root</systemitem> user.</para>\r
646                                         </listitem>\r
647                                         <listitem>\r
648                                                 <para><systemitem class="osname">Ubuntu</systemitem> -- To become the\r
649                                                 <systemitem class="username">root</systemitem> user, issue the command\r
650                                                 <command>sudo su -</command> and enter the password of the \r
651                                                 <systemitem class="username">root</systemitem> user.</para>\r
652                                         </listitem>\r
653                                 </itemizedlist>\r
654                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a\r
655                                 different user, issue the command <command>su - USERNAME</command>. For example, to\r
656                                 switch from the <systemitem class="username">root</systemitem> user to the \r
657                                 <systemitem class="username">opensrf</systemitem> user, issue the command \r
658                                 <command>su - opensrf</command>. Once you have become a non-root user, to become the\r
659                                 <systemitem class="username">root</systemitem> user again, simply issue the command\r
660                                 <command>exit</command>.</para>\r
661                         </note>\r
662                         <procedure>\r
663                                 <step>\r
664                                         <title>Install OpenSRF</title>\r
665                                         <para>Evergreen software is integrated with and depends on the Open Service\r
666                                         Request Framework (OpenSRF) software system. For further information on\r
667                                         installing, configuring and testing OpenSRF, see \r
668                                         <xref linkend="serversideinstallation-opensrf"/>.</para>\r
669                                         <para>Follow the steps outlined in that section and run the specified tests to\r
670                                         ensure that OpenSRF is properly installed and configured. Do not continue with\r
671                                         any further Evergreen installation steps until you have verified that OpenSRF\r
672                                         has been successfully installed.</para>\r
673                                 </step>\r
674                                 <step>\r
675                                         <title>Download and Unpack Latest Evergreen Version</title>\r
676                                         <para>As the <systemitem class="username">opensrf</systemitem> user, download\r
677                                         and extract the latest version of Evergreen. The latest version can be found here:\r
678                                         <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz"></ulink></para>\r
679 <screen>\r
680 <userinput>wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz</userinput>\r
681 <userinput>tar zxf Evergreen-ILS-1.6.1.2.tar.gz</userinput>\r
682 </screen>\r
683                                         <para>The new directory\r
684                                         <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.1.2</filename>\r
685                                         will be created.</para>\r
686                                 </step>\r
687                                 <step>\r
688                                         <title>Install Prerequisites to Build Evergreen</title>\r
689                                         <para>In this section you will install and configure a set of prerequisites that\r
690                                         will be used to build Evergreen. In a following step you will actually build the\r
691                                         Evergreen software using the <command>make</command> utility.</para>\r
692                                         <para>As the <systemitem class="username">root</systemitem> user, enter the\r
693                                         commands show below to build the prerequisites from the software distribution\r
694                                         that you just downloaded and unpacked. Remember to replace\r
695                                         <emphasis>[DISTRIBUTION]</emphasis> in the example with the keyword\r
696                                         corresponding to the name of the <systemitem class="osname">Linux</systemitem>\r
697                                         distribution listed in the distribution keywords table \r
698                                         <xref linkend="serversideinstallation-keywords-evergreen"/> .</para>\r
699 <screen>\r
700 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>\r
701 <userinput>make -f Open-ILS/src/extras/Makefile.install [DISTRIBUTION]</userinput>\r
702 </screen>\r
703                                         <table xml:id="serversideinstallation-keywords-evergreen">\r
704                                                 <title>Keyword Targets for Evergreen <application>"make"</application> Command</title>\r
705                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
706                                                         <colspec colnum="1" colwidth="1.0*"/>\r
707                                                         <colspec colnum="2" colwidth="3.0*"/>\r
708                                                         <thead>\r
709                                                                 <row>\r
710                                                                         <entry>Keyword</entry>\r
711                                                                         <entry>Description</entry>\r
712                                                                 </row>\r
713                                                         </thead>\r
714                                                         <tbody>\r
715                                                                 <row>\r
716                                                                         <entry>debian-etch</entry>\r
717                                                                         <entry>for Debian Etch (4.0)</entry>\r
718                                                                 </row>\r
719                                                                 <row>\r
720                                                                         <entry>debian-lenny</entry>\r
721                                                                         <entry>for Debian Lenny (5.0)</entry>\r
722                                                                 </row>\r
723                                                                 <row>\r
724                                                                         <entry>ubuntu-hardy</entry>\r
725                                                                         <entry>for Ubuntu Hardy Heron (8.04)</entry>\r
726                                                                 </row>\r
727                                                                 <row>\r
728                                                                         <entry>ubuntu-karmic</entry>\r
729                                                                         <entry>for Ubuntu Karmic Koala (9.10)</entry>\r
730                                                                 </row>\r
731                                                                 <row>\r
732                                                                         <entry>ubuntu-karmic</entry>\r
733                                                                         <entry>for Ubuntu Lucid Lynx (10.04)</entry>\r
734                                                                 </row>\r
735                                                         </tbody>\r
736                                                 </tgroup>\r
737                                         </table>\r
738                                 </step>\r
739                                 <step xml:id="serversideinstallation-postgresql-default">\r
740                                         <title>(OPTIONAL) Install the PostgreSQL Server</title>\r
741                                         <para>Since the PostgreSQL server is usually a standalone server in multi-server\r
742                                         production systems, the prerequisite installer Makefile in the previous step\r
743                                         does not automatically install PostgreSQL. You must install the PostgreSQL server\r
744                                         yourself, either on the same system as Evergreen itself or on another system.\r
745                                         If your PostgreSQL server is on a different system, just skip this step.</para>\r
746                                         <para>For further information on manually installing PostgreSQL, visit the official\r
747                                         <link xl:href="http://www.postgresql.org/">PostgreSQL Site</link>.</para>\r
748                                         <para>If your PostgreSQL server will be on the same system as your Evergreen\r
749                                         software, then as the <systemitem class="username">root</systemitem> user\r
750                                         install the required PostgreSQL server packages:</para>\r
751                                         <para>For <systemitem class="osname">Debian Lenny</systemitem> and \r
752                                         <systemitem class="osname">Ubuntu Hardy (8.04)</systemitem>:</para>\r
753 <screen>\r
754 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83</userinput>\r
755 </screen>\r
756                                         <para>For <systemitem class="osname">Ubuntu Karmic (9.10)</systemitem> and\r
757                                         <systemitem class="osname">Ubuntu Lucid (10.04)</systemitem>:</para>\r
758 <screen>\r
759 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84</userinput>\r
760 </screen>\r
761                                         <note>\r
762                                                 <para>PostgreSQL versions 8.3 or 8.4 are the recommended versions to work \r
763                                                 with Evergreen 1.6. If you have an older version of PostgreSQL, you should\r
764                                                 upgrade before installing Evergreen. To find the running version of\r
765                                                 PostgreSQL, as the <systemitem class="username">postgres</systemitem> \r
766                                                 user, run the <command>psql</command>. Then type <userinput>SELECT\r
767                                                 version();</userinput> to get detailed information about your version \r
768                                                 of PostgreSQL.</para>\r
769                                         </note>\r
770                                 </step>\r
771                                 <step performance="optional">\r
772                                         <title>Install Perl Modules on PostgreSQL Server</title>\r
773                                         <para>If PostgreSQL is running on the same system as your Evergreen software,\r
774                                         then the Perl modules will automatically be available. Just skip this step.\r
775                                         Otherwise, continue if your PostgreSQL server is running on another system.</para>\r
776                                         <para>You will need to install several Perl modules on the other system. As the\r
777                                         <systemitem class="username">root</systemitem> user install the following Perl\r
778                                         modules:</para>\r
779 <screen>\r
780 <userinput># first, ensure the gcc compiler is installed:</userinput>\r
781 <userinput>apt-get install gcc</userinput>\r
782 <userinput># then install the Perl modules:</userinput>\r
783 <userinput>perl -MCPAN -e shell</userinput>\r
784 <prompt>cpan></prompt>\r
785 <userinput>install JSON::XS</userinput>\r
786 <prompt>cpan></prompt>\r
787 <userinput>install MARC::Record</userinput>\r
788 <prompt>cpan></prompt>\r
789 <userinput>install MARC::File::XML</userinput>\r
790 </screen>\r
791                                         <para>For more information on installing Perl Modules vist the official\r
792                                         <link xl:href="http://www.cpan.org/">CPAN</link> site.</para>\r
793                                 </step>\r
794                                 <step>\r
795                                         <title>Update the System Dynamic Library Path</title>\r
796                                         <para>You must update the system dynamic library path to force your system to\r
797                                         recognize the newly installed libraries. As the <systemitem class="username">root</systemitem> user, create a file named\r
798                                         /etc/ld.so.conf.d/eg.conf containing the new library paths:</para>\r
799 <programlisting>\r
800 /usr/local/lib\r
801 /usr/local/lib/dbd\r
802 </programlisting>\r
803                                         <para>Then run the command <command>ldconfig</command> to automatically read the\r
804                                         file and modify the system dynamic library path:</para>\r
805 <screen>\r
806 <userinput>ldconfig</userinput>\r
807 </screen>\r
808                                 </step>\r
809                                 <step performance="optional">\r
810                                         <title>(OPTIONAL) Restart the PostgreSQL Server</title>\r
811                                         <para>If PostgreSQL is running on the same system as the rest of Evergreen, as\r
812                                         the <systemitem class="username">root</systemitem> user you must restart\r
813                                         PostgreSQL to re-read the new library paths just configured. If PostgreSQL is\r
814                                         running on another system, you may skip this step. As the <systemitem class="username">opensrf</systemitem> user, execute the following command, where\r
815                                         <literal>[PGSQL_VERSION]</literal> is your installed PostgreSQL version\r
816                                         (e.g. <literal>8.3</literal>):</para>\r
817 <screen>\r
818 <userinput>/etc/init.d/postgresql-[PGSQL_VERSION] restart</userinput>\r
819 </screen>\r
820                                 </step>\r
821                                 <step xml:id="serversideinstallation-configure">\r
822                                         <title>Configure Evergreen</title>\r
823                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to\r
824                                         the Evergreen build directory and use the <command>configure</command> and\r
825                                         <command>make</command> utilities to configure Evergreen so it can be compiled\r
826                                         and linked in the next step:</para>\r
827 <screen>\r
828 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>\r
829 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>\r
830 <userinput>make</userinput>\r
831 </screen>\r
832                                 </step>\r
833                                 <step xml:id="serversideinstallation-compilingevergreen">\r
834                                         <title>Compile, Link and Install Evergreen</title>\r
835                                         <para>In this step you will actually compile, link and install Evergreen and the\r
836                                         default Evergreen Staff Client.</para>\r
837                                         <para>As the <systemitem class="username">root</systemitem> user, return to the\r
838                                         Evergreen build directory and use the <command>make</command> utility as shown\r
839                                         below. The Staff Client will also be automatically built, but you must remember\r
840                                         to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of\r
841                                         the Staff Client you will use to connect to the Evergreen server.</para>\r
842                                         <para>For further information on manually building the Staff Client, see \r
843                                         <xref linkend="staffclientinstallation-building-staffclient"/>.</para>\r
844 <screen>\r
845 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>\r
846 <userinput>make STAFF_CLIENT_BUILD_ID=rel_1_6_1_2 install</userinput>\r
847 </screen>\r
848                                         <para>The above commands will create a new subdirectory <filename class="directory">/openils/var/web/xul/rel_1_6_1_2</filename> containing the\r
849                                         Staff Client.</para>\r
850                                         <para>To complete the Staff Client installation, as the <systemitem class="username">root</systemitem> user create a symbolic link named\r
851                                         <emphasis>server</emphasis> in the head of the Staff Client directory <filename class="directory">/openils/var/web/xul</filename> that points to the\r
852                                         subdirectory <filename class="directory">/server</filename> of the new Staff\r
853                                         Client build:</para>\r
854 <screen>\r
855 <userinput>cd /openils/var/web/xul</userinput>\r
856 <userinput>ln -sf rel_1_6_1_2/server server</userinput>\r
857 </screen>\r
858                                 </step>\r
859                                 <step>\r
860                                         <title>Copy the OpenSRF Configuration Files</title>\r
861                                         <para>As the <systemitem class="username">root</systemitem> user, copy the\r
862                                         example OpenSRF configuration files into place. This replaces the configuration\r
863                                         files that you set up in a previous step when you installed and tested\r
864                                         OpenSRF. You should also create backup copies of the old files for\r
865                                         troubleshooting purposes. Finally, change the ownership on the installed files\r
866                                         to the <systemitem class="username">opensrf</systemitem> user:</para>\r
867 <screen>\r
868 <userinput>cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml</userinput>\r
869 <userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput>\r
870 <userinput>cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml</userinput>\r
871 <userinput>chown -R opensrf:opensrf /openils/</userinput>\r
872 </screen>\r
873                                 </step>\r
874                                 <step>\r
875                                         <title>Create and Configure PostgreSQL Database</title>\r
876                                         <para>In this step you will create the Evergreen database. In the commands\r
877                                         below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis> repository to match your PostgreSQL server\r
878                                         layout. For example, if you built PostgreSQL from source the path would be\r
879                                         <filename class="directory">/usr/local/share/contrib</filename>; if you\r
880                                         installed the PostgreSQL 8.3 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>, the path would be \r
881                                         <systemitem class="directory">/usr/share/postgresql/8.3/contrib/</systemitem>.</para>\r
882                                         <substeps>\r
883                                                 <step>\r
884                                                         <para>\r
885                                                                 <emphasis role="bold">Create and configure the database</emphasis>\r
886                                                         </para>\r
887                                                         <para>As the <systemitem class="username">postgres</systemitem>\r
888                                                         user on the PostgreSQL system create the PostgreSQL database,\r
889                                                         then set some internal paths:</para>\r
890                                                         <para>Create the database:</para>\r
891 <screen>\r
892 <userinput>createdb -E UNICODE evergreen</userinput>\r
893 <userinput>createlang plperl   evergreen</userinput>\r
894 <userinput>createlang plperlu  evergreen</userinput>\r
895 <userinput>createlang plpgsql  evergreen</userinput>\r
896 </screen>\r
897                                                         <para>Adjust the paths as shown, where\r
898                                                         <literal>[PGSQL_VERSION]</literal> is your installed PostgreSQL\r
899                                                         version (e.g. <literal>8.3</literal>).</para>\r
900 <screen>\r
901 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/tablefunc.sql evergreen</userinput>\r
902 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/tsearch2.sql  evergreen</userinput>\r
903 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/pgxml.sql     evergreen</userinput>\r
904 </screen>\r
905                                                 </step>\r
906                                                 <step>\r
907                                                         <title>Create <systemitem class="username">evergreen</systemitem> PostgreSQL user</title>\r
908                                                         <para>As the <systemitem class="username">postgres</systemitem>\r
909                                                         user on the PostgreSQL system, create a new PostgreSQL user\r
910                                                         named <systemitem class="username">evergreen</systemitem> and\r
911                                                         assign a password:</para>\r
912 <screen>\r
913 <userinput>createuser -P -s evergreen</userinput>\r
914 <prompt>Enter password for new role: MYNEWPASSWORD</prompt>\r
915 <prompt>Enter it again: MYNEWPASSWORD</prompt>\r
916 </screen>\r
917                                                 </step>\r
918                                                 <step>\r
919                                                         <title>Create Database Schema</title>\r
920                                                         <para>As the <systemitem class="username">root</systemitem>\r
921                                                         user, create the database schema and configure your system with\r
922                                                         the corresponding database authentication details for the\r
923                                                         <emphasis>evergreen</emphasis> database user that you created in\r
924                                                         the previous step.</para>\r
925                                                         <para>Enter the following commands and replace\r
926                                                         <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and\r
927                                                         <emphasis>DATABASENAME</emphasis> with appropriate\r
928                                                         values:</para>\r
929 <screen>\r
930 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>\r
931 <userinput>perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \</userinput>\r
932 <userinput>  --service all --create-schema --create-bootstrap --create-offline \</userinput>\r
933 <userinput>  --hostname HOSTNAME --port PORT \</userinput>\r
934 <userinput>  --user evergreen --password PASSWORD --database DATABASENAME</userinput>\r
935 </screen>\r
936                                                         <para>On most systems, <emphasis>HOSTNAME</emphasis> will be\r
937                                                         <emphasis role="bold">localhost</emphasis>,\r
938                                                         <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>,\r
939                                                         and <emphasis>PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> \r
940                                                         will be <emphasis role="bold">evergreen</emphasis>.</para>\r
941                                                         <note>\r
942                                                                 <para>If you are entering the above command on a single\r
943                                                                 line, do not include the <literal>\</literal>\r
944                                                                 (backslash) characters. If you are using the\r
945                                                                 <command>bash</command> shell, these should only be used\r
946                                                                 at the end of a line at a bash prompt to indicate that\r
947                                                                 the command is continued on the next line.</para>\r
948                                                         </note>\r
949                                                 </step>\r
950                                                 <step>\r
951                                                         <title>Configure the Apache web server</title>\r
952                                                         <para>In this step you will configure the Apache web server to\r
953                                                         support Evergreen software.</para>\r
954                                                         <para>First, you must enable some built-in Apache modules and install\r
955                                                         some additional Apache configuration files. Then you will create a new\r
956                                                         Security Certificate. Finally, you must make several changes to the Apache\r
957                                                         configuration file.</para>\r
958                                                         <substeps>\r
959                                                                 <step>\r
960                                                                         <title>Enable the required Apache Modules</title>\r
961                                                                         <para>As the <systemitem class="username">root</systemitem> user, enable\r
962                                                                         some modules in the Apache server, then copy the\r
963                                                                         new configuration files to the Apache server\r
964                                                                         directories:</para>\r
965                                                                         <screen>\r
966                                                                                 <userinput>a2enmod ssl     # enable mod_ssl</userinput>\r
967                                                                                 <userinput>a2enmod rewrite # enable mod_rewrite</userinput>\r
968                                                                                 <userinput>a2enmod expires # enable mod_expires</userinput>\r
969                                                                         </screen>\r
970                                                                 </step>\r
971                                                                 <step>\r
972                                                                         <title>Copy Apache configuration files</title>\r
973                                                                         <para>You must copy the Apache configuration\r
974                                                                         files from the Evergreen installation dierectory\r
975                                                                         to the Apache directory. As the <systemitem class="username">root</systemitem> user, perform\r
976                                                                         the following commands:</para>\r
977                                                                         <screen>\r
978                                                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>\r
979                                                                                 <userinput>cp Open-ILS/examples/apache/eg.conf  /etc/apache2/sites-available/</userinput>\r
980                                                                                 <userinput>cp Open-ILS/examples/apache/eg_vhost.conf  /etc/apache2/</userinput>\r
981                                                                                 <userinput>cp Open-ILS/examples/apache/startup.pl     /etc/apache2/</userinput>\r
982                                                                         </screen>\r
983                                                                 </step>\r
984                                                                 <step>\r
985                                                                         <title>Create a Security Certificate</title>\r
986                                                                         <para>You must create a new Security Certificate (SSL Key)\r
987                                                                         for the Apache server using the <command>openssl</command>\r
988                                                                         command. For a public production server you must configure\r
989                                                                         or purchase a signed SSL certificate, but for now you can\r
990                                                                         just use a self-signed certificate and accept the warnings\r
991                                                                         in the Staff Client and browser during testing and\r
992                                                                         development. As the\r
993                                                                         <systemitem class="username">root</systemitem> user, \r
994                                                                         perform the following commands:</para>\r
995 <screen>\r
996 <userinput>mkdir /etc/apache2/ssl</userinput>\r
997 <userinput>cd /etc/apache2/ssl</userinput>\r
998 <userinput>openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key</userinput>\r
999 </screen>\r
1000                                                                         <note>\r
1001                                                                                 <para>This step generates a self-signed SSL\r
1002                                                                                 certificate. You must install a proper SSL\r
1003                                                                                 certificate for a public production system to\r
1004                                                                                 avoid warning messages when users login to their\r
1005                                                                                 account through the OPAC or when staff login\r
1006                                                                                 through the staff client.</para>\r
1007                                                                                 <para>For further information on getting a proper\r
1008                                                                                 SSL certificate, see\r
1009                                                                                 <xref linkend="serversideinstallation-ssl"/>.</para>\r
1010                                                                         </note>\r
1011                                                                 </step>\r
1012                                                                 <step xml:id="serversideinstallation-modify-apache">\r
1013                                                                         <title>Update Apache configuration file</title>\r
1014                                                                         <para>You must make several changes to the new Apache\r
1015                                                                         configuration file\r
1016                                                                         <filename>/etc/apache2/sites-available/eg.conf</filename>. As\r
1017                                                                         the <systemitem class="username">root</systemitem> user,\r
1018                                                                         edit the file and make the following changes:</para>\r
1019                                                                         <itemizedlist>\r
1020                                                                                 <listitem>\r
1021                                                                                         <para>Comment out the line <literal>Allow\r
1022                                                                                         from 10.0.0.0/8</literal> and uncomment\r
1023                                                                                         the line <literal>Allow from\r
1024                                                                                         all</literal>.</para>\r
1025                                                                                         <para>This change allows access to your\r
1026                                                                                         configuration CGI scripts from \r
1027                                                                                         <emphasis role="bold">any</emphasis> workstation on\r
1028                                                                                         <emphasis role="bold">any</emphasis>\r
1029                                                                                         network. This is only a temporary change\r
1030                                                                                         to expedite testing and should be removed\r
1031                                                                                         after you have finished and successfully\r
1032                                                                                         tested the Evergreen installation.</para>\r
1033                                                                                         <warning>\r
1034                                                                                                 <para>\r
1035                                                                                                         <emphasis>You must remove these changes\r
1036                                                                                                 after testing is completed. See \r
1037                                                                                                 <xref linkend="serversideinstallation-postinstallation"/>\r
1038                                                                                                 for further details on removing this change \r
1039                                                                                                 after the Evergreen installation is\r
1040                                                                                                 complete.</emphasis>\r
1041                                                                                                 </para>\r
1042                                                                                         </warning>\r
1043                                                                                 </listitem>\r
1044                                                                                 <listitem>\r
1045                                                                                         <para>Comment out the line <literal>Listen\r
1046                                                                                         443</literal>, since it conflicts with the\r
1047                                                                                         same declaration in the configuration file:\r
1048                                                                                         <filename>/etc/apache2/ports.conf</filename>.\r
1049                                                                                         Note that <systemitem class="osname">Debian\r
1050                                                                                         </systemitem> users should not do this\r
1051                                                                                         since the conflict does not apply to that\r
1052                                                                                         operating system.</para>\r
1053                                                                                 </listitem>\r
1054                                                                                 <listitem>\r
1055                                                                                         <para>The following updates are needed to allow\r
1056                                                                                         the logs to function properly, but it may break\r
1057                                                                                         other Apache applications on your server:</para>\r
1058                                                                                         <para>For the <systemitem class="osname">Linux</systemitem> \r
1059                                                                                         distributions <systemitem class="osname">Ubuntu\r
1060                                                                                         Hardy</systemitem> or\r
1061                                                                                         <systemitem class="osname">Debian Etch</systemitem>, \r
1062                                                                                         as the <systemitem class="username">root</systemitem>\r
1063                                                                                         user, edit the Apache configuration file\r
1064                                                                                         <filename>/etc/apache2/apache2.conf</filename> and\r
1065                                                                                         change the line <literal>User www-data</literal>\r
1066                                                                                         to <literal>User opensrf</literal>.</para>\r
1067                                                                                         <para>For the <systemitem class="osname">Linux</systemitem> \r
1068                                                                                         distributions <systemitem class="osname">Ubuntu\r
1069                                                                                         Karmic</systemitem> or \r
1070                                                                                         <systemitem class="osname">Ubuntu Lucid</systemitem> \r
1071                                                                                         or <systemitem class="osname">Debian\r
1072                                                                                         Lenny</systemitem>, as the \r
1073                                                                                         <systemitem class="username">root</systemitem> \r
1074                                                                                         user, edit the Apache configuration file\r
1075                                                                                         <filename>/etc/apache2/envvars</filename> and\r
1076                                                                                         change the line <literal>export\r
1077                                                                                         APACHE_RUN_USER=www-data</literal> to\r
1078                                                                                         <literal>export\r
1079                                                                                         APACHE_RUN_USER=opensrf</literal>.</para>\r
1080                                                                                 </listitem>\r
1081                                                                         </itemizedlist>\r
1082                                                                 </step>\r
1083                                                                 <step performance="optional">\r
1084                                                                         <title>(OPTIONAL) Apache Performance Modifications</title>\r
1085                                                                         <para>Some further configuration changes to Apache may be\r
1086                                                                         necessary for busy systems. These changes increase the\r
1087                                                                         number of Apache server processes that are started to\r
1088                                                                         support additional browser connections.</para>\r
1089                                                                         <para>As the <systemitem class="username">root</systemitem> \r
1090                                                                         user, edit the Apache configuration file\r
1091                                                                         <filename>/etc/apache2/apache2.conf</filename> and add the\r
1092                                                                         lines <literal>KeepAliveTimeout 1</literal> and\r
1093                                                                         <literal>MaxKeepAliveRequests 100</literal>, or modify any\r
1094                                                                         existing lines. Then locate the section related to\r
1095                                                                         <emphasis>prefork configuration</emphasis> and modify it\r
1096                                                                         to suit the load on your system:</para>\r
1097 <programlisting language="xml">\r
1098 <![CDATA[\r
1099 <IfModule mpm_prefork_module>\r
1100    StartServers           20\r
1101    MinSpareServers         5\r
1102    MaxSpareServers        15\r
1103    MaxClients            150\r
1104    MaxRequestsPerChild 10000\r
1105 </IfModule>\r
1106 ]]>\r
1107 </programlisting>\r
1108                                                                 </step>\r
1109                                                                 <step>\r
1110                                                                         <title>Enable the Evergreen web site</title>\r
1111                                                                         <para>Finally, you must enable the Evergreen web site. As the \r
1112                                                                         <systemitem class="username">root</systemitem> user, execute\r
1113                                                                         the following Apache configuration commands to disable the default\r
1114                                                                         <emphasis>It Works</emphasis> web page and enable the\r
1115                                                                         Evergreen web site:</para>\r
1116 <screen>\r
1117 <userinput>a2dissite default</userinput>\r
1118 <userinput>a2ensite eg.conf</userinput>\r
1119 </screen>\r
1120                                                                 </step>\r
1121                                                         </substeps>\r
1122                                                 </step>\r
1123                                         </substeps>\r
1124                                 </step>\r
1125                                 <step xml:id="serversideinstallation-opensrf-config">\r
1126                                         <title>Modify the OpenSRF Configuration File</title>\r
1127                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the\r
1128                                         OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>\r
1129                                         to update the Jabber usernames and passwords, and to specify the domain from\r
1130                                         which we will accept and to which we will make connections.</para>\r
1131                                         <para>If you are installing Evergreen on a single server and using the\r
1132                                         <systemitem class="domainname">private.localhost</systemitem> / \r
1133                                         <systemitem class="domainname">public.localhost</systemitem> domains, \r
1134                                         these will already be set to the correct values. Otherwise, search and replace\r
1135                                         to match your customized values.</para>\r
1136                                         <para>The left-hand side of  <xref linkend="serversideinstallation-xpath-table-2"/>\r
1137                                         shows common XPath syntax to indicate the approximate position within the XML\r
1138                                         file that needs changes. The right-hand side of the table shows the replacement\r
1139                                         values:</para>\r
1140                                         <table xml:id="serversideinstallation-xpath-table-2">\r
1141                                                 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>\r
1142                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
1143                                                         <colspec colname="Xpath" colnum="1" colwidth="1.5*"/>\r
1144                                                         <colspec colname="Value" colnum="2" colwidth="2.0*"/>\r
1145                                                         <thead>\r
1146                                                                 <row>\r
1147                                                                         <entry>XPath location</entry>\r
1148                                                                         <entry>Value</entry>\r
1149                                                                 </row>\r
1150                                                         </thead>\r
1151                                                         <tbody>\r
1152                                                                 <row>\r
1153                                                                         <entry>/config/opensrf/username</entry>\r
1154                                                                         <entry>\r
1155                                                                                 <systemitem class="username">opensrf</systemitem>\r
1156                                                                         </entry>\r
1157                                                                 </row>\r
1158                                                                 <row>\r
1159                                                                         <entry>/config/opensrf/passwd </entry>\r
1160                                                                         <entry>password for\r
1161                                                                         <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">opensrf</systemitem> user\r
1162                                                                         </entry>\r
1163                                                                 </row>\r
1164                                                                 <row>\r
1165                                                                         <entry>/config/gateway/username</entry>\r
1166                                                                         <entry>\r
1167                                                                                 <systemitem class="username">opensrf</systemitem>\r
1168                                                                         </entry>\r
1169                                                                 </row>\r
1170                                                                 <row>\r
1171                                                                         <entry>/config/gateway/passwd</entry>\r
1172                                                                         <entry>password for\r
1173                                                                         <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">opensrf</systemitem> user\r
1174                                                                         </entry>\r
1175                                                                 </row>\r
1176                                                                 <row>\r
1177                                                                         <entry>/config/routers/router/transport, \r
1178                                                                         first entry where transport/server == public.localhost: \r
1179                                                                         username</entry>\r
1180                                                                         <entry>\r
1181                                                                                 <systemitem class="username">router</systemitem>\r
1182                                                                         </entry>\r
1183                                                                 </row>\r
1184                                                                 <row>\r
1185                                                                         <entry>/config/routers/router/transport,\r
1186                                                                         first entry where transport/server == public.localhost: \r
1187                                                                         password</entry>\r
1188                                                                         <entry>password for \r
1189                                                                         <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">router</systemitem> user\r
1190                                                                         </entry>\r
1191                                                                 </row>\r
1192                                                                 <row>\r
1193                                                                         <entry>/config/routers/router/transport,\r
1194                                                                         second entry where transport/server == private.localhost:\r
1195                                                                         username</entry>\r
1196                                                                         <entry>\r
1197                                                                                 <systemitem class="username">router</systemitem>\r
1198                                                                         </entry>\r
1199                                                                 </row>\r
1200                                                                 <row>\r
1201                                                                         <entry>/config/routers/router/transport,\r
1202                                                                         second entry where transport/server == private.localhost:\r
1203                                                                         password</entry>\r
1204                                                                         <entry>password for \r
1205                                                                         <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">router</systemitem> user\r
1206                                                                         </entry>\r
1207                                                                 </row>\r
1208                                                         </tbody>\r
1209                                                 </tgroup>\r
1210                                         </table>\r
1211                                 </step>\r
1212                                 <step xml:id="serversideinstallation-srfsh">\r
1213                                         <title>Create Configuration Files for Users Needing <command>srfsh</command></title>\r
1214                                         <para>The software installation will automatically create a utility named\r
1215                                         <command>srfsh</command> (surf shell). This is a command line diagnostic tool\r
1216                                         for testing and interacting with the OpenSRF network software. It will be used\r
1217                                         in a future step to complete and test the Evergreen installation. See \r
1218                                         <xref linkend="serversideinstallation-testing"/> for further information.</para>\r
1219                                         <para>In this section you will set up a special configuration file for each user\r
1220                                         who will need to run the utility. Copy the short sample configuration file\r
1221                                         <filename>/openils/conf/srfsh.xml.example</filename> to the file\r
1222                                         <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of\r
1223                                         each user who will use <command>srfsh</command>. Finally, edit each user's\r
1224                                         <filename>.srfsh.xml</filename> file and make the following changes:</para>\r
1225                                         <substeps>\r
1226                                                 <step>\r
1227                                                         <para>Modify <emphasis role="bold">domain</emphasis> to be the\r
1228                                                         router hostname (following our domain examples, \r
1229                                                         <systemitem class="domainname">private.localhost</systemitem>>\r
1230                                                          will give <command>srfsh</command> access to all OpenSRF services,\r
1231                                                         while <systemitem class="domainname">public.localhost</systemitem>\r
1232                                                         will only allow access to those OpenSRF services that are\r
1233                                                         publicly exposed).</para>\r
1234                                                 </step>\r
1235                                                 <step>\r
1236                                                         <para>Modify <emphasis role="bold">username</emphasis> and\r
1237                                                         <emphasis role="bold">password</emphasis> to match the\r
1238                                                         <systemitem class="username">opensrf</systemitem> Jabber user\r
1239                                                         for the chosen domain.</para>\r
1240                                                 </step>\r
1241                                                 <step>\r
1242                                                         <para>Modify <emphasis role="bold">logfile</emphasis> to be the\r
1243                                                         full path for a log file to which the user has write\r
1244                                                         access.</para>\r
1245                                                 </step>\r
1246                                                 <step>\r
1247                                                         <para>Modify <emphasis role="bold">loglevel</emphasis> as needed\r
1248                                                         for testing.</para>\r
1249                                                 </step>\r
1250                                         </substeps>\r
1251 <programlisting language="xml">\r
1252 <![CDATA[\r
1253 <?xml version="1.0"?>\r
1254 <!-- This file follows the standard bootstrap config file layout -->\r
1255 <!-- found in opensrf_core.xml -->\r
1256 <srfsh>\r
1257 <router_name>router</router_name>\r
1258 <domain>private.localhost</domain>\r
1259 <username>opensrf</username>\r
1260 <passwd>evergreen</passwd>\r
1261 <port>5222</port>\r
1262 <logfile>/tmp/srfsh.log</logfile>\r
1263 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->\r
1264 <loglevel>4</loglevel>\r
1265 </srfsh>\r
1266 ]]>\r
1267 </programlisting>\r
1268                                 </step>\r
1269                                 <step xml:id="serversideinstallation-opensrf-env">\r
1270                                         <title>Modify the OpenSRF Environment</title>\r
1271                                         <para>Modify the shell configuration file <filename>~/.bashrc</filename> for\r
1272                                         user <systemitem class="username">opensrf</systemitem> by adding a Perl environmental\r
1273                                         variable, then execute the shell configuration file to load the new variables into\r
1274                                         your current environment.</para>\r
1275                                         <note>\r
1276                                                 <para>\r
1277                                                         <emphasis>In a multi-server environment, you must add any\r
1278                                                         modifications to <filename>~/.bashrc</filename> to the top of\r
1279                                                         the file <emphasis>before</emphasis> the line \r
1280                                                         <literal>[ -z "$PS1" ] &amp;&amp; return </literal>.\r
1281                                                         This will allow headless (scripted) logins to load the correct\r
1282                                                         environment.</emphasis>\r
1283                                                 </para>\r
1284                                         </note>\r
1285 <screen>\r
1286 <userinput>echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc</userinput>\r
1287 <userinput>. ~/.bashrc</userinput>\r
1288 </screen>\r
1289                                 </step>\r
1290                                 <step>\r
1291                                         <title>(OPTIONAL) Enable and Disable Language Localizations</title>\r
1292                                         <para>You can load translations such as Armenian (hy-AM), Canadian French\r
1293                                         (fr-CA), and others into the database to complete the translations available in\r
1294                                         the OPAC and staff client. For further information, see <xref linkend="localization"/>.</para>\r
1295                                 </step>\r
1296                         </procedure>\r
1297                 </section>\r
1298                 <section xml:id="serversideinstallation-starting">\r
1299                         <title>Starting Evergreen</title>\r
1300                         <procedure>\r
1301                                 <step>\r
1302                                         <para>As the <systemitem class="username">root</systemitem>\r
1303                                         user, start the <systemitem class="service">ejabberd</systemitem> and \r
1304                                         <systemitem class="service">memcached</systemitem> services\r
1305                                          (if they are not already running):</para>\r
1306 <screen>\r
1307 <userinput>/etc/init.d/ejabberd start</userinput>\r
1308 <userinput>/etc/init.d/memcached start</userinput>\r
1309 </screen>\r
1310                                 </step>\r
1311                                 <step>\r
1312                                         <para>As the <systemitem class="username">opensrf</systemitem>\r
1313                                         user, start Evergreen.</para>\r
1314                                         <para>Use the flag <option>-l</option> to force Evergreen to use\r
1315                                         <systemitem class="domainname">localhost</systemitem> (your\r
1316                                         current system) as the hostname. Using the\r
1317                                         <option>start_all</option> option will start the OpenSRF\r
1318                                         <systemitem class="service">router</systemitem> , \r
1319                                         <systemitem class="service">Perl</systemitem> , and\r
1320                                         <systemitem class="service">C</systemitem> services:</para>\r
1321 <screen>\r
1322 <userinput>$ osrf_ctl.sh -l -a start_all</userinput>\r
1323 </screen>\r
1324                                         <note>\r
1325                                                 <para>\r
1326                                                         <emphasis>You can also start Evergreen \r
1327                                                         <emphasis role="bold">without</emphasis> \r
1328                                                         the <option>-l</option> flag, but the\r
1329                                                         <command>osrf_ctl.sh</command> utility must know\r
1330                                                         the fully qualified domain name for the system\r
1331                                                         on which it will execute. That hostname may have\r
1332                                                         been specified in the configuration file\r
1333                                                         <filename>opensrf.xml</filename>, which you\r
1334                                                         configured in a previous step.</emphasis>\r
1335                                                 </para>\r
1336                                                 <para>Use the <command>hostname</command> command to\r
1337                                                 determine the fully qualified domain name of your\r
1338                                                 system.</para>\r
1339                                         </note>\r
1340                                         <itemizedlist>\r
1341                                                 <listitem>\r
1342                                                         <para>If you receive an error message similar to\r
1343                                                         <emphasis>osrf_ctl.sh: command not found</emphasis>,\r
1344                                                         then your environment variable\r
1345                                                         <envar>PATH</envar> does not include the directory\r
1346                                                         <filename class="directory">/openils/bin</filename>.\r
1347                                                         As the                                                          \r
1348                                                         <systemitem class="username">opensrf</systemitem>\r
1349                                                         user, edit the configuration file\r
1350                                                         <filename>/home/opensrf/.bashrc</filename> and\r
1351                                                         add the following line:\r
1352                                                         <literal>export PATH=$PATH:/openils/bin</literal></para>\r
1353                                                 </listitem>\r
1354                                                 <listitem>\r
1355                                                         <para>If you receive an error message similar to\r
1356                                                         <emphasis>Can't locate OpenSRF/System.pm in\r
1357                                                         @INC ... BEGIN failed--compilation\r
1358                                                         aborted</emphasis>, then your environment variable\r
1359                                                         <emphasis role="bold">PERL5LIB</emphasis> does not\r
1360                                                          include the directory\r
1361                                                         <filename class="directory">/openils/lib/perl5</filename>.\r
1362                                                         As the\r
1363                                                         <systemitem class="username">opensrf</systemitem> \r
1364                                                         user, edit the configuration file\r
1365                                                         <filename>/home/opensrf/.bashrc</filename> and\r
1366                                                         add the following line:\r
1367                                                         <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>\r
1368                                                 </listitem>\r
1369                                         </itemizedlist>\r
1370                                 </step>\r
1371                                 <step>\r
1372                                         <para>As the <systemitem class="username">opensrf</systemitem>\r
1373                                         user, generate the Web files needed by the Staff Client and\r
1374                                         catalog, and calculate the proximity of locations in the\r
1375                                         Organizational Unit tree (which allows\r
1376                                         <emphasis>Holds</emphasis> to work properly):</para>\r
1377 <screen>\r
1378 <userinput>cd /openils/bin</userinput>\r
1379 <userinput>./autogen.sh -c /openils/conf/opensrf_core.xml -u</userinput>\r
1380 <computeroutput>\r
1381 Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'\r
1382 Updating fieldmapper\r
1383 </computeroutput>\r
1384 </screen>\r
1385                                         <para>You must do this the first time you start Evergreen, and\r
1386                                         after making any changes to the library hierarchy.</para>\r
1387                                 </step>\r
1388                                 <step>\r
1389                                         <para>As the <systemitem class="username">root</systemitem>\r
1390                                         user, restart the Apache Web server:</para>\r
1391 <screen>\r
1392 <userinput>/etc/init.d/apache2 restart</userinput>\r
1393 </screen>\r
1394                                         <note>\r
1395                                                 <para>If the Apache Web server was running when you\r
1396                                                 started the OpenSRF services, you might not be able to\r
1397                                                 successfully log in to the OPAC or Staff Client until\r
1398                                                 the Apache Web server is restarted.</para>\r
1399                                         </note>\r
1400                                 </step>\r
1401                         </procedure>\r
1402                 </section>\r
1403                 <section xml:id="serversideinstallation-testing">\r
1404                         <title>Testing the Installation</title>\r
1405                         <para>This section describes several simple tests you can perform to verify that the Evergreen\r
1406                         server-side software has been installed and configured properly and is running as\r
1407                         expected.</para>\r
1408                         <simplesect xml:id="serversideinstallation-testing-connections">\r
1409                                 <title>Testing Connections to Evergreen</title>\r
1410                                 <para>Once you have installed and started Evergreen, test your connection to\r
1411                                 Evergreen. As the <systemitem class="username">opensrf</systemitem> user start the\r
1412                                 <command>srfsh</command> application and try logging onto the Evergreen server using the\r
1413                                 default administrator username and password. Following is sample output generated by\r
1414                                 executing <command>srfsh</command> after a successful Evergreen installation.\r
1415                                 For help with <command>srfsh</command> commands, type <userinput>help</userinput>\r
1416                                 at the prompt:</para>\r
1417                                 <screen>\r
1418                                         <userinput>/openils/bin/srfsh</userinput>\r
1419                                         <prompt>srfsh%</prompt>\r
1420                                         <userinput>login admin open-ils</userinput>\r
1421                                         <prompt>Received Data: "250bf1518c7527a03249858687714376"</prompt>\r
1422                                         <prompt>------------------------------------</prompt>\r
1423                                         <prompt>Request Completed Successfully</prompt>\r
1424                                         <prompt>Request Time in seconds: 0.045286</prompt>\r
1425                                         <prompt>------------------------------------</prompt>\r
1426                                         <prompt>Received Data: {</prompt>\r
1427                                         <prompt>   "ilsevent":0,</prompt>\r
1428                                         <prompt>   "textcode":"SUCCESS",</prompt>\r
1429                                         <prompt>   "desc":" ",</prompt>\r
1430                                         <prompt>   "pid":21616,</prompt>\r
1431                                         <prompt>   "stacktrace":"oils_auth.c:304",</prompt>\r
1432                                         <prompt>   "payload":{</prompt>\r
1433                                         <prompt>      "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",</prompt>\r
1434                                         <prompt>      "authtime":420</prompt>\r
1435                                         <prompt>   }</prompt>\r
1436                                         <prompt>}</prompt>\r
1437                                         <prompt>------------------------------------</prompt>\r
1438                                         <prompt>Request Completed Successfully</prompt>\r
1439                                         <prompt>Request Time in seconds: 1.336568</prompt>\r
1440                                         <prompt>------------------------------------</prompt>\r
1441                                 </screen>\r
1442                                 <para>If this does not work, try the following:</para>\r
1443                                 <itemizedlist>\r
1444                                         <listitem>As the <systemitem class="username">opensrf</systemitem> user, run the\r
1445                                         script <filename>Open-ILS/src/support-scripts/settings-tester.pl</filename> to\r
1446                                         see if it finds any system configuration problems. If the output of\r
1447                                         <command>settings-tester.pl</command> does not help you find the problem, please\r
1448                                         do not make any significant changes to your configuration.</listitem>\r
1449                                         <listitem>Follow the steps in the troubleshooting guide in \r
1450                                         <xref linkend="troubleshooting"/>.</listitem>\r
1451                                         <listitem>If you have followed the entire set of installation steps listed here\r
1452                                         closely, you are probably extremely close to a working system. Gather your\r
1453                                         configuration files and log files and contact the \r
1454                                         <ulink url="http://open-ils.org/listserv.php">Evergreen Development Mailing List</ulink>\r
1455                                         list for assistance before making any drastic changes to your\r
1456                                         system configuration.</listitem>\r
1457                                 </itemizedlist>\r
1458                         </simplesect>\r
1459                 </section>\r
1460                 <section xml:id="serversideinstallation-virtual">\r
1461                         <title>(OPTIONAL) Installing In Virtualized <systemitem class="osname">Linux</systemitem> Environments</title>\r
1462                         <para>This section describes the installation of Evergreen software in so-called "virtualized"\r
1463                         software environments. Evergreen software runs as a native application on any of several\r
1464                         well-known x86 (32-bit) and x86-64 (64-bit) <systemitem class="osname">Linux</systemitem>\r
1465                         distributions including <systemitem class="osname">Ubuntu</systemitem> and \r
1466                         <systemitem class="osname">Debian</systemitem> but it does not run as a native application \r
1467                         on the <systemitem class="osname">Microsoft Windows</systemitem> operating system. \r
1468                         However, it is possible to execute Evergreen on a <systemitem class="osname">Windows</systemitem> \r
1469                         host system by running it within a virtual Linux-guest installation, which itself executes \r
1470                         on the <systemitem class="osname">Windows</systemitem> system. \r
1471                         The <systemitem class="osname">Linux</systemitem> environment is fully emulated and acts \r
1472                         (within limits) just as if it were executing on a real standalone system.</para>\r
1473                         <para>This technique of emulating a <systemitem class="osname">Linux</systemitem> environment on\r
1474                         a <systemitem class="osname">Windows</systemitem> host is a practical way to install and run an\r
1475                         Evergreen system if it is not possible to dedicate a physical machine solely as a \r
1476                         <systemitem class="osname">Linux</systemitem> host for Evergreen. This architecture is not\r
1477                         recommended for large scale systems since there are performance limitations to running Evergreen\r
1478                         in a virtualized environment. However, it is a reasonable architecture for smaller experimental\r
1479                         systems, as a proof of concept, or as a conference-room pilot.</para>\r
1480                         <simplesect>\r
1481                                 <title>Installing Virtualization Software</title>\r
1482                                 <para>As described above, Evergreen can be installed on top of an emulated\r
1483                                 <systemitem class="osname">Linux</systemitem> environment. The \r
1484                                 <systemitem class="osname">Linux</systemitem> environment, in turn, is installed \r
1485                                 on top of a software application such as <application>"VirtualBox"</application>,\r
1486                                 <application>"VMware"</application> or <application>"VirtualPC"</application> which must\r
1487                                 first be installed on the <systemitem class="osname">Windows</systemitem> system. This\r
1488                                 section contains step-by-step examples that show installing popular virtualization\r
1489                                 applications on a <systemitem class="osname">Windows</systemitem> host system. Following\r
1490                                 this section are further descriptions of installing \r
1491                                 <systemitem class="osname">Linux</systemitem> and Evergreen systems using that \r
1492                                 virtualization software.</para>\r
1493                                 <simplesect>\r
1494                                         <title>Installing <application>"VirtualBox"</application> Virtualization Software</title>\r
1495                                         <para>This section reviews installation of the\r
1496                                         <application>"VirtualBox"</application> application on \r
1497                                         <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. \r
1498                                         Download the latest edition of <application>VirtualBox</application> from their official website: \r
1499                                         <link xl:href="http://virtualbox.org" xl:title="virtual box">http://virtualbox.org</link> and follow the on screen instructions to install the software.</para>\r
1500                                 </simplesect>\r
1501                                 <simplesect>\r
1502                                         <title>Installing <application>"VMware"</application> Virtualization Software</title>\r
1503                                         <para>This section reviews installation of the\r
1504                                         <application>"VMware"</application> application on <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. Find and Download the free virtual \r
1505                                         machine software of from the VMware official website: <ulink url="http://downloads.vmware.com">http://downloads.vmware.com</ulink> and follow the on \r
1506                                         screen instructions.</para>\r
1507                                 </simplesect>\r
1508                         </simplesect>\r
1509                         <simplesect xml:id="serversideinstallation-virtual-install-linux-ev">\r
1510                                 <title>Installing <systemitem class="osname">Linux</systemitem> / \r
1511                                                 Evergreen on Virtualization Software</title>\r
1512                                 <para>After the virtualization software is installed and running, there are two ways to\r
1513                                 continue with installing <systemitem class="osname">Linux</systemitem> and Evergreen\r
1514                                 software in the new virtualized environment:</para>\r
1515                                 <orderedlist>\r
1516                                         <listitem>\r
1517                                                 <para>Download and install a prebuilt software image that contains a\r
1518                                                 working <systemitem class="osname">Linux</systemitem> / Evergreen system\r
1519                                                 (see <xref linkend="serversideinstall-virtual-prebuilt"/> for\r
1520                                                 details)</para>\r
1521                                         </listitem>\r
1522                                         <listitem>\r
1523                                                 <para>Manually install a <systemitem class="osname">Linux</systemitem>\r
1524                                                 guest system, then manually install Evergreen on it (see \r
1525                                                 <xref linkend="serversideinstall-virtual-manual"/> for details)</para>\r
1526                                         </listitem>\r
1527                                 </orderedlist>\r
1528                                 <para>We review each method in the following sections.</para>\r
1529                                 <simplesect xml:id="serversideinstall-virtual-prebuilt">\r
1530                                         <title>Download and install a prebuilt software image</title>\r
1531                                         <para>You can download a prebuilt software image that, when installed with your\r
1532                                         virtualization software, emulates a \r
1533                                         <systemitem class="osname">Linux</systemitem> guest system containing a running \r
1534                                         Evergreen distribution. The image is essentially a snapshot of a hard disk from\r
1535                                         a fully configured, functional <systemitem class="osname">Linux</systemitem>\r
1536                                         system with Evergreen already installed.</para>\r
1537                                         <para>We recommend this approach if you wish to get Evergreen running quickly\r
1538                                         with minimal attention to configuration. After reviewing only a few\r
1539                                         configuration details you can have a working Evergreen system that integrates\r
1540                                         smoothly with the rest of your network. See \r
1541                                         <xref linkend="serversideinstall-virtual-versions"/> for a list of prebuilt \r
1542                                         software images that are currently available to download and install</para>\r
1543                                         <note>DISCLAIMER: The following virtual images have been contributed by members\r
1544                                         of the Evergreen community for the purposes of testing, evaluation, training,\r
1545                                         and development.</note>\r
1546                                         <table xml:id="serversideinstall-virtual-versions">\r
1547                                                 <title>Linux / Evergreen Virtual Images</title>\r
1548                                                 <tgroup align="left" cols="4" colsep="1" rowsep="1">\r
1549                                                         <colspec colnum="1" colwidth="1.0*"/>\r
1550                                                         <colspec colnum="2" colwidth="1.0*"/>\r
1551                                                         <colspec colnum="3" colwidth="3.0*"/>\r
1552                                                         <colspec colnum="4" colwidth="1.0*"/>\r
1553                                                         <thead>\r
1554                                                                 <row>\r
1555                                                                         <entry>Linux Version</entry>\r
1556                                                                         <entry>Evergreen Version</entry>\r
1557                                                                         <entry>Image</entry>\r
1558                                                                         <entry>Comments</entry>\r
1559                                                                 </row>\r
1560                                                         </thead>\r
1561                                                         <tbody>\r
1562                                                                 <row>\r
1563                                                                         <entry>Debian lenny (5.0)</entry>\r
1564                                                                         <entry>1.6.0.1</entry>\r
1565                                                                         <entry>\r
1566                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen1601_DebianLenny.zip"> download </ulink>\r
1567                                                                         </entry>\r
1568                                                                         <entry>VirtualBox image</entry>\r
1569                                                                 </row>\r
1570                                                                 <row>\r
1571                                                                         <entry>Ubuntu karmic koala (9.10)</entry>\r
1572                                                                         <entry>1.6.0.0</entry>\r
1573                                                                         <entry>\r
1574                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen-1600-Karmic.zip"> download </ulink>\r
1575                                                                         </entry>\r
1576                                                                         <entry>VirtualBox image</entry>\r
1577                                                                 </row>\r
1578                                                         </tbody>\r
1579                                                 </tgroup>\r
1580                                         </table>\r
1581                         \r
1582                                         <procedure>\r
1583                                                 <title>VirtualBox Example</title>\r
1584                                                 <step>\r
1585                                                         <para>Start VirtualBox for the first time and select\r
1586                                                         <menuchoice><guimenu>File</guimenu><guimenuitem>VirtualBox Media\r
1587                                                         Manager</guimenuitem><guimenuitem>Add</guimenuitem></menuchoice>\r
1588                                                         to locate the prebuilt software image just downloaded (the\r
1589                                                         example shows it was extracted from the original\r
1590                                                         <filename class="extension">zip</filename> file into a temporary directory\r
1591                                                         <filename class="directory">C:\temp</filename>).</para>\r
1592                                                 </step>\r
1593                                                 <step>\r
1594                                                         <para>After selecting the file, click <guibutton>Open</guibutton> to import it.</para>\r
1595                                                 </step>\r
1596                                                 <step>\r
1597                                                         <para>Then click <guibutton>OK</guibutton> to save the selection\r
1598                                                         and return to the VirtualBox Media Manager</para>\r
1599                                                 </step>\r
1600                                                 <step>\r
1601                                                         <para>Click <guibutton>New</guibutton>, then <guibutton>Next</guibutton> to continue\r
1602                                                         and create a new virtual machine (VM).</para>\r
1603                                                 </step>\r
1604                                                 <step>\r
1605                                                         <para>Create a new name for the VM and set the operating system\r
1606                                                         type, then click <guibutton>Next</guibutton>.</para>\r
1607                                                 </step>\r
1608                                                 <step>\r
1609                                                         <para>Set the memory size (at least 512Mb),\r
1610                                                         then click <guibutton>Next</guibutton>.</para>\r
1611                                                 </step>\r
1612                                                 <step>\r
1613                                                         <para>Edit the Virtual Hard Disk configuration settings; click\r
1614                                                         the radio boxes <guilabel>Boot Hard Disk</guilabel> and <guilabel>Use existing hard disk</guilabel>\r
1615                                                         and ensure that the disk name <guilabel>Evergreen1601_DebianLenny.vmdk</guilabel>\r
1616                                                         is selected. Click <guibutton>Finish</guibutton> to finish the\r
1617                                                         setup.</para>\r
1618                                                 </step>\r
1619                                                 <step>\r
1620                                                         <para>Install the <application>VirtualBox Guest\r
1621                                                         Additions</application> (really a required upgrade to\r
1622                                                         VirtualBox)</para>\r
1623                                                 </step>\r
1624                                                 <step>\r
1625                                                         <para>Return to VirtualBox and see the summary of the VM just\r
1626                                                         created. Click <guibutton>Start</guibutton> to boot the new VM.</para>\r
1627                                                 </step>\r
1628                                                 <step>\r
1629                                                         <para>See the start of the <systemitem class="osname">Linux</systemitem> boot sequence. Choose <guimenuitem>Debian\r
1630                                                         Gnu/Linux, kernel 2.6.26-2-686</guimenuitem> from the startup menu and click\r
1631                                                         <guibutton>Enter</guibutton> to start <systemitem class="osname">Linux</systemitem> and Evergreen. After\r
1632                                                         some delay you should see the command line prompt <prompt>debian-lenny login:</prompt>. Log in with username\r
1633                                                         <userinput>root</userinput> and password <userinput>evergreen</userinput> to continue.</para>\r
1634                                                 </step>\r
1635                                         </procedure>\r
1636                                 </simplesect>\r
1637                         </simplesect>\r
1638                 </section>\r
1639         </section>\r
1640 </chapter>\r