1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter xml:id="serversideinstallation" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xl="http://www.w3.org/1999/xlink">
4 <title>Server-side Installation of Evergreen Software</title>
6 <para>This section describes installation of the Evergreen server-side software and its associated components.
7 Installation, configuration, testing and verification
8 of the software is straightforward if you follow some simple directions.</para>
11 <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current
12 stable software release. See <xref linkend="serversideinstallation-all"/> for instructions tailored to
13 installing on some particular distributions of the <systemitem class="osname">Linux</systemitem> operating
15 <para>The current version of the Evergreen server-side software runs as a native application on any of several
16 well-known <systemitem class="osname">Linux</systemitem> distributions
17 (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>).
18 It does not currently run as a native application on the <systemitem class="osname">Microsoft Windows</systemitem>
19 operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, <systemitem class="osname">WindowsXP
20 Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can still be
21 installed and run on <systemitem class="osname">Windows</systemitem> via a so-called
22 <emphasis>virtualized</emphasis> Linux-guest Operating System (using, for example,
23 <application>"VirtualBox"</application>, or <application>"VMware"</application>, or
24 <application>"VirtualPC"</application> to emulate a <systemitem class="osname">Linux</systemitem>
25 environment). It can also be installed to run on other <systemitem class="osname">Linux</systemitem>
26 systems via virtualized environments (using, for example, <application>"VirtualBox"</application> or
27 <application>"VMware"</application>). More information on virtualized environments can be found in
28 <xref linkend="serversideinstallation-virtual"/>.</para>
29 <para>Installation of the Evergreen Staff Client software is reviewed in <xref linkend="staffclientinstallation"/>. </para>
30 <para>The Evergreen server-side software has dependencies on particular versions of certain major software
31 sub-components. Successful installation of Evergreen software requires that software versions agree with those
33 <table xml:id="serversideinstall-software-dependencies">
34 <title>Evergreen Software Dependencies</title>
36 <primary>Evergreen software dependencies</primary>
38 <tgroup align="left" cols="3" colsep="1" rowsep="1">
39 <colspec colname="Evergreen" colnum="1" colwidth="1.0*"/>
40 <colspec colname="OpenSRF" colnum="2" colwidth="1.0*"/>
41 <colspec colname="PostgreSQL" colnum="3" colwidth="1.0*"/>
44 <entry>Evergreen</entry>
45 <entry>OpenSRF</entry>
46 <entry>PostgreSQL</entry>
51 <entry>1.6.1.x</entry>
53 <entry>8.2 / 8.3</entry>
56 <entry>1.6.0.x</entry>
58 <entry>8.2 / 8.3</entry>
63 <entry>8.1 / 8.2</entry>
68 <entry>8.1 / 8.2</entry>
73 <section xml:id="serversideinstallation-all">
74 <title>Installing Server-Side Software</title>
75 <para>This section describes the installation of the major components of Evergreen server-side software.</para>
76 <para>As far as possible, you should perform the following steps in the exact order given since the
77 success of many steps relies on the successful completion of earlier steps. You should make backup
78 copies of files and environments when you are instructed to do so. In the event of installation problems
79 those copies can allow you to back out of a step gracefully and resume the installation from a known
80 state. See <xref linkend="backingup"/> for further information.</para>
81 <para>Of course, after you successfully complete and test the entire Evergreen installation you should
82 take a final snapshot backup of your system(s). This can be the first in the series of regularly
83 scheduled system backups that you should probably also begin.</para>
84 <section xml:id="serversideinstallation-opensrf">
86 <primary>OpenSRF</primary>
87 <secondary>installation</secondary>
89 <title>Installing OpenSRF 1.4.x On <systemitem class="osname">Ubuntu</systemitem> or
90 <systemitem class="osname">Debian</systemitem></title>
92 <primary>Linux</primary>
93 <secondary>Debian</secondary>
96 <primary>Linux</primary>
97 <secondary>Ubuntu</secondary>
99 <para>This section describes the installation of the latest version of the Open Service Request
100 Framework (OpenSRF), a major component of the Evergreen server-side software, on
101 <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem>
102 systems. Evergreen software is integrated with and depends on the OpenSRF software
104 <para>Follow the steps outlined here and run the specified tests to ensure that OpenSRF is
105 properly installed and configured. Do not continue with any further Evergreen installation steps
106 until you have verified that OpenSRF has been successfully installed.</para>
108 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit)
109 platforms. OpenSRF 1.4.0 has been tested on <systemitem class="osname">Debian Etch
110 (4.0)</systemitem>, <systemitem class="osname">Debian Lenny (5.0)</systemitem> and
111 <systemitem class="osname">Ubuntu Lucid Lynx (10.04)</systemitem>.</para>
112 <para>In the following instructions, you are asked to perform certain steps as either
113 the <systemitem class="username">root</systemitem> user, the
114 <systemitem class="username">opensrf</systemitem> user, or the
115 <systemitem class="username">postgres</systemitem> user.</para>
118 <para><systemitem class="osname">Debian</systemitem> -- To become the
119 <systemitem class="username">root</systemitem> user, issue the command
120 <command>su -</command> and enter the password of the
121 <systemitem class="username">root</systemitem> user.</para>
124 <para><systemitem class="osname">Ubuntu</systemitem> -- To become the
125 <systemitem class="username">root</systemitem> user, issue the command
126 <command>sudo su -</command> and enter the password of the
127 <systemitem class="username">root</systemitem> user.</para>
130 <para>To switch from the <systemitem class="username">root</systemitem> user to a
131 different user, issue the command <command>su - USERNAME</command>. For example, to
132 switch from the <systemitem class="username">root</systemitem> user to the
133 <systemitem class="username">opensrf</systemitem> user, issue the command
134 <command>su - opensrf</command>. Once you have become a non-root user, to become
135 the <systemitem class="username">root</systemitem> user again, simply issue the command
136 <command>exit</command>.</para>
140 <title>Add the OpenSRF User</title>
141 <para>As the <systemitem class="username">root</systemitem> user, add the
142 opensrf user to the system. The default shell for the new user is automatically
143 set to <command>/bin/bash</command> to inherit a reasonable environment:</para>
145 <userinput>useradd -m -s /bin/bash opensrf</userinput>
146 <userinput>passwd opensrf</userinput>
150 <title>Download and Unpack Latest OpenSRF Version</title>
152 <primary>OpenSRF</primary>
153 <secondary>download</secondary>
155 <para>As the <systemitem class="username">opensrf</systemitem> user, change to
156 the directory <filename class="directory">/home/opensrf</filename> then download
157 and extract the latest version of OpenSRF. The latest version can be found here:
158 <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.4.0.tar.gz"></ulink></para>
160 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
161 <userinput>wget http://evergreen-ils.org/downloads/OpenSRF-1.4.0.tar.gz</userinput>
162 <userinput>tar zxf OpenSRF-1.4.0.tar.gz</userinput>
164 <para>The new directory
165 <filename class="directory">/home/opensrf/OpenSRF-1.4.0</filename> will be created.</para>
168 <title>Install Prerequisites to Build OpenSRF</title>
169 <para>In this section you will install and configure a set of prerequisites that will be
170 used to build OpenSRF. In the following step you will actually build the OpenSRF software
171 using the <command>make</command> utility.</para>
172 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show
173 below to build the prerequisites from the software distribution that you just downloaded
174 and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the following
175 example with the keyword corresponding to the name of one of the
176 <systemitem class="osname">Linux</systemitem> distributions listed in the following
177 distribution keywords table <xref linkend="serversideinstallation-keywords-opensrf"/> .
178 For example, to install the prerequisites for Ubuntu version 10.04 (Lucid Lynx) you would
179 enter this command: <command>make -f src/extras/Makefile.install ubuntu-lucid</command> .</para>
181 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
182 <userinput>make -f src/extras/Makefile.install [DISTRIBUTION]</userinput>
184 <table xml:id="serversideinstallation-keywords-opensrf">
185 <title>Keyword Targets for OpenSRF <application>"make"</application> Command</title>
186 <tgroup align="left" cols="2" colsep="1" rowsep="1">
187 <colspec colnum="1" colwidth="1.0*"/>
188 <colspec colnum="2" colwidth="3.0*"/>
191 <entry>Keyword</entry>
192 <entry>Description</entry>
197 <entry>debian-etch</entry>
198 <entry>for Debian "Etch" (4.0)</entry>
201 <entry>debian-lenny</entry>
202 <entry>for Debian "Lenny" (5.0)</entry>
205 <entry>ubuntu-hardy</entry>
206 <entry>for Ubuntu "Hardy Heron" (8.04)</entry>
209 <entry>ubuntu-karmic</entry>
210 <entry>for Ubuntu "Karmic Koala" (9.10)</entry>
213 <entry>ubuntu-lucid</entry>
214 <entry>for Ubuntu "Lucid Lynx" (10.04)</entry>
217 <entry>fedora13</entry>
218 <entry>for Fedora "Goddard" (13)</entry>
221 <entry>centos</entry>
222 <entry>for Centos</entry>
225 <entry>gentoo</entry>
226 <entry>for Gentoo</entry>
231 <para>This will install a number of packages on the system that are required by OpenSRF,
232 including some Perl modules from CPAN. You can say <literal>No</literal> to the initial
233 CPAN configuration prompt to allow it to automatically configure itself to download and
234 install Perl modules from CPAN. The CPAN installer will ask you a number of times whether
235 it should install prerequisite modules - say <literal>Yes</literal>.</para>
238 <title>Build OpenSRF</title>
239 <para>In this section you will configure and build the OpenSRF
240 components that support other Evergreen services.</para>
243 <title>Configure OpenSRF</title>
245 <primary>OpenSRF</primary>
246 <secondary>configure</secondary>
248 <para>As the <systemitem class="username">opensrf</systemitem>
249 user, return to the OpenSRF build directory and use the
250 <command>configure</command> utility to prepare for the next
251 step of compiling and linking the software. If you wish to
252 include support for Python and Java, add the configuration
253 options <option>--enable-python</option> and
254 <option>--enable-java</option>, respectively:</para>
256 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
257 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>
258 <userinput>make</userinput>
262 <title>Compile, Link and Install OpenSRF</title>
263 <para>As the <systemitem class="username">root</systemitem>
264 user, return to the OpenSRF build directory and use the
265 <command>make</command> utility to compile, link and install
268 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
269 <userinput>make install</userinput>
273 <title>Update the System Dynamic Library Path</title>
274 <para>You must update the system dynamic library path to force
275 your system to recognize the newly installed libraries. As the
276 <systemitem class="username">root</systemitem> user, do this by
277 creating the new file
278 <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a
279 new library path, then run the command
280 <command>ldconfig</command> to automatically read the file and
281 modify the system dynamic library path:</para>
283 <userinput>echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf</userinput>
284 <userinput>ldconfig</userinput>
288 <title>Define Public and Private OpenSRF Domains</title>
289 <para>For security purposes, OpenSRF uses Jabber domains to separate services
290 into public and private realms. On a single-server system the easiest way to
291 define public and private OpenSRF domains is to define separate host names by
292 adding entries to the file <filename>/etc/hosts</filename>.</para>
293 <para>In the following steps we will use the example domains
294 <systemitem class="domainname">public.localhost</systemitem> for the public
295 domain and <systemitem class="domainname">private.localhost</systemitem>
296 for the private domain. In an upcoming step, you will configure two special
297 <systemitem class="service">ejabberd</systemitem> users
298 to handle communications for these two domains.</para>
299 <para>As the <systemitem class="username">root</systemitem> user, edit the file
300 <filename>/etc/hosts</filename> and add the following example domains:</para>
302 <primary>Jabber</primary>
305 <userinput>127.0.1.2 public.localhost public</userinput>
306 <userinput>127.0.1.3 private.localhost private</userinput>
310 <title>Change File Ownerships</title>
311 <para>Finally, as the <systemitem class="username">root</systemitem>
312 user, change the ownership of all files installed in the
313 directory <filename class="directory">/openils</filename> to the
314 user <systemitem class="username">opensrf</systemitem>:</para>
316 <userinput>chown -R opensrf:opensrf /openils</userinput>
322 <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>
324 <primary>ejabberd</primary>
326 <para>Before continuing with configuration of <systemitem class="service">ejabberd</systemitem>
327 you must stop that service. As the <systemitem class="username">root</systemitem> user,
328 execute the following command to stop the service:</para>
330 <userinput>/etc/init.d/ejabberd stop</userinput>
332 <para>If <systemitem class="service">ejabberd</systemitem> reports that it
333 is already stopped, there may have been a problem when it started back
334 in the installation step. If there are any remaining daemon processes such as
335 <systemitem class="daemon">beam</systemitem> or
336 <systemitem class="daemon">epmd</systemitem>
337 you may need to perform the following commands to kill them:</para>
339 <userinput>epmd -kill</userinput>
340 <userinput>killall beam; killall beam.smp</userinput>
341 <userinput>rm /var/lib/ejabberd/*</userinput>
342 <userinput>echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd</userinput>
346 <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>
347 <para>You must make several configuration changes for the
348 <systemitem class="service">ejabberd</systemitem> service before
350 As the <systemitem class="username">root</systemitem> user, edit the file
351 <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>
354 <para>Change the line:
355 <screen><userinput>{hosts, ["localhost"]}.</userinput></screen>
357 <screen><userinput>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</userinput></screen></para>
360 <para>Change the line:
361 <screen><userinput>{max_user_sessions, 10}.</userinput></screen> to:
362 <screen><userinput>{max_user_sessions, 10000}.</userinput></screen></para>
363 <para>If the line looks something like this:
364 <screen><userinput>{access, max_user_sessions, [{10, all}]}.</userinput></screen>
366 <screen><userinput>{access, max_user_sessions, [{10000, all}]}</userinput></screen></para>
369 <para>Change all three occurrences of: <literal>max_stanza_size</literal>
370 to: <literal>2000000</literal>.</para>
373 <para>Change both occurrences of: <literal>maxrate</literal> to:
374 <literal>500000</literal>.</para>
377 <para>Comment out the line <literal>{mod_offline, []}</literal>
378 by placing two <literal>%</literal> comment signs in front.</para>
382 <step xml:id="serversideinstallation-opensrf-continued">
383 <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>
384 <para>As the <systemitem class="username">root</systemitem> user, restart the
385 <systemitem class="service">ejabberd</systemitem> service to test the
386 configuration changes and to register your users:</para>
388 <userinput>/etc/init.d/ejabberd start</userinput>
392 <title>Register <systemitem class="username">router</systemitem> and
393 <systemitem class="username">ejabberd</systemitem> users</title>
394 <para>The two <systemitem class="service">ejabberd</systemitem> users
395 <systemitem class="username">router</systemitem> and
396 <systemitem class="username">opensrf</systemitem> must be registered
397 and configured to manage OpenSRF router service and communications
398 for the two domains <literal>public.localhost</literal> and
399 <literal>private.localhost</literal>
400 that you added to the file <filename>/etc/hosts</filename>
401 in a previous step:</para>
404 <para>the <systemitem class="username">router</systemitem> user,
405 to whom all requests to connect to an OpenSRF service will be
409 <para>the <systemitem class="username">opensrf</systemitem> user,
410 which clients use to connect to OpenSRF services (you may name
411 the user anything you like, but we use
412 <literal>opensrf</literal> in these examples)</para>
415 <para>As the <systemitem class="username">root</systemitem> user, execute the
416 <command>ejabberdctl</command> utility as shown below to register and create passwords
417 for the two users on each domain. Note that the users correspond to those configured
418 in the file <filename>/openils/conf/opensrf_core.xml</filename> in the next steps.</para>
419 <programlisting language="xml"><![CDATA[
420 # The syntax for registering a user with ejabberdctl is:
421 # ejabberdctl register <user> <domain> <password>
423 ejabberdctl register router private.localhost <password #1>
424 ejabberdctl register router public.localhost <password #1>
425 ejabberdctl register opensrf private.localhost <password #2>
426 ejabberdctl register opensrf public.localhost <password #2>
430 <title>Create configuration files</title>
431 <para>As the <systemitem class="username">opensrf</systemitem> user, execute
432 the following commands to create the new configuration files
433 <filename>/openils/conf/opensrf_core.xml</filename> and
434 <filename>/openils/conf/opensrf.xml</filename> from the example templates:</para>
436 <userinput>cd /openils/conf</userinput>
437 <userinput>cp opensrf.xml.example opensrf.xml</userinput>
438 <userinput>cp opensrf_core.xml.example opensrf_core.xml</userinput>
442 <title>Change Jabber usernames and passwords</title>
443 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
444 OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>
445 and update the Jabber usernames and passwords to match the values shown in the
446 following table. The left-hand side of <xref linkend="serversideinstallation-xpath-table-1"/>
447 shows common XPath syntax to indicate the approximate position within the XML
448 file that needs changes. The right-hand side of the table shows the replacement
450 <table xml:id="serversideinstallation-xpath-table-1">
451 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>
452 <tgroup align="left" cols="2" colsep="1" rowsep="1">
453 <colspec colname="Xpath" colnum="1" colwidth="1.5*"/>
454 <colspec colname="Value" colnum="2" colwidth="2.0*"/>
457 <entry>XPath location</entry>
463 <entry>/config/opensrf/username</entry>
465 <systemitem class="username">opensrf</systemitem>
469 <entry>/config/opensrf/passwd </entry>
471 <systemitem class="domainname">private.localhost</systemitem>
472 <systemitem class="username">opensrf</systemitem> user
476 <entry>/config/gateway/username</entry>
478 <systemitem class="username">opensrf</systemitem>
482 <entry>/config/gateway/passwd</entry>
484 <systemitem class="domainname">public.localhost</systemitem>
485 <systemitem class="username">opensrf</systemitem> user
489 <entry>/config/routers/router/transport,
490 first entry where transport/server == public.localhost:
493 <systemitem class="username">router</systemitem>
497 <entry>/config/routers/router/transport,
498 first entry where transport/server == public.localhost:
501 <systemitem class="domainname">public.localhost</systemitem>
502 <systemitem class="username">router</systemitem> user
506 <entry>/config/routers/router/transport,
507 second entry where transport/server == private.localhost:
510 <systemitem class="username">router</systemitem>
514 <entry>/config/routers/router/transport,
515 second entry where transport/server == private.localhost:
518 <systemitem class="domainname">private.localhost</systemitem>
519 <systemitem class="username">router</systemitem> user
525 <para>You may also need to modify the file to specify the domains from which
526 <systemitem class="service">OpenSRF</systemitem> will accept connections,
527 and to which it will make connections.
528 If you are installing <application>OpenSRF</application> on a single server
529 and using the <systemitem class="domainname">private.localhost</systemitem> and
530 <systemitem class="domainname">public.localhost</systemitem> domains,
531 these will already be set to the correct values. Otherwise, search and replace
532 to match values for your own systems.</para>
535 <title>Set location of persistent database</title>
536 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
537 file <filename>/openils/conf/opensrf.xml</filename>, then find and modify the
538 element <literal>dbfile</literal> (near the end of the file) to set the
539 location of the persistent database:</para>
540 <programlisting language="xml"><![CDATA[
541 <!-- Example of an app-specific setting override -->
544 <dbfile>/tmp/persist.db</dbfile>
550 <title>Create Configuration Files for Users Needing <command>srfsh</command></title>
551 <para>In this section you will set up a special configuration file for each user
552 who will need to run the <command>srfsh</command> (pronounced <emphasis>surf
553 shell</emphasis>) utility.</para>
555 <primary>srfsh</primary>
557 <para>The software installation will automatically create
558 <command>srfsh</command>. This is a command line diagnostic tool for testing and
559 interacting with <application>OpenSRF</application>. It will be used in a future
560 step to complete and test the Evergreen installation. See
561 <xref linkend="serversideinstallation-testing"/> for further information.</para>
562 <para>As the <systemitem class="username">root</systemitem> user, copy the short
563 sample configuration file <filename>/openils/conf/srfsh.xml.example</filename>
564 to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home
565 directory of each user who will use <command>srfsh</command>. Finally, edit each
566 file <filename>.srfsh.xml</filename> and make the following changes. When you
567 finish, remember to change the owner of the file to match the owner of the home
570 <listitem>Modify <literal>domain</literal> to be the router hostname
571 (following our domain examples,
572 <systemitem class="domainname">private.localhost</systemitem> will give
573 <command>srfsh</command> access to all OpenSRF services, while
574 <systemitem class="domainname">public.localhost</systemitem> will only
575 allow access to those OpenSRF services that are publicly
577 <listitem>Modify <literal>username</literal> and
578 <literal>password</literal> to match the <literal>opensrf</literal>
579 Jabber user for the chosen domain</listitem>
580 <listitem>Modify <literal>logfile</literal> to be the full path for a
581 log file to which the user has write access</listitem>
582 <listitem>Modify <literal>loglevel</literal> as needed for testing</listitem>
584 <programlisting language="xml"><![CDATA[
585 <?xml version="1.0"?>
586 <!-- This file follows the standard bootstrap config file layout -->
587 <!-- found in opensrf_core.xml -->
589 <router_name>router</router_name>
590 <domain>private.localhost</domain>
591 <username>opensrf</username>
592 <passwd>privsrf</passwd>
594 <logfile>/tmp/srfsh.log</logfile>
595 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
596 <loglevel>4</loglevel>
601 <title>Modify Environmental Variable PATH for
602 <systemitem class="username">opensrf</systemitem> User</title>
603 <para>As the <systemitem class="username">opensrf</systemitem> user, modify the
604 environmental variable <envar>PATH</envar> by adding a new file path to the
605 <systemitem class="username">opensrf</systemitem> user's shell configuration
606 file <filename>.bashrc</filename>:</para>
608 <userinput>echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc</userinput>
612 <title>Start OpenSRF</title>
613 <para>As the <systemitem class="username">root</systemitem> user, start the
614 <systemitem class="service">ejabberd</systemitem> and
615 <systemitem class="service">memcached</systemitem> services:</para>
617 <userinput>/etc/init.d/ejabberd start</userinput>
618 <userinput>/etc/init.d/memcached start</userinput>
620 <para>Finally, as the <systemitem class="username">opensrf</systemitem> user,
621 start OpenSRF. Use "-l" to force hostname to be "localhost":</para>
623 <userinput>osrf_ctl.sh -l -a start_all</userinput>
626 <para>If you receive the error message <errortext>bash: osrf_ctl.sh:
627 command not found</errortext>, then your environment variable
628 <envar>PATH</envar> does not include the
629 <filename class="directory">/openils/bin</filename> directory;
630 this should have been set by <filename>.bashrc</filename> when you
631 logged in as the <systemitem class="username">opensrf</systemitem> user,
632 but you can manually set it using the following command:</para>
634 <userinput>export PATH=$PATH:/openils/bin</userinput>
637 <para>You can also start Evergreen <emphasis role="bold">without</emphasis> the
638 <option>-l</option> flag, but <command>osrf_ctl.sh</command> must know the fully
639 qualified domain name for the system on which it will execute. That hostname may
640 have been specified in the configuration file <filename>opensrf.xml</filename>,
641 which you configured in a previous step.</para>
644 <title>Test connections to OpenSRF</title>
645 <para>Once you have installed and started OpenSRF, as the
646 <systemitem class="username">root</systemitem> user, test your connection to
647 <systemitem class="service">OpenSRF</systemitem> using the <command>srfsh</command>
648 utility and trying to call the <command>add</command> method on the OpenSRF
649 <systemitem class="service">math</systemitem> service:</para>
651 <userinput>/openils/bin/srfsh</userinput>
654 request opensrf.math add 2 2
656 ------------------------------------
657 Request Completed Successfully
658 Request Time in seconds: 0.007519
659 ------------------------------------
664 <para>For other <command>srfsh</command> commands, type in
665 <userinput>help</userinput> at the prompt.</para>
668 <title>Stopping OpenSRF</title>
669 <para>As the <systemitem class="username">opensrf</systemitem> user, stop OpenSRF:</para>
671 <userinput>osrf_ctl.sh -l -a stop_all</userinput>
676 <section xml:id="serversideinstallation-ubuntudebian">
677 <title>Installing Evergreen 1.6.1.x On <systemitem class="osname">Ubuntu</systemitem> or
678 <systemitem class="osname">Debian</systemitem></title>
680 <primary>Linux</primary>
681 <secondary>Debian</secondary>
684 <primary>Linux</primary>
685 <secondary>Ubuntu</secondary>
687 <para>This section outlines the installation process for the latest stable version of
689 <para>In this section you will download, unpack, install, configure and test the Evergreen
690 system, including the Evergreen server and the PostgreSQL database system. You will make several
691 configuration changes and adjustments to the software, including updates to configure the system
692 for your own locale, and some updates needed to work around a few known issues.</para>
694 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit)
695 architectures. There may be differences between the Desktop and Server editions of
696 <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server
698 <para>In the following instructions, you are asked to perform certain steps as
699 either the <systemitem class="username">root</systemitem> user, the
700 <systemitem class="username">opensrf</systemitem> user, or the
701 <systemitem class="username">postgres</systemitem> user.</para>
704 <para><systemitem class="osname">Debian</systemitem> -- To become the
705 <systemitem class="username">root</systemitem> user, issue the command
706 <command>su -</command> and enter the password of the
707 <systemitem class="username">root</systemitem> user.</para>
710 <para><systemitem class="osname">Ubuntu</systemitem> -- To become the
711 <systemitem class="username">root</systemitem> user, issue the command
712 <command>sudo su -</command> and enter the password of the
713 <systemitem class="username">root</systemitem> user.</para>
716 <para>To switch from the <systemitem class="username">root</systemitem> user to a
717 different user, issue the command <command>su - USERNAME</command>. For example, to
718 switch from the <systemitem class="username">root</systemitem> user to the
719 <systemitem class="username">opensrf</systemitem> user, issue the command
720 <command>su - opensrf</command>. Once you have become a non-root user, to become the
721 <systemitem class="username">root</systemitem> user again, simply issue the command
722 <command>exit</command>.</para>
726 <title>Install OpenSRF</title>
727 <para>Evergreen software is integrated with and depends on the Open Service
728 Request Framework (OpenSRF) software system. For further information on
729 installing, configuring and testing OpenSRF, see
730 <xref linkend="serversideinstallation-opensrf"/>.</para>
731 <para>Follow the steps outlined in that section and run the specified tests to
732 ensure that OpenSRF is properly installed and configured. Do not continue with
733 any further Evergreen installation steps until you have verified that OpenSRF
734 has been successfully installed.</para>
737 <title>Download and Unpack Latest Evergreen Version</title>
738 <para>As the <systemitem class="username">opensrf</systemitem> user, download
739 and extract the latest version of Evergreen. The latest version can be found here:
740 <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz"></ulink></para>
742 <userinput>wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz</userinput>
743 <userinput>tar zxf Evergreen-ILS-1.6.1.2.tar.gz</userinput>
745 <para>The new directory
746 <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.1.2</filename>
747 will be created.</para>
750 <title>Install Prerequisites to Build Evergreen</title>
751 <para>In this section you will install and configure a set of prerequisites that
752 will be used to build Evergreen. In a following step you will actually build the
753 Evergreen software using the <command>make</command> utility.</para>
754 <para>As the <systemitem class="username">root</systemitem> user, enter the
755 commands show below to build the prerequisites from the software distribution
756 that you just downloaded and unpacked. Remember to replace
757 <emphasis>[DISTRIBUTION]</emphasis> in the example with the keyword
758 corresponding to the name of the <systemitem class="osname">Linux</systemitem>
759 distribution listed in the distribution keywords table
760 <xref linkend="serversideinstallation-keywords-evergreen"/> .</para>
762 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
763 <userinput>make -f Open-ILS/src/extras/Makefile.install [DISTRIBUTION]</userinput>
765 <table xml:id="serversideinstallation-keywords-evergreen">
766 <title>Keyword Targets for Evergreen <application>"make"</application> Command</title>
767 <tgroup align="left" cols="2" colsep="1" rowsep="1">
768 <colspec colnum="1" colwidth="1.0*"/>
769 <colspec colnum="2" colwidth="3.0*"/>
772 <entry>Keyword</entry>
773 <entry>Description</entry>
778 <entry>debian-etch</entry>
779 <entry>for Debian Etch (4.0)</entry>
782 <entry>debian-lenny</entry>
783 <entry>for Debian Lenny (5.0)</entry>
786 <entry>ubuntu-hardy</entry>
787 <entry>for Ubuntu Hardy Heron (8.04)</entry>
790 <entry>ubuntu-karmic</entry>
791 <entry>for Ubuntu Karmic Koala (9.10)</entry>
794 <entry>ubuntu-karmic</entry>
795 <entry>for Ubuntu Lucid Lynx (10.04)</entry>
801 <step performance="optional" xml:id="serversideinstallation-postgresql-default">
802 <title>(OPTIONAL) Install the PostgreSQL Server</title>
804 <primary>databases</primary>
805 <secondary>PostgreSQL</secondary>
807 <para>Since the PostgreSQL server is usually a standalone server in multi-server
808 production systems, the prerequisite installer Makefile in the previous step
809 does not automatically install PostgreSQL. You must install the PostgreSQL server
810 yourself, either on the same system as Evergreen itself or on another system.
811 If your PostgreSQL server is on a different system, just skip this step.</para>
812 <para>For further information on manually installing PostgreSQL, visit the official
813 <link xl:href="http://www.postgresql.org/">PostgreSQL Site</link>.</para>
814 <para>If your PostgreSQL server will be on the same system as your Evergreen
815 software, then as the <systemitem class="username">root</systemitem> user
816 install the required PostgreSQL server packages:</para>
817 <para>For <systemitem class="osname">Debian Lenny</systemitem> and
818 <systemitem class="osname">Ubuntu Hardy (8.04)</systemitem>:</para>
820 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83</userinput>
822 <para>For <systemitem class="osname">Ubuntu Karmic (9.10)</systemitem> and
823 <systemitem class="osname">Ubuntu Lucid (10.04)</systemitem>:</para>
825 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84</userinput>
828 <para>PostgreSQL versions 8.3 or 8.4 are the recommended versions to work
829 with Evergreen 1.6. If you have an older version of PostgreSQL, you should
830 upgrade before installing Evergreen. To find the running version of
831 PostgreSQL, as the <systemitem class="username">postgres</systemitem>
832 user, run the <command>psql</command>. Then type <userinput>SELECT
833 version();</userinput> to get detailed information about your version
834 of PostgreSQL.</para>
837 <step performance="optional">
838 <title>Install Perl Modules on PostgreSQL Server</title>
839 <para>If PostgreSQL is running on the same system as your Evergreen software,
840 then the Perl modules will automatically be available. Just skip this step.
841 Otherwise, continue if your PostgreSQL server is running on another system.</para>
842 <para>You will need to install several Perl modules on the other system. As the
843 <systemitem class="username">root</systemitem> user install the following Perl
846 <userinput># first, ensure the gcc compiler is installed:</userinput>
847 <userinput>apt-get install gcc</userinput>
848 <userinput># then install the Perl modules:</userinput>
849 <userinput>perl -MCPAN -e shell</userinput>
850 <prompt>cpan></prompt>
851 <userinput>install JSON::XS</userinput>
852 <prompt>cpan></prompt>
853 <userinput>install MARC::Record</userinput>
854 <prompt>cpan></prompt>
855 <userinput>install MARC::File::XML</userinput>
857 <para>For more information on installing Perl Modules vist the official
858 <link xl:href="http://www.cpan.org/">CPAN</link> site.</para>
860 <primary>Perl</primary>
861 <secondary>CPAN</secondary>
865 <title>Update the System Dynamic Library Path</title>
866 <para>You must update the system dynamic library path to force your system to
867 recognize the newly installed libraries. As the <systemitem class="username">root</systemitem>
868 user, create a file named /etc/ld.so.conf.d/eg.conf containing the new library paths:</para>
873 <para>Then run the command <command>ldconfig</command> to automatically read the
874 file and modify the system dynamic library path:</para>
876 <userinput>ldconfig</userinput>
879 <step performance="optional">
880 <title>Restart the PostgreSQL Server</title>
881 <para>If PostgreSQL is running on the same system as the rest of Evergreen, as
882 the <systemitem class="username">root</systemitem> user you must restart
883 PostgreSQL to re-read the new library paths just configured. If PostgreSQL is
884 running on another system, you may skip this step. As the <systemitem class="username">opensrf</systemitem>
885 user, execute the following command, where
886 <literal>[PGSQL_VERSION]</literal> is your installed PostgreSQL version
887 (e.g. <literal>8.3</literal>):</para>
889 <userinput>/etc/init.d/postgresql-[PGSQL_VERSION] restart</userinput>
892 <step xml:id="serversideinstallation-configure">
893 <title>Configure Evergreen</title>
894 <para>As the <systemitem class="username">opensrf</systemitem> user, return to
895 the Evergreen build directory and use the <command>configure</command> and
896 <command>make</command> utilities to configure Evergreen so it can be compiled
897 and linked in the next step:</para>
899 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
900 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>
901 <userinput>make</userinput>
904 <step xml:id="serversideinstallation-compilingevergreen"><title>Compile, Link and Install Evergreen</title><para>In this step you will actually compile, link and install Evergreen and the default
905 Evergreen Staff Client.</para><para>As the <systemitem class="username">root</systemitem>
906 user, return to the Evergreen build directory and use the <command>make</command> utility
907 as shown below. The Staff Client will also be automatically built, but you must remember
908 to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the Staff
909 Client you will use to connect to the Evergreen server.</para><para>For further information on manually building the Staff Client, see
910 <xref linkend="staffclientinstallation-building-staffclient"/>.</para><screen><userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput><userinput>make STAFF_CLIENT_BUILD_ID=rel_1_6_1_2 install</userinput></screen><para>The above commands will create a new subdirectory
911 <filename class="directory">/openils/var/web/xul/rel_1_6_1_2</filename>
912 containing the Staff Client.</para> <para>To complete the Staff Client installation,
913 as the <systemitem class="username">root</systemitem> user create a symbolic link
914 named <emphasis>server</emphasis> in the head of the Staff Client directory
915 <filename class="directory">/openils/var/web/xul</filename> that points to the
916 subdirectory <filename class="directory">/server</filename> of the new Staff
917 Client build:</para><screen><userinput>cd /openils/var/web/xul</userinput><userinput>ln -sf rel_1_6_1_2/server server</userinput></screen></step>
919 <title>Copy the OpenSRF Configuration Files</title>
920 <para>As the <systemitem class="username">root</systemitem> user, copy the
921 example OpenSRF configuration files into place. This replaces the configuration
922 files that you set up in a previous step when you installed and tested
923 OpenSRF. You should also create backup copies of the old files for
924 troubleshooting purposes. Finally, change the ownership on the installed files
925 to the <systemitem class="username">opensrf</systemitem> user:</para>
927 <userinput>cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml</userinput>
928 <userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput>
929 <userinput>cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml</userinput>
930 <userinput>chown -R opensrf:opensrf /openils/</userinput>
934 <title>Create and Configure PostgreSQL Database</title>
936 <primary>databases</primary>
937 <secondary>PostgreSQL</secondary>
939 <para>In this step you will create the Evergreen database. In the commands
940 below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis>
941 repository to match your PostgreSQL server
942 layout. For example, if you built PostgreSQL from source the path would be
943 <filename class="directory">/usr/local/share/contrib</filename>; if you
944 installed the PostgreSQL 8.3 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>,
946 <systemitem class="directory">/usr/share/postgresql/8.3/contrib/</systemitem>.</para>
950 <emphasis role="bold">Create and configure the database</emphasis>
952 <para>As the <systemitem class="username">postgres</systemitem>
953 user on the PostgreSQL system create the PostgreSQL database,
954 then set some internal paths:</para>
955 <para>Create the database:</para>
957 <userinput>createdb -E UNICODE evergreen</userinput>
958 <userinput>createlang plperl evergreen</userinput>
959 <userinput>createlang plperlu evergreen</userinput>
960 <userinput>createlang plpgsql evergreen</userinput>
962 <para>Adjust the paths as shown, where
963 <literal>[PGSQL_VERSION]</literal> is your installed PostgreSQL
964 version (e.g. <literal>8.3</literal>).</para>
966 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/tablefunc.sql evergreen</userinput>
967 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/tsearch2.sql evergreen</userinput>
968 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/pgxml.sql evergreen</userinput>
972 <title>Create <systemitem class="username">evergreen</systemitem> PostgreSQL user</title>
973 <para>As the <systemitem class="username">postgres</systemitem>
974 user on the PostgreSQL system, create a new PostgreSQL user
975 named <systemitem class="username">evergreen</systemitem> and
976 assign a password:</para>
978 <userinput>createuser -P -s evergreen</userinput>
979 <prompt>Enter password for new role: MYNEWPASSWORD</prompt>
980 <prompt>Enter it again: MYNEWPASSWORD</prompt>
984 <title>Create Database Schema</title>
985 <para>As the <systemitem class="username">root</systemitem>
986 user, create the database schema and configure your system with
987 the corresponding database authentication details for the
988 <emphasis>evergreen</emphasis> database user that you created in
989 the previous step.</para>
990 <para>Enter the following commands and replace
991 <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and
992 <emphasis>DATABASENAME</emphasis> with appropriate
995 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
996 <userinput>perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \</userinput>
997 <userinput> --service all --create-schema --create-bootstrap --create-offline \</userinput>
998 <userinput> --hostname HOSTNAME --port PORT \</userinput>
999 <userinput> --user evergreen --password PASSWORD --database DATABASENAME</userinput>
1001 <para>On most systems, <emphasis>HOSTNAME</emphasis> will be
1002 <emphasis role="bold">localhost</emphasis>,
1003 <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>,
1004 and <emphasis>PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis>
1005 will be <emphasis role="bold">evergreen</emphasis>.</para>
1007 <para>If you are entering the above command on a single
1008 line, do not include the <literal>\</literal>
1009 (backslash) characters. If you are using the
1010 <command>bash</command> shell, these should only be used
1011 at the end of a line at a bash prompt to indicate that
1012 the command is continued on the next line.</para>
1016 <title>Configure the Apache web server</title>
1018 <primary>web server</primary>
1019 <secondary>Apache</secondary>
1021 <para>In this step you will configure the Apache web server to
1022 support Evergreen software.</para>
1023 <para>First, you must enable some built-in Apache modules and install
1024 some additional Apache configuration files. Then you will create a new
1025 Security Certificate. Finally, you must make several changes to the Apache
1026 configuration file.</para>
1029 <title>Enable the required Apache Modules</title>
1030 <para>As the <systemitem class="username">root</systemitem> user, enable
1031 some modules in the Apache server, then copy the
1032 new configuration files to the Apache server
1035 <userinput>a2enmod ssl # enable mod_ssl</userinput>
1036 <userinput>a2enmod rewrite # enable mod_rewrite</userinput>
1037 <userinput>a2enmod expires # enable mod_expires</userinput>
1041 <title>Copy Apache configuration files</title>
1042 <para>You must copy the Apache configuration
1043 files from the Evergreen installation dierectory
1044 to the Apache directory. As the
1045 <systemitem class="username">root</systemitem>
1046 user, perform the following commands:</para>
1048 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
1049 <userinput>cp Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/</userinput>
1050 <userinput>cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/</userinput>
1051 <userinput>cp Open-ILS/examples/apache/startup.pl /etc/apache2/</userinput>
1055 <title>Create a Security Certificate</title>
1056 <para>You must create a new Security Certificate (SSL Key)
1057 for the Apache server using the <command>openssl</command>
1058 command. For a public production server you must configure
1059 or purchase a signed SSL certificate, but for now you can
1060 just use a self-signed certificate and accept the warnings
1061 in the Staff Client and browser during testing and
1063 <systemitem class="username">root</systemitem> user,
1064 perform the following commands:</para>
1066 <userinput>mkdir /etc/apache2/ssl</userinput>
1067 <userinput>cd /etc/apache2/ssl</userinput>
1068 <userinput>openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key</userinput>
1071 <para>This step generates a self-signed SSL
1072 certificate. You must install a proper SSL
1073 certificate for a public production system to
1074 avoid warning messages when users login to their
1075 account through the OPAC or when staff login
1076 through the staff client.</para>
1077 <para>For further information on getting a proper
1078 SSL certificate, see
1079 <xref linkend="serversideinstallation-ssl"/>.</para>
1082 <step xml:id="serversideinstallation-modify-apache">
1083 <title>Update Apache configuration file</title>
1084 <para>You must make several changes to the new Apache
1086 <filename>/etc/apache2/sites-available/eg.conf</filename>. As
1087 the <systemitem class="username">root</systemitem> user,
1088 edit the file and make the following changes:</para>
1091 <para>Comment out the line <literal>Allow
1092 from 10.0.0.0/8</literal> and uncomment
1093 the line <literal>Allow from
1094 all</literal>.</para>
1095 <para>This change allows access to your
1096 configuration CGI scripts from
1097 <emphasis role="bold">any</emphasis> workstation on
1098 <emphasis role="bold">any</emphasis>
1099 network. This is only a temporary change
1100 to expedite testing and should be removed
1101 after you have finished and successfully
1102 tested the Evergreen installation.</para>
1105 <emphasis>You must remove these changes
1106 after testing is completed. See
1107 <xref linkend="serversideinstallation-postinstallation"/>
1108 for further details on removing this change
1109 after the Evergreen installation is
1110 complete.</emphasis>
1115 <para>Comment out the line <literal>Listen
1116 443</literal>, since it conflicts with the
1117 same declaration in the configuration file:
1118 <filename>/etc/apache2/ports.conf</filename>.
1119 Note that <systemitem class="osname">Debian
1120 </systemitem> users should not do this
1121 since the conflict does not apply to that
1122 operating system.</para>
1125 <para>The following updates are needed to allow
1126 the logs to function properly, but it may break
1127 other Apache applications on your server:</para>
1128 <para>For the <systemitem class="osname">Linux</systemitem>
1129 distributions <systemitem class="osname">Ubuntu
1130 Hardy</systemitem> or
1131 <systemitem class="osname">Debian Etch</systemitem>,
1132 as the <systemitem class="username">root</systemitem>
1133 user, edit the Apache configuration file
1134 <filename>/etc/apache2/apache2.conf</filename> and
1135 change the line <literal>User www-data</literal>
1136 to <literal>User opensrf</literal>.</para>
1137 <para>For the <systemitem class="osname">Linux</systemitem>
1138 distributions <systemitem class="osname">Ubuntu
1139 Karmic</systemitem> or
1140 <systemitem class="osname">Ubuntu Lucid</systemitem>
1141 or <systemitem class="osname">Debian
1142 Lenny</systemitem>, as the
1143 <systemitem class="username">root</systemitem>
1144 user, edit the Apache configuration file
1145 <filename>/etc/apache2/envvars</filename> and
1146 change the line <literal>export
1147 APACHE_RUN_USER=www-data</literal> to
1149 APACHE_RUN_USER=opensrf</literal>.</para>
1154 <title>Enable the Evergreen web site</title>
1155 <para>Finally, you must enable the Evergreen web site. As the
1156 <systemitem class="username">root</systemitem> user, execute
1157 the following Apache configuration commands to disable the default
1158 <emphasis>It Works</emphasis> web page and enable the
1159 Evergreen web site:</para>
1161 <userinput>a2dissite default</userinput>
1162 <userinput>a2ensite eg.conf</userinput>
1169 <step xml:id="serversideinstallation-opensrf-config">
1170 <title>Modify the OpenSRF Configuration File</title>
1171 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
1172 OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>
1173 to update the Jabber usernames and passwords, and to specify the domain from
1174 which we will accept and to which we will make connections.</para>
1175 <para>If you are installing Evergreen on a single server and using the
1176 <systemitem class="domainname">private.localhost</systemitem> /
1177 <systemitem class="domainname">public.localhost</systemitem> domains,
1178 these will already be set to the correct values. Otherwise, search and replace
1179 to match your customized values.</para>
1180 <para>The left-hand side of <xref linkend="serversideinstallation-xpath-table-2"/>
1181 shows common XPath syntax to indicate the approximate position within the XML
1182 file that needs changes. The right-hand side of the table shows the replacement
1184 <table xml:id="serversideinstallation-xpath-table-2">
1185 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>
1186 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1187 <colspec colname="Xpath" colnum="1" colwidth="1.5*"/>
1188 <colspec colname="Value" colnum="2" colwidth="2.0*"/>
1191 <entry>XPath location</entry>
1192 <entry>Value</entry>
1197 <entry>/config/opensrf/username</entry>
1199 <systemitem class="username">opensrf</systemitem>
1203 <entry>/config/opensrf/passwd </entry>
1205 <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">opensrf</systemitem> user
1209 <entry>/config/gateway/username</entry>
1211 <systemitem class="username">opensrf</systemitem>
1215 <entry>/config/gateway/passwd</entry>
1217 <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">opensrf</systemitem> user
1221 <entry>/config/routers/router/transport,
1222 first entry where transport/server == public.localhost:
1225 <systemitem class="username">router</systemitem>
1229 <entry>/config/routers/router/transport,
1230 first entry where transport/server == public.localhost:
1233 <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">router</systemitem> user
1237 <entry>/config/routers/router/transport,
1238 second entry where transport/server == private.localhost:
1241 <systemitem class="username">router</systemitem>
1245 <entry>/config/routers/router/transport,
1246 second entry where transport/server == private.localhost:
1249 <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">router</systemitem> user
1256 <step xml:id="serversideinstallation-srfsh">
1257 <title>Create Configuration Files for Users Needing <command>srfsh</command></title>
1258 <para>The software installation will automatically create a utility named
1259 <command>srfsh</command> (surf shell). This is a command line diagnostic tool
1260 for testing and interacting with the OpenSRF network software. It will be used
1261 in a future step to complete and test the Evergreen installation. See
1262 <xref linkend="serversideinstallation-testing"/> for further information.</para>
1263 <para>In this section you will set up a special configuration file for each user
1264 who will need to run the utility. Copy the short sample configuration file
1265 <filename>/openils/conf/srfsh.xml.example</filename> to the file
1266 <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of
1267 each user who will use <command>srfsh</command>. Finally, edit each user's
1268 <filename>.srfsh.xml</filename> file and make the following changes:</para>
1271 <para>Modify <emphasis role="bold">domain</emphasis> to be the
1272 router hostname (following our domain examples,
1273 <systemitem class="domainname">private.localhost</systemitem>>
1274 will give <command>srfsh</command> access to all OpenSRF services,
1275 while <systemitem class="domainname">public.localhost</systemitem>
1276 will only allow access to those OpenSRF services that are
1277 publicly exposed).</para>
1280 <para>Modify <emphasis role="bold">username</emphasis> and
1281 <emphasis role="bold">password</emphasis> to match the
1282 <systemitem class="username">opensrf</systemitem> Jabber user
1283 for the chosen domain.</para>
1286 <para>Modify <emphasis role="bold">logfile</emphasis> to be the
1287 full path for a log file to which the user has write
1291 <para>Modify <emphasis role="bold">loglevel</emphasis> as needed
1295 <programlisting language="xml"><![CDATA[
1296 <?xml version="1.0"?>
1297 <!-- This file follows the standard bootstrap config file layout -->
1298 <!-- found in opensrf_core.xml -->
1300 <router_name>router</router_name>
1301 <domain>private.localhost</domain>
1302 <username>opensrf</username>
1303 <passwd>evergreen</passwd>
1305 <logfile>/tmp/srfsh.log</logfile>
1306 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
1307 <loglevel>4</loglevel>
1309 ]]></programlisting>
1311 <step xml:id="serversideinstallation-opensrf-env">
1312 <title>Modify the OpenSRF Environment</title>
1313 <para>Modify the shell configuration file <filename>~/.bashrc</filename> for
1314 user <systemitem class="username">opensrf</systemitem> by adding a Perl environmental
1315 variable, then execute the shell configuration file to load the new variables into
1316 your current environment.</para>
1319 <emphasis>In a multi-server environment, you must add any
1320 modifications to <filename>~/.bashrc</filename> to the top of
1321 the file <emphasis>before</emphasis> the line
1322 <literal>[ -z "$PS1" ] && return </literal>.
1323 This will allow headless (scripted) logins to load the correct
1324 environment.</emphasis>
1328 <userinput>echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc</userinput>
1329 <userinput>. ~/.bashrc</userinput>
1333 <title>(OPTIONAL) Enable and Disable Language Localizations</title>
1334 <para>You can load translations such as Armenian (hy-AM), Canadian French
1335 (fr-CA), and others into the database to complete the translations available in
1336 the OPAC and staff client. For further information, see <xref linkend="localization"/>.</para>
1340 <section xml:id="serversideinstallation-starting">
1341 <title>Starting Evergreen</title>
1344 <para>As the <systemitem class="username">root</systemitem>
1345 user, start the <systemitem class="service">ejabberd</systemitem> and
1346 <systemitem class="service">memcached</systemitem> services
1347 (if they are not already running):</para>
1349 <userinput>/etc/init.d/ejabberd start</userinput>
1350 <userinput>/etc/init.d/memcached start</userinput>
1354 <para>As the <systemitem class="username">opensrf</systemitem>
1355 user, start Evergreen.</para>
1356 <para>Use the flag <option>-l</option> to force Evergreen to use
1357 <systemitem class="domainname">localhost</systemitem> (your
1358 current system) as the hostname. Using the
1359 <option>start_all</option> option will start the OpenSRF
1360 <systemitem class="service">router</systemitem> ,
1361 <systemitem class="service">Perl</systemitem> , and
1362 <systemitem class="service">C</systemitem> services:</para>
1364 <userinput>$ osrf_ctl.sh -l -a start_all</userinput>
1368 <emphasis>You can also start Evergreen
1369 <emphasis role="bold">without</emphasis>
1370 the <option>-l</option> flag, but the
1371 <command>osrf_ctl.sh</command> utility must know
1372 the fully qualified domain name for the system
1373 on which it will execute. That hostname may have
1374 been specified in the configuration file
1375 <filename>opensrf.xml</filename>, which you
1376 configured in a previous step.</emphasis>
1378 <para>Use the <command>hostname</command> command to
1379 determine the fully qualified domain name of your
1384 <para>If you receive an error message similar to
1385 <emphasis>osrf_ctl.sh: command not found</emphasis>,
1386 then your environment variable
1387 <envar>PATH</envar> does not include the directory
1388 <filename class="directory">/openils/bin</filename>.
1390 <systemitem class="username">opensrf</systemitem>
1391 user, edit the configuration file
1392 <filename>/home/opensrf/.bashrc</filename> and
1393 add the following line:
1394 <literal>export PATH=$PATH:/openils/bin</literal></para>
1397 <para>If you receive an error message similar to
1398 <emphasis>Can't locate OpenSRF/System.pm in
1399 @INC ... BEGIN failed--compilation
1400 aborted</emphasis>, then your environment variable
1401 <emphasis role="bold">PERL5LIB</emphasis> does not
1402 include the directory
1403 <filename class="directory">/openils/lib/perl5</filename>.
1405 <systemitem class="username">opensrf</systemitem>
1406 user, edit the configuration file
1407 <filename>/home/opensrf/.bashrc</filename> and
1408 add the following line:
1409 <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>
1414 <para>As the <systemitem class="username">opensrf</systemitem>
1415 user, generate the Web files needed by the Staff Client and
1416 catalog, and calculate the proximity of locations in the
1417 Organizational Unit tree (which allows
1418 <emphasis>Holds</emphasis> to work properly):</para>
1420 <userinput>cd /openils/bin</userinput>
1421 <userinput>./autogen.sh -c /openils/conf/opensrf_core.xml -u</userinput>
1423 Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
1424 Updating fieldmapper
1427 <para>You must do this the first time you start Evergreen, and
1428 after making any changes to the library hierarchy.</para>
1431 <para>As the <systemitem class="username">root</systemitem>
1432 user, restart the Apache Web server:</para>
1434 <userinput>/etc/init.d/apache2 restart</userinput>
1437 <para>If the Apache Web server was running when you
1438 started the OpenSRF services, you might not be able to
1439 successfully log in to the OPAC or Staff Client until
1440 the Apache Web server is restarted.</para>
1445 <section xml:id="serversideinstallation-testing">
1446 <title>Testing the Installation</title>
1447 <para>This section describes several simple tests you can perform to verify that the Evergreen
1448 server-side software has been installed and configured properly and is running as
1450 <simplesect xml:id="serversideinstallation-testing-connections">
1451 <title>Testing Connections to Evergreen</title>
1452 <para>Once you have installed and started Evergreen, test your connection to
1453 Evergreen. As the <systemitem class="username">opensrf</systemitem> user start the
1454 <command>srfsh</command> application and try logging onto the Evergreen server using the
1455 default administrator username and password. Following is sample output generated by
1456 executing <command>srfsh</command> after a successful Evergreen installation.
1457 For help with <command>srfsh</command> commands, type <userinput>help</userinput>
1458 at the prompt:</para>
1460 <userinput>/openils/bin/srfsh</userinput>
1461 <prompt>srfsh%</prompt>
1462 <userinput>login admin open-ils</userinput>
1463 <prompt>Received Data: "250bf1518c7527a03249858687714376"</prompt>
1464 <prompt>------------------------------------</prompt>
1465 <prompt>Request Completed Successfully</prompt>
1466 <prompt>Request Time in seconds: 0.045286</prompt>
1467 <prompt>------------------------------------</prompt>
1468 <prompt>Received Data: {</prompt>
1469 <prompt> "ilsevent":0,</prompt>
1470 <prompt> "textcode":"SUCCESS",</prompt>
1471 <prompt> "desc":" ",</prompt>
1472 <prompt> "pid":21616,</prompt>
1473 <prompt> "stacktrace":"oils_auth.c:304",</prompt>
1474 <prompt> "payload":{</prompt>
1475 <prompt> "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",</prompt>
1476 <prompt> "authtime":420</prompt>
1479 <prompt>------------------------------------</prompt>
1480 <prompt>Request Completed Successfully</prompt>
1481 <prompt>Request Time in seconds: 1.336568</prompt>
1482 <prompt>------------------------------------</prompt>
1484 <para>If this does not work, try the following:</para>
1486 <listitem>As the <systemitem class="username">opensrf</systemitem> user, run the
1487 script <filename>Open-ILS/src/support-scripts/settings-tester.pl</filename> to
1488 see if it finds any system configuration problems. If the output of
1489 <command>settings-tester.pl</command> does not help you find the problem, please
1490 do not make any significant changes to your configuration.</listitem>
1491 <listitem>Follow the steps in the troubleshooting guide in
1492 <xref linkend="troubleshooting"/>.</listitem>
1493 <listitem>If you have followed the entire set of installation steps listed here
1494 closely, you are probably extremely close to a working system. Gather your
1495 configuration files and log files and contact the
1496 <ulink url="http://open-ils.org/listserv.php">Evergreen Development Mailing List</ulink>
1497 list for assistance before making any drastic changes to your
1498 system configuration.</listitem>
1502 <section xml:id="serversideinstallation-virtual">
1503 <title>Installing In Virtualized <systemitem class="osname">Linux</systemitem> Environments</title>
1504 <para>This section describes the installation of Evergreen software in so-called "virtualized"
1505 software environments. Evergreen software runs as a native application on any of several
1506 well-known x86 (32-bit) and x86-64 (64-bit) <systemitem class="osname">Linux</systemitem>
1507 distributions including <systemitem class="osname">Ubuntu</systemitem> and
1508 <systemitem class="osname">Debian</systemitem> but it does not run as a native application
1509 on the <systemitem class="osname">Microsoft Windows</systemitem> operating system.
1510 However, it is possible to execute Evergreen on a <systemitem class="osname">Windows</systemitem>
1511 host system by running it within a virtual Linux-guest installation, which itself executes
1512 on the <systemitem class="osname">Windows</systemitem> system.
1513 The <systemitem class="osname">Linux</systemitem> environment is fully emulated and acts
1514 (within limits) just as if it were executing on a real standalone system.</para>
1515 <para>This technique of emulating a <systemitem class="osname">Linux</systemitem> environment on
1516 a <systemitem class="osname">Windows</systemitem> host is a practical way to install and run an
1517 Evergreen system if it is not possible to dedicate a physical machine solely as a
1518 <systemitem class="osname">Linux</systemitem> host for Evergreen. This architecture is not
1519 recommended for large scale systems since there are performance limitations to running Evergreen
1520 in a virtualized environment. However, it is a reasonable architecture for smaller experimental
1521 systems, as a proof of concept, or as a conference-room pilot.</para>
1523 <title>Installing Virtualization Software</title>
1524 <para>As described above, Evergreen can be installed on top of an emulated
1525 <systemitem class="osname">Linux</systemitem> environment. The
1526 <systemitem class="osname">Linux</systemitem> environment, in turn, is installed
1527 on top of a software application such as <application>"VirtualBox"</application>,
1528 <application>"VMware"</application> or <application>"VirtualPC"</application> which must
1529 first be installed on the <systemitem class="osname">Windows</systemitem> system. This
1530 section contains step-by-step examples that show installing popular virtualization
1531 applications on a <systemitem class="osname">Windows</systemitem> host system. Following
1532 this section are further descriptions of installing
1533 <systemitem class="osname">Linux</systemitem> and Evergreen systems using that
1534 virtualization software.</para>
1536 <title>Installing <application>"VirtualBox"</application> Virtualization Software</title>
1537 <para>This section reviews installation of the
1538 <application>"VirtualBox"</application> application on
1539 <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>.
1540 Download the latest edition of <application>VirtualBox</application> from their official website:
1541 <link xl:href="http://virtualbox.org" xl:title="virtual box">http://virtualbox.org</link>
1542 and follow the on screen instructions to install the software.</para>
1545 <title>Installing VMware Virtualization Software</title>
1547 <primary>virtualization software</primary>
1548 <secondary>VMware</secondary>
1550 <para>This section reviews installation of the
1551 <application>"VMware"</application> application on
1552 <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>.
1553 Find and Download the free virtual machine software of from the VMware
1555 <ulink url="http://downloads.vmware.com">http://downloads.vmware.com</ulink>
1556 and follow the on-screen instructions.</para>
1559 <simplesect xml:id="serversideinstallation-virtual-install-linux-ev">
1560 <title>Installing <systemitem class="osname">Linux</systemitem> /
1561 Evergreen on Virtualization Software</title>
1562 <para>After the virtualization software is installed and running, there are two ways to
1563 continue with installing <systemitem class="osname">Linux</systemitem> and Evergreen
1564 software in the new virtualized environment:</para>
1567 <para>Download and install a prebuilt software image that contains a
1568 working <systemitem class="osname">Linux</systemitem> / Evergreen system
1569 (see <xref linkend="serversideinstall-virtual-prebuilt"/> for
1573 <para>Manually install a <systemitem class="osname">Linux</systemitem>
1574 guest system, then manually install Evergreen on it (see
1575 <xref linkend="serversideinstall-virtual-manual"/> for details)</para>
1578 <para>We review each method in the following sections.</para>
1579 <simplesect xml:id="serversideinstall-virtual-prebuilt">
1580 <title>Download and install a prebuilt software image</title>
1581 <para>You can download a prebuilt software image that, when installed with your
1582 virtualization software, emulates a
1583 <systemitem class="osname">Linux</systemitem> guest system containing a running
1584 Evergreen distribution. The image is essentially a snapshot of a hard disk from
1585 a fully configured, functional <systemitem class="osname">Linux</systemitem>
1586 system with Evergreen already installed.</para>
1587 <para>We recommend this approach if you wish to get Evergreen running quickly
1588 with minimal attention to configuration. After reviewing only a few
1589 configuration details you can have a working Evergreen system that integrates
1590 smoothly with the rest of your network. See
1591 <xref linkend="serversideinstall-virtual-versions"/> for a list of prebuilt
1592 software images that are currently available to download and install</para>
1593 <note>DISCLAIMER: The following virtual images have been contributed by members
1594 of the Evergreen community for the purposes of testing, evaluation, training,
1595 and development.</note>
1596 <table xml:id="serversideinstall-virtual-versions">
1597 <title>Linux / Evergreen Virtual Images</title>
1598 <tgroup align="left" cols="4" colsep="1" rowsep="1">
1599 <colspec colnum="1" colwidth="1.0*"/>
1600 <colspec colnum="2" colwidth="1.0*"/>
1601 <colspec colnum="3" colwidth="3.0*"/>
1602 <colspec colnum="4" colwidth="1.0*"/>
1605 <entry>Linux Version</entry>
1606 <entry>Evergreen Version</entry>
1607 <entry>Image</entry>
1608 <entry>Comments</entry>
1613 <entry>Debian lenny (5.0)</entry>
1614 <entry>1.6.0.1</entry>
1616 <ulink url="http://www.open-ils.org/~denials/Evergreen1601_DebianLenny.zip"> download </ulink>
1618 <entry>VirtualBox image</entry>
1621 <entry>Ubuntu karmic koala (9.10)</entry>
1622 <entry>1.6.0.0</entry>
1624 <ulink url="http://www.open-ils.org/~denials/Evergreen-1600-Karmic.zip"> download </ulink>
1626 <entry>VirtualBox image</entry>
1632 <title>VirtualBox Example</title>
1634 <primary>virtualization software</primary>
1635 <secondary>VirtualBox</secondary>
1638 <para>Start VirtualBox for the first time and select
1639 <menuchoice><guimenu>File</guimenu><guimenuitem>VirtualBox Media
1640 Manager</guimenuitem><guimenuitem>Add</guimenuitem></menuchoice>
1641 to locate the prebuilt software image just downloaded (the
1642 example shows it was extracted from the original
1643 <filename class="extension">zip</filename> file into a temporary directory
1644 <filename class="directory">C:\temp</filename>).</para>
1647 <para>After selecting the file, click <guibutton>Open</guibutton> to import it.</para>
1650 <para>Then click <guibutton>OK</guibutton> to save the selection
1651 and return to the VirtualBox Media Manager</para>
1654 <para>Click <guibutton>New</guibutton>, then <guibutton>Next</guibutton> to continue
1655 and create a new virtual machine (VM).</para>
1658 <para>Create a new name for the VM and set the operating system
1659 type, then click <guibutton>Next</guibutton>.</para>
1662 <para>Set the memory size (at least 512Mb),
1663 then click <guibutton>Next</guibutton>.</para>
1666 <para>Edit the Virtual Hard Disk configuration settings; click
1667 the radio boxes <guilabel>Boot Hard Disk</guilabel> and
1668 <guilabel>Use existing hard disk</guilabel>
1669 and ensure that the disk name <guilabel>Evergreen1601_DebianLenny.vmdk</guilabel>
1670 is selected. Click <guibutton>Finish</guibutton> to finish the
1674 <para>Install the <application>VirtualBox Guest
1675 Additions</application> (really a required upgrade to
1679 <para>Return to VirtualBox and see the summary of the VM just
1680 created. Click <guibutton>Start</guibutton> to boot the new VM.</para>
1683 <para>See the start of the <systemitem class="osname">Linux</systemitem>
1684 boot sequence. Choose <guimenuitem>Debian Gnu/Linux, kernel
1685 2.6.26-2-686</guimenuitem> from the startup menu and click
1686 <guibutton>Enter</guibutton> to start
1687 <systemitem class="osname">Linux</systemitem> and Evergreen.
1688 After some delay you should see the command line prompt
1689 <prompt>debian-lenny login:</prompt>. Log in with username
1690 <userinput>root</userinput> and password <userinput>evergreen</userinput>