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