1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter version="5.0" xml:id="serversideinstallation" xml:lang="EN" 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 <emphasis><emphasis role="bold">not</emphasis></emphasis>
106 continue with any further Evergreen installation steps
107 until you have verified that OpenSRF has been successfully installed and tested.</para>
109 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit)
110 platforms. OpenSRF 1.4.0 has been tested on <systemitem class="osname">Debian Etch
111 (4.0)</systemitem>, <systemitem class="osname">Debian Lenny (5.0)</systemitem> and
112 <systemitem class="osname">Ubuntu Lucid Lynx (10.04)</systemitem>.</para>
113 <para>In the following instructions, you are asked to perform certain steps as
114 either the <systemitem class="username">root</systemitem> user, the
115 <systemitem class="username">opensrf</systemitem> user, or the
116 <systemitem class="username">postgres</systemitem> user.</para>
119 <para><systemitem class="osname">Debian</systemitem> -- To become the
120 <systemitem class="username">root</systemitem> user, issue the command
121 <command>su -</command> and enter the password of the
122 <systemitem class="username">root</systemitem> user.</para>
125 <para><systemitem class="osname">Ubuntu</systemitem> -- To become the
126 <systemitem class="username">root</systemitem> user, issue the command
127 <command>sudo su -</command> and enter the password of the
128 <systemitem class="username">root</systemitem> user.</para>
131 <para>To switch from the <systemitem class="username">root</systemitem> user to a
132 different user, issue the command <command>su - USERNAME</command>. For example, to
133 switch from the <systemitem class="username">root</systemitem> user to the
134 <systemitem class="username">opensrf</systemitem> user, issue the command
135 <command>su - opensrf</command>. Once you have become a non-root user, to become
136 the <systemitem class="username">root</systemitem> user again, simply issue the command
137 <command>exit</command>.</para>
141 <title>Add New <systemitem class="username">opensrf</systemitem> User</title>
142 <para>As the <systemitem class="username">root</systemitem> user, add the
143 <systemitem class="username">opensrf</systemitem> user to the system.
144 In the following example, the default shell for the
145 <systemitem class="username">opensrf</systemitem> user is automatically set
146 to <command>/bin/bash</command> to inherit a reasonable environment:</para>
148 <prompt># as the root user:</prompt>
149 <userinput>useradd -m -s /bin/bash opensrf</userinput>
150 <userinput>passwd opensrf</userinput>
154 <title>Download and Unpack Latest OpenSRF Version</title>
156 <primary>OpenSRF</primary>
157 <secondary>download</secondary>
159 <para>The latest version of OpenSRF can be found here:
160 <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.4.0.tar.gz"></ulink> .
161 As the <systemitem class="username">opensrf</systemitem> user, change to
162 the directory <filename class="directory">/home/opensrf</filename> then download
163 and extract OpenSRF. The new subdirectory
164 <filename class="directory">/home/opensrf/OpenSRF-1.4.0</filename> will be created:</para>
166 <prompt># as the opensrf user:</prompt>
167 <userinput>cd /home/opensrf</userinput>
168 <userinput>wget http://evergreen-ils.org/downloads/OpenSRF-1.4.0.tar.gz</userinput>
169 <userinput>tar zxf OpenSRF-1.4.0.tar.gz</userinput>
173 <title>Install Prerequisites to Build OpenSRF</title>
174 <para>In this section you will install and configure a set of prerequisites that will be
175 used to build OpenSRF. In a following step you will actually build the OpenSRF software
176 using the <command>make</command> utility.</para>
177 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show
178 below to build the prerequisites from the software distribution that you just downloaded
179 and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the following
180 example with the keyword corresponding to the name of one of the
181 <systemitem class="osname">Linux</systemitem> distributions listed in the following
182 distribution keywords table <xref linkend="serversideinstallation-keywords-opensrf"/> .
183 For example, to install the prerequisites for Ubuntu version 10.04 (Lucid Lynx) you would
184 enter this command: <command>make -f src/extras/Makefile.install ubuntu-lucid</command> .</para>
186 <prompt># as the root user:</prompt>
187 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
188 <userinput>make -f src/extras/Makefile.install [DISTRIBUTION]</userinput>
190 <table xml:id="serversideinstallation-keywords-opensrf">
191 <title>Keyword Targets for OpenSRF <application>"make"</application> Command</title>
192 <tgroup align="left" cols="2" colsep="1" rowsep="1">
193 <colspec colnum="1" colwidth="1.0*"/>
194 <colspec colnum="2" colwidth="3.0*"/>
197 <entry>Keyword</entry>
198 <entry>Linux Version</entry>
203 <entry>debian-etch</entry>
204 <entry>Debian "Etch" (4.0)</entry>
207 <entry>debian-lenny</entry>
208 <entry>Debian "Lenny" (5.0)</entry>
211 <entry>ubuntu-hardy</entry>
212 <entry>Ubuntu "Hardy Heron" (8.04)</entry>
215 <entry>ubuntu-karmic</entry>
216 <entry>Ubuntu "Karmic Koala" (9.10)</entry>
219 <entry>ubuntu-lucid</entry>
220 <entry>Ubuntu "Lucid Lynx" (10.04)</entry>
223 <entry>fedora13</entry>
224 <entry>Fedora "Goddard" (13)</entry>
227 <entry>centos</entry>
228 <entry>Centos</entry>
235 <entry>gentoo</entry>
236 <entry>Gentoo</entry>
241 <para>This will install a number of packages on the system that are required by OpenSRF,
242 including some Perl modules from CPAN. You can say <literal>No</literal> to the initial
243 CPAN configuration prompt to allow it to automatically configure itself to download and
244 install Perl modules from CPAN. The CPAN installer will ask you a number of times whether
245 it should install prerequisite modules - say <literal>Yes</literal>.</para>
248 <title>Build OpenSRF</title>
249 <para>In this section you will configure, build and install the OpenSRF
250 components that support other Evergreen services.</para>
253 <title>Configure OpenSRF</title>
255 <primary>OpenSRF</primary>
256 <secondary>configure</secondary>
258 <para>As the <systemitem class="username">opensrf</systemitem>
259 user, return to the new OpenSRF build directory and use the
260 <command>configure</command> utility to prepare for the next
261 step of compiling and linking the software. If you wish to
262 include support for Python and Java, add the configuration
263 options <option>--enable-python</option> and
264 <option>--enable-java</option>, respectively:</para>
266 <prompt># as the opensrf user:</prompt>
267 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
268 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>
269 <userinput>make</userinput>
271 <para>This step will take several minutes to complete.</para>
274 <title>Compile, Link and Install OpenSRF</title>
275 <para>As the <systemitem class="username">root</systemitem>
276 user, return to the new OpenSRF build directory and use the
277 <command>make</command> utility to compile, link and install
280 <prompt># as the root user:</prompt>
281 <userinput>cd /home/opensrf/OpenSRF-1.4.0</userinput>
282 <userinput>make install</userinput>
284 <para>This step will take several minutes to complete.</para>
287 <title>Update the System Dynamic Library Path</title>
288 <para>You must update the system dynamic library path to force
289 your system to recognize the newly installed libraries. As the
290 <systemitem class="username">root</systemitem> user, do this by
291 creating the new file
292 <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a
293 new library path, then run the command
294 <command>ldconfig</command> to automatically read the file and
295 modify the system dynamic library path:</para>
297 <prompt># as the root user:</prompt>
298 <userinput>echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf</userinput>
299 <userinput>ldconfig</userinput>
302 <step xml:id="serversideinstallation-definedomains">
303 <title>Define Public and Private OpenSRF Domains</title>
304 <para>For security purposes, OpenSRF uses Jabber domains to separate services
305 into public and private realms. On a single-server system the easiest way to
306 define public and private OpenSRF domains is to define separate host names by
307 adding entries to the file <filename>/etc/hosts</filename>.</para>
308 <para>In the following steps we will use the example domains
309 <systemitem class="domainname">public.localhost</systemitem> for the public
310 domain and <systemitem class="domainname">private.localhost</systemitem>
311 for the private domain. In an upcoming step, you will configure two special
312 <systemitem class="service">ejabberd</systemitem> users
313 to handle communications for these two domains.</para>
314 <para>As the <systemitem class="username">root</systemitem> user, edit the file
315 <filename>/etc/hosts</filename> and add the following example domains:</para>
317 <primary>Jabber</primary>
320 <prompt># as the root user:</prompt>
321 <userinput>127.0.1.2 public.localhost public</userinput>
322 <userinput>127.0.1.3 private.localhost private</userinput>
326 <title>Change File Ownerships</title>
327 <para>Finally, as the <systemitem class="username">root</systemitem>
328 user, change the ownership of all files installed in the
329 directory <filename class="directory">/openils</filename> to the
330 user <systemitem class="username">opensrf</systemitem>:</para>
332 <prompt># as the root user:</prompt>
333 <userinput>chown -R opensrf:opensrf /openils</userinput>
338 <step xml:id="stop-ejabberd-service">
339 <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>
341 <primary>ejabberd</primary>
343 <para>Before continuing with configuration of <systemitem class="service">ejabberd</systemitem>
344 you must stop that service. As the <systemitem class="username">root</systemitem> user,
345 execute the following command to stop the service:</para>
347 <prompt># as the root user:</prompt>
348 <userinput>/etc/init.d/ejabberd stop</userinput>
350 <para>If <systemitem class="service">ejabberd</systemitem> reports that it
351 is already stopped, there may have been a problem when it started back
352 in the installation step. If there are any remaining daemon processes such as
353 <systemitem class="daemon">beam</systemitem> or
354 <systemitem class="daemon">epmd</systemitem>
355 you may need to perform the following commands to kill them:</para>
357 <prompt># as the root user:</prompt>
358 <userinput>epmd -kill</userinput>
359 <userinput>killall beam; killall beam.smp</userinput>
360 <userinput>rm /var/lib/ejabberd/*</userinput>
361 <userinput>echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd</userinput>
365 <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>
366 <para>You must make several configuration changes for the
367 <systemitem class="service">ejabberd</systemitem> service before
369 As the <systemitem class="username">root</systemitem> user, edit the file
370 <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>
373 <para>Change the line:</para>
375 <prompt>{hosts, ["localhost"]}.</prompt>
377 <para>to instead read:</para>
379 <userinput>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</userinput>
383 <para>Change the line:</para>
385 <prompt>{max_user_sessions, 10}</prompt>
387 <para>to instead read:</para>
389 <userinput>{max_user_sessions, 10000}</userinput>
392 <para>If the line looks something like this:</para>
394 <prompt>{access, max_user_sessions, [{10, all}]}</prompt>
396 <para>then change it to instead read:</para>
398 <userinput>{access, max_user_sessions, [{10000, all}]}</userinput>
402 <para>Change all three occurrences of:</para>
404 <prompt>max_stanza_size</prompt>
406 <para>to instead read:</para>
408 <userinput>2000000</userinput>
412 <para>Change both occurrences of:</para>
414 <prompt>maxrate</prompt>
416 <para>to instead read:</para>
418 <userinput>500000</userinput>
422 <para>Comment out the line:</para>
424 <prompt>{mod_offline, []}</prompt>
426 <para>by placing two <literal>%</literal> comment signs in front
427 so it instead reads:</para>
429 <userinput>%%{mod_offline, []}</userinput>
434 <step xml:id="serversideinstallation-opensrf-continued">
435 <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>
436 <para>As the <systemitem class="username">root</systemitem> user, restart the
437 <systemitem class="service">ejabberd</systemitem> service to test the
438 configuration changes and to register your users:</para>
440 <prompt># as the root user:</prompt>
441 <userinput>/etc/init.d/ejabberd start</userinput>
445 <title>Register <systemitem class="username">router</systemitem> and
446 <systemitem class="username">opensrf</systemitem> as
447 <systemitem class="service">ejabberd</systemitem> users</title>
448 <para>The two <systemitem class="service">ejabberd</systemitem> users
449 <systemitem class="username">router</systemitem> and
450 <systemitem class="username">opensrf</systemitem> must be registered
451 and configured to manage OpenSRF router service and communications
452 for the two domains <literal>public.localhost</literal> and
453 <literal>private.localhost</literal> that you added to the file
454 <filename>/etc/hosts</filename> in a previous step
455 (see <xref linkend="serversideinstallation-definedomains"/>).
456 The users include:</para>
459 <para>the <systemitem class="username">router</systemitem> user,
460 to whom all requests to connect to an OpenSRF service will be
464 <para>the <systemitem class="username">opensrf</systemitem> user,
465 which clients use to connect to OpenSRF services (you may name
466 the user anything you like, but we use
467 <literal>opensrf</literal> in these examples)</para>
470 <para>As the <systemitem class="username">root</systemitem> user, execute the
471 <command>ejabberdctl</command> utility as shown below to register and create passwords
472 for the users <systemitem class="username">router</systemitem> and
473 <systemitem class="username">opensrf</systemitem> on each domain:</para>
475 <prompt># as the root user:</prompt>
476 <prompt># Note: the syntax for registering a user with ejabberdctl is:</prompt>
477 <prompt># ejabberdctl register USER DOMAIN PASSWORD</prompt>
478 <userinput>ejabberdctl register router private.localhost NEWPASSWORD</userinput>
479 <userinput>ejabberdctl register router public.localhost NEWPASSWORD</userinput>
480 <userinput>ejabberdctl register opensrf private.localhost NEWPASSWORD</userinput>
481 <userinput>ejabberdctl register opensrf public.localhost NEWPASSWORD</userinput>
483 <para>Note that the users <systemitem class="username">router</systemitem> and
484 <systemitem class="username">opensrf</systemitem> and their respective passwords
485 will be used again in <xref linkend="serversideinstallation-passwords"/> when
486 we modify the OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename> .</para>
488 <step xml:id="serversideinstallation-opensrf-createconfig">
489 <title>Create OpenSRF configuration files</title>
490 <para>As the <systemitem class="username">opensrf</systemitem> user,
491 execute the following commands to create the new configuration files
492 <filename>/openils/conf/opensrf_core.xml</filename> and
493 <filename>/openils/conf/opensrf.xml</filename> from the example templates:</para>
495 <prompt># as the opensrf user:</prompt>
496 <userinput>cd /openils/conf</userinput>
497 <userinput>cp opensrf.xml.example opensrf.xml</userinput>
498 <userinput>cp opensrf_core.xml.example opensrf_core.xml</userinput>
501 <step xml:id="serversideinstallation-passwords">
502 <title>Update usernames and passwords in the OpenSRF configuration file</title>
503 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
504 OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>
505 and update the usernames and passwords to match the values shown in the
506 following table. The left-hand side of <xref linkend="serversideinstallation-xpath-table-1"/>
507 shows common XPath syntax to indicate the approximate position within the XML
508 file that needs changes. The right-hand side of the table shows the replacement
510 <table xml:id="serversideinstallation-xpath-table-1">
511 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>
512 <tgroup align="left" cols="2" colsep="1" rowsep="1">
513 <colspec colname="Xpath" colnum="1" colwidth="1.6*"/>
514 <colspec colname="Value" colnum="2" colwidth="2.0*"/>
517 <entry>XPath location</entry>
523 <entry>/config/opensrf/username</entry>
525 <systemitem class="username">opensrf</systemitem>
529 <entry>/config/opensrf/passwd </entry>
530 <entry><systemitem class="domainname">private.localhost</systemitem>
532 <systemitem class="username">opensrf</systemitem> user
536 <entry>/config/gateway/username</entry>
538 <systemitem class="username">opensrf</systemitem>
542 <entry>/config/gateway/passwd</entry>
543 <entry><systemitem class="domainname">public.localhost</systemitem>
545 <systemitem class="username">opensrf</systemitem> user
549 <entry>/config/routers/router/transport/username,
550 first entry where server == public.localhost</entry>
552 <systemitem class="username">router</systemitem>
556 <entry>/config/routers/router/transport/password,
557 first entry where server == public.localhost</entry>
558 <entry><systemitem class="domainname">public.localhost</systemitem>
560 <systemitem class="username">router</systemitem> user
564 <entry>/config/routers/router/transport/username,
565 second entry where server == private.localhost</entry>
567 <systemitem class="username">router</systemitem>
571 <entry>/config/routers/router/transport/password,
572 second entry where server == private.localhost</entry>
573 <entry><systemitem class="domainname">private.localhost</systemitem>
575 <systemitem class="username">router</systemitem> user
581 <para>You may also need to modify the file to specify the domains from which
582 <systemitem class="service">OpenSRF</systemitem> will accept connections,
583 and to which it will make connections.
584 If you are installing <application>OpenSRF</application> on a single server
585 and using the <systemitem class="domainname">private.localhost</systemitem> and
586 <systemitem class="domainname">public.localhost</systemitem> domains,
587 these will already be set to the correct values. Otherwise, search and replace
588 to match values for your own systems.</para>
591 <title>Set location of the persistent database</title>
592 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
593 file <filename>/openils/conf/opensrf.xml</filename>, then find and modify the
594 element <literal>dbfile</literal> (near the end of the file) to set the
595 location of the persistent database. Change the default line:</para>
597 <prompt>/openils/var/persist.db</prompt>
599 <para>to instead read:</para>
601 <userinput>/tmp/persist.db</userinput>
603 <para>Following is a sample modification of that portion of the file:</para>
604 <programlisting language="xml"><![CDATA[
605 <!-- Example of an app-specific setting override -->
608 <dbfile>/tmp/persist.db</dbfile>
613 <step xml:id="serversideinstallation-srfsh">
614 <title>Create configuration files for users needing <command>srfsh</command></title>
615 <para>In this section you will set up a special configuration file for each user
616 who will need to run the <command>srfsh</command> (pronounced <emphasis>surf
617 shell</emphasis>) utility.</para>
619 <primary>srfsh</primary>
621 <para>The software installation will automatically create the utility
622 <command>srfsh</command> (surf shell), a command line diagnostic tool for
623 testing and interacting with <application>OpenSRF</application>. It will be used
624 in a future step to complete and test the Evergreen installation. See
625 <xref linkend="serversideinstallation-testing"/> for further information.</para>
626 <para>As the <systemitem class="username">root</systemitem> user, copy the
627 sample configuration file <filename>/openils/conf/srfsh.xml.example</filename>
628 to the home directory of each user who will use <command>srfsh</command>.
629 For instance, do the following for the
630 <systemitem class="username">opensrf</systemitem> user:</para>
632 <prompt># as the root user:</prompt>
633 <userinput>cp /openils/conf/srfsh.xml.example /home/opensrf/.srfsh.xml</userinput>
635 <para>Edit each user's file <filename>~/.srfsh.xml</filename> and make the
636 following changes:</para>
639 <para>Modify <literal>domain</literal> to be the router hostname
640 (following our domain examples,
641 <systemitem class="domainname">private.localhost</systemitem> will give
642 <command>srfsh</command> access to all OpenSRF services, while
643 <systemitem class="domainname">public.localhost</systemitem>
644 will only allow access to those OpenSRF services that are
645 publicly exposed).</para>
648 <para>Modify <literal>username</literal> and
649 <literal>password</literal> to match the
650 <literal>opensrf</literal> Jabber user for the chosen
654 <para>Modify <literal>logfile</literal> to be the full path for
655 a log file to which the user has write access</para>
658 <para>Modify <literal>loglevel</literal> as needed for testing</para>
661 <para>Change the owner of the file to match the owner of the home directory</para>
664 <para>Following is a sample of the file:</para>
665 <programlisting language="xml"><![CDATA[
666 <?xml version="1.0"?>
667 <!-- This file follows the standard bootstrap config file layout -->
668 <!-- found in opensrf_core.xml -->
670 <router_name>router</router_name>
671 <domain>private.localhost</domain>
672 <username>opensrf</username>
673 <passwd>SOMEPASSWORD</passwd>
675 <logfile>/tmp/srfsh.log</logfile>
676 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
677 <loglevel>4</loglevel>
682 <title>Modify the environmental variable <envar>PATH</envar> for the
683 <systemitem class="username">opensrf</systemitem> user</title>
684 <para>As the <systemitem class="username">opensrf</systemitem> user, modify the
685 environmental variable <envar>PATH</envar> by adding a new file path to the
686 <systemitem class="username">opensrf</systemitem> user's shell configuration
687 file <filename>~/.bashrc</filename>:</para>
689 <prompt># as the opensrf user:</prompt>
690 <userinput>echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc</userinput>
694 <title>Start OpenSRF</title>
695 <para>As the <systemitem class="username">root</systemitem> user, start the
696 <systemitem class="service">ejabberd</systemitem> and
697 <systemitem class="service">memcached</systemitem> services:</para>
699 <prompt># as the root user:</prompt>
700 <userinput>/etc/init.d/ejabberd start</userinput>
701 <userinput>/etc/init.d/memcached start</userinput>
703 <para>As the <systemitem class="username">opensrf</systemitem> user,
704 start OpenSRF as follows:</para>
706 <prompt># as the opensrf user:</prompt>
707 <userinput>osrf_ctl.sh -l -a start_all</userinput>
709 <para>The flag <option>-l</option> forces Evergreen to use
710 <systemitem class="domainname">localhost</systemitem> (your current system)
711 as the hostname. The flag <option>-a start_all</option> starts the other
712 OpenSRF <systemitem class="service">router</systemitem> ,
713 <systemitem class="service">Perl</systemitem> , and
714 <systemitem class="service">C</systemitem> services.</para>
717 <para>You can also start Evergreen without the
718 <option>-l</option> flag, but the <command>osrf_ctl.sh</command>
719 utility must know the fully qualified domain name for the system
720 on which it will execute. That hostname was probably specified
721 in the configuration file <filename>opensrf.xml</filename> which
722 you configured in a previous step.</para>
725 <para>If you receive an error message similar to
726 <emphasis>osrf_ctl.sh: command not found</emphasis>, then your
727 environment variable <envar>PATH</envar> does not include the
728 directory <filename class="directory">/openils/bin</filename>.
729 As the <systemitem class="username">opensrf</systemitem> user,
730 edit the configuration file <filename>~/.bashrc</filename> and
731 add the following line:
732 <literal>export PATH=$PATH:/openils/bin</literal></para>
737 <title>Test connections to OpenSRF</title>
738 <para>Once you have installed and started OpenSRF, as the
739 <systemitem class="username">root</systemitem> user, test your connection to
740 <systemitem class="service">OpenSRF</systemitem> using the <command>srfsh</command>
741 utility and trying to call the <command>add</command> method on the OpenSRF
742 <systemitem class="service">math</systemitem> service:</para>
744 <prompt># as the root user:</prompt>
745 <userinput>/openils/bin/srfsh</userinput>
746 <computeroutput>srfsh# <userinput>request opensrf.math add 2 2</userinput></computeroutput>
747 <computeroutput>Received Data: 4</computeroutput>
748 <computeroutput>------------------------------------</computeroutput>
749 <computeroutput>Request Completed Successfully</computeroutput>
750 <computeroutput>Request Time in seconds: 0.007519</computeroutput>
751 <computeroutput>------------------------------------</computeroutput>
753 <para>For other <command>srfsh</command> commands, type in
754 <userinput>help</userinput> at the prompt.</para>
757 <title>Stop OpenSRF</title>
758 <para>After OpenSRF has started, you can stop it at any time by using the
759 <command>osrf_ctl.sh</command> again. As the
760 <systemitem class="username">opensrf</systemitem>
761 user, stop OpenSRF as follows:</para>
763 <prompt># as the opensrf user:</prompt>
764 <userinput>osrf_ctl.sh -l -a stop_all</userinput>
769 <section xml:id="serversideinstallation-ubuntudebian">
770 <title>Installing Evergreen 1.6.1.x On <systemitem class="osname">Ubuntu</systemitem> or
771 <systemitem class="osname">Debian</systemitem></title>
773 <primary>Linux</primary>
774 <secondary>Debian</secondary>
777 <primary>Linux</primary>
778 <secondary>Ubuntu</secondary>
780 <para>This section outlines the installation process for the latest stable version of
782 <para>In this section you will download, unpack, install, configure and test the Evergreen
783 system, including the Evergreen server and the PostgreSQL database system. You will make several
784 configuration changes and adjustments to the software, including updates to configure the system
785 for your own locale, and some updates needed to work around a few known issues.</para>
787 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit)
788 architectures. There may be differences between the Desktop and Server editions of
789 <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server
791 <para>In the following instructions, you are asked to perform certain steps as
792 either the <systemitem class="username">root</systemitem> user, the
793 <systemitem class="username">opensrf</systemitem> user, or the
794 <systemitem class="username">postgres</systemitem> user.</para>
797 <para><systemitem class="osname">Debian</systemitem> -- To become the
798 <systemitem class="username">root</systemitem> user, issue the command
799 <command>su -</command> and enter the password of the
800 <systemitem class="username">root</systemitem> user.</para>
803 <para><systemitem class="osname">Ubuntu</systemitem> -- To become the
804 <systemitem class="username">root</systemitem> user, issue the command
805 <command>sudo su -</command> and enter the password of the
806 <systemitem class="username">root</systemitem> user.</para>
809 <para>To switch from the <systemitem class="username">root</systemitem> user to a
810 different user, issue the command <command>su - USERNAME</command>. For example, to
811 switch from the <systemitem class="username">root</systemitem> user to the
812 <systemitem class="username">opensrf</systemitem> user, issue the command
813 <command>su - opensrf</command>. Once you have become a non-root user, to become the
814 <systemitem class="username">root</systemitem> user again, simply issue the command
815 <command>exit</command>.</para>
819 <title>Install OpenSRF</title>
820 <para>Evergreen software is integrated with and depends on the Open Service
821 Request Framework (OpenSRF) software system. For further information on
822 installing, configuring and testing OpenSRF, see
823 <xref linkend="serversideinstallation-opensrf"/>.</para>
824 <para>Follow the steps outlined in that section and run the specified tests to
825 ensure that OpenSRF is properly installed and configured. Do
826 <emphasis><emphasis role="bold">not</emphasis></emphasis> continue with
827 any further Evergreen installation steps until you have verified that OpenSRF
828 has been successfully installed and tested.</para>
831 <title>Download and Unpack Latest Evergreen Version</title>
832 <para>The latest version of Evergreen can be found here:
833 <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz"></ulink> .
834 As the <systemitem class="username">opensrf</systemitem> user, change to
835 the directory <filename class="directory">/home/opensrf</filename> then download
836 and extract Evergreen. The new subdirectory
837 <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.1.2</filename> will be created:</para>
839 <prompt># as the opensrf user:</prompt>
840 <userinput>cd /home/opensrf</userinput>
841 <userinput>wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz</userinput>
842 <userinput>tar zxf Evergreen-ILS-1.6.1.2.tar.gz</userinput>
845 <step xml:id="serversideinstallation-installprereq">
846 <title>Install Prerequisites to Build Evergreen</title>
847 <para>In this section you will install and configure a set of prerequisites that will be
848 used later in <xref linkend="serversideinstallation-configure"/> and
849 <xref linkend="serversideinstallation-compile"/> to build the Evergreen software
850 using the <command>make</command> utility.</para>
851 <para>As the <systemitem class="username">root</systemitem> user, enter the commands show
852 below to build the prerequisites from the software distribution that you just downloaded
853 and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the following
854 example with the keyword corresponding to the name of one of the
855 <systemitem class="osname">Linux</systemitem> distributions listed in the following
856 distribution keywords table <xref linkend="serversideinstallation-keywords-evergreen"/> .
857 For example, to install the prerequisites for Ubuntu version 9.10 (Karmic Koala) you would
858 enter this command: <command>make -f Open-ILS/src/extras/Makefile.install
859 ubuntu-karmic</command>.</para>
861 <prompt># as the root user:</prompt>
862 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
863 <userinput>make -f Open-ILS/src/extras/Makefile.install [DISTRIBUTION]</userinput>
865 <table xml:id="serversideinstallation-keywords-evergreen">
866 <title>Keyword Targets for Evergreen <application>"make"</application> Command</title>
867 <tgroup align="left" cols="2" colsep="1" rowsep="1">
868 <colspec colnum="1" colwidth="1.0*"/>
869 <colspec colnum="2" colwidth="3.0*"/>
872 <entry>Keyword</entry>
873 <entry>Linux Version</entry>
878 <entry>debian-etch</entry>
879 <entry>Debian "Etch" (4.0)</entry>
882 <entry>debian-lenny</entry>
883 <entry>Debian "Lenny" (5.0)</entry>
886 <entry>ubuntu-hardy</entry>
887 <entry>Ubuntu "Hardy Heron" (8.04)</entry>
890 <entry>ubuntu-intrepid</entry>
891 <entry>Ubuntu "Intrepid Ibex" (8.10)</entry>
894 <entry>ubuntu-karmic</entry>
895 <entry>Ubuntu "Karmic Koala" (9.10)</entry>
898 <entry>ubuntu-karmic</entry>
899 <entry>Ubuntu "Lucid Lynx" (10.04)</entry>
902 <entry>centos</entry>
903 <entry>Centos</entry>
910 <entry>gentoo</entry>
911 <entry>Gentoo</entry>
917 <step performance="optional" xml:id="serversideinstallation-postgresql-default">
918 <title>(OPTIONAL) Install the PostgreSQL Server</title>
920 <primary>databases</primary>
921 <secondary>PostgreSQL</secondary>
923 <para>Since the PostgreSQL server is usually a standalone server in multi-server
924 production systems, the prerequisite installer Makefile in the previous section
925 (see <xref linkend="serversideinstallation-installprereq"/>)
926 does not automatically install PostgreSQL. You must install the PostgreSQL server
927 yourself, either on the same system as Evergreen itself or on another system.
928 If your PostgreSQL server is on a different system, just skip this step.
929 If your PostgreSQL server will be on the same system as your Evergreen
930 software, then install the required PostgreSQL server packages as follows.
931 For further information on manually installing PostgreSQL, visit the official
932 <link xl:href="http://www.postgresql.org/">PostgreSQL Site</link>.</para>
933 <para>For <systemitem class="osname">Debian Lenny</systemitem> and
934 <systemitem class="osname">Ubuntu Hardy (8.04)</systemitem>, execute these commands:</para>
936 <prompt># as the root user:</prompt>
937 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
938 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83</userinput>
940 <para>For <systemitem class="osname">Ubuntu Karmic (9.10)</systemitem> and
941 <systemitem class="osname">Ubuntu Lucid (10.04)</systemitem>, execute these commands:</para>
943 <prompt># as the root user:</prompt>
944 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
945 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84</userinput>
948 <para>PostgreSQL versions 8.3 or 8.4 are the recommended versions to work
949 with Evergreen 1.6.1.2 . If you have an older version of PostgreSQL, you
950 should upgrade before installing Evergreen. To find the running version of
951 PostgreSQL, as the <systemitem class="username">postgres</systemitem>
952 user execute the command <command>psql</command>, then type
953 <userinput>SELECT version();</userinput> to get detailed information
954 about your version of PostgreSQL.</para>
957 <step performance="optional">
958 <title>Install Perl Modules on PostgreSQL Server</title>
959 <para>If PostgreSQL is running on the same system as your Evergreen software,
960 then the Perl modules will automatically be available. Just skip this step.
961 Otherwise, continue if your PostgreSQL server is running on another system.</para>
962 <para>You will need to install several Perl modules on the other system. As the
963 <systemitem class="username">root</systemitem> user install the following Perl
966 <prompt># as the root user:</prompt>
967 <prompt># first, ensure the gcc compiler is installed:</prompt>
968 <userinput>apt-get install gcc</userinput>
969 <prompt># then install the Perl modules:</prompt>
970 <userinput>perl -MCPAN -e shell</userinput>
971 <computeroutput>cpan></computeroutput>
972 <userinput>install JSON::XS</userinput>
973 <computeroutput>cpan></computeroutput>
974 <userinput>install MARC::Record</userinput>
975 <computeroutput>cpan></computeroutput>
976 <userinput>install MARC::File::XML</userinput>
978 <para>For more information on installing Perl Modules vist the official
979 <link xl:href="http://www.cpan.org/">CPAN</link> site.</para>
981 <primary>Perl</primary>
982 <secondary>CPAN</secondary>
986 <title>Update the System Dynamic Library Path</title>
987 <para>You must update the system dynamic library path to force your system to recognize
988 the newly installed libraries. As the <systemitem class="username">root</systemitem> user,
989 do this by creating the new file <filename>/etc/ld.so.conf.d/osrf.conf</filename>
990 containing a new library path, then run the command <command>ldconfig</command> to
991 automatically read the file and modify the system dynamic library path:</para>
993 <prompt># as the root user:</prompt>
994 <userinput>echo "/usr/local/lib" >> /etc/ld.so.conf.d/osrf.conf</userinput>
995 <userinput>echo "/usr/local/lib/dbd" >> /etc/ld.so.conf.d/osrf.conf</userinput>
996 <userinput>ldconfig</userinput>
999 <step performance="optional">
1000 <title>Restart the PostgreSQL Server</title>
1001 <para>If PostgreSQL is running on the same system as the rest of Evergreen, as
1002 the <systemitem class="username">root</systemitem> user you must restart
1003 PostgreSQL to re-read the new library paths just configured. If PostgreSQL is
1004 running on another system, you may skip this step.
1005 As the <systemitem class="username">opensrf</systemitem> user,
1006 execute the following command, where
1007 <literal>[PGSQL_VERSION]</literal> is your installed PostgreSQL version
1008 (e.g. <literal>8.3</literal>):</para>
1010 <prompt># as the opensrf user:</prompt>
1011 <userinput>/etc/init.d/postgresql-[PGSQL_VERSION] restart</userinput>
1014 <step xml:id="serversideinstallation-configure">
1015 <title>Configure Evergreen</title>
1016 <para>In this step you will use the <command>configure</command> and
1017 <command>make</command> utilities to configure Evergreen so it can be compiled
1018 and linked later in <xref linkend="serversideinstallation-compile"/>.</para>
1019 <para>As the <systemitem class="username">opensrf</systemitem> user, return to
1020 the Evergreen build directory and execute these commands:</para>
1022 <prompt># as the opensrf user:</prompt>
1023 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
1024 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>
1025 <userinput>make</userinput>
1028 <step xml:id="serversideinstallation-compile">
1029 <title>Compile, Link and Install Evergreen</title>
1030 <para>In this step you will actually compile, link and install Evergreen and the
1031 default Evergreen Staff Client.</para>
1032 <para>As the <systemitem class="username">root</systemitem> user, return to the
1033 Evergreen build directory and use the <command>make</command> utility as shown below:</para>
1035 <prompt># as the root user:</prompt>
1036 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
1037 <userinput>make STAFF_CLIENT_BUILD_ID=rel_1_6_1_2 install</userinput>
1039 <para>The Staff Client will also be automatically built, but you must remember
1040 to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the
1041 Staff Client you will use to connect to the Evergreen server.</para>
1042 <para>The above commands will create a new subdirectory
1043 <filename class="directory">/openils/var/web/xul/rel_1_6_1_2</filename>
1044 containing the Staff Client.</para>
1045 <para>To complete the Staff Client installation, as the
1046 <systemitem class="username">root</systemitem> user execute the following commands to
1047 create a symbolic link named <emphasis>server</emphasis> in the head of the Staff Client
1048 directory <filename class="directory">/openils/var/web/xul</filename> that points to the
1049 subdirectory <filename class="directory">/server</filename> of the new Staff Client
1052 <prompt># as the root user:</prompt>
1053 <userinput>cd /openils/var/web/xul</userinput>
1054 <userinput>ln -sf rel_1_6_1_2/server server</userinput>
1058 <title>Copy the OpenSRF Configuration Files</title>
1059 <para>In this step you will replace some OpenSRF configuration files that you set up in
1060 <xref linkend="serversideinstallation-opensrf-createconfig"/> when you installed and
1061 tested OpenSRF.</para>
1062 <para>You must copy several example OpenSRF configuration files into place after first
1063 creating backup copies for troubleshooting purposes, then change all the file ownerships
1064 to <systemitem class="username">opensrf</systemitem>.
1065 As the <systemitem class="username">root</systemitem> user, execute the following
1068 <prompt># as the root user:</prompt>
1069 <userinput>cd /openils/conf</userinput>
1070 <userinput>cp opensrf.xml opensrf.xml.BAK</userinput>
1071 <userinput>cp opensrf_core.xml opensrf_core.xml.BAK</userinput>
1072 <userinput>cp opensrf.xml.example opensrf.xml</userinput>
1073 <userinput>cp opensrf_core.xml.example opensrf_core.xml</userinput>
1074 <userinput>cp oils_web.xml.example oils_web.xml</userinput>
1075 <userinput>chown -R opensrf:opensrf /openils/</userinput>
1079 <title>Create and Configure PostgreSQL Database</title>
1081 <primary>databases</primary>
1082 <secondary>PostgreSQL</secondary>
1084 <para>In this step you will create the Evergreen database. In the commands
1085 below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis>
1086 repository to match your PostgreSQL server
1087 layout. For example, if you built PostgreSQL from source the path would be
1088 <filename class="directory">/usr/local/share/contrib</filename>; if you
1089 installed the PostgreSQL 8.3 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>,
1091 <systemitem class="directory">/usr/share/postgresql/8.3/contrib/</systemitem>.</para>
1095 <emphasis role="bold">Create and configure the database</emphasis>
1097 <para>As the <systemitem class="username">postgres</systemitem>
1098 user on the PostgreSQL system create the PostgreSQL database,
1099 then set some internal paths:</para>
1101 <prompt># as the postgres user:</prompt>
1102 <userinput>createdb evergreen -E UTF8 -T template0</userinput>
1103 <userinput>createlang plperl evergreen</userinput>
1104 <userinput>createlang plperlu evergreen</userinput>
1105 <userinput>createlang plpgsql evergreen</userinput>
1107 <para>Continue as the <systemitem class="username">postgres</systemitem> user
1108 and execute the SQL scripts as shown below, adjusting the paths as needed, where
1109 <literal>[PGSQL_VERSION]</literal> is your installed PostgreSQL
1110 version (e.g. <literal>8.3</literal>).</para>
1112 <prompt># as the postgres user:</prompt>
1113 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/tablefunc.sql evergreen</userinput>
1114 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/tsearch2.sql evergreen</userinput>
1115 <userinput>psql -f /usr/share/postgresql/[PGSQL_VERSION]/contrib/pgxml.sql evergreen</userinput>
1118 <step xml:id="serversideinstallation-postgresqlcreateuser">
1119 <title>Create <systemitem class="username">evergreen</systemitem> PostgreSQL user</title>
1120 <para>As the <systemitem class="username">postgres</systemitem>
1121 user on the PostgreSQL system, create a new PostgreSQL user
1122 named <systemitem class="username">evergreen</systemitem> and
1123 assign a password:</para>
1125 <prompt># as the postgres user:</prompt>
1126 <userinput>createuser -P -s evergreen</userinput>
1127 <computeroutput>Enter password for new role: <userinput>MYNEWPASSWORD</userinput></computeroutput>
1128 <computeroutput>Enter it again: <userinput>MYNEWPASSWORD</userinput></computeroutput>
1132 <title>Create database schema</title>
1133 <para>In this step you will create the database schema and configure your
1134 system with the corresponding database authentication details for the
1135 <emphasis>evergreen</emphasis> database user that you just created in
1136 <xref linkend="serversideinstallation-postgresqlcreateuser"/>.</para>
1137 <para>As the <systemitem class="username">root</systemitem> user, enter
1138 the following commands and replace <emphasis>HOSTNAME, PORT,
1139 PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate
1142 <prompt># as the root user:</prompt>
1143 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
1144 <userinput>perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \</userinput>
1145 <userinput> --service all --create-schema --create-bootstrap --create-offline \</userinput>
1146 <userinput> --hostname HOSTNAME --port PORT \</userinput>
1147 <userinput> --user evergreen --password PASSWORD --database DATABASENAME</userinput>
1149 <para>On most systems, <emphasis>HOSTNAME</emphasis> will be
1150 <emphasis role="bold">localhost</emphasis> and
1151 <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>.
1152 Of course, values for <emphasis>PASSWORD</emphasis> and
1153 <emphasis>DATABASENAME</emphasis> must match the values you used in
1154 <xref linkend="serversideinstallation-postgresqlcreateuser"/>.</para>
1155 <para>As the command executes, you may see warnings similar to:
1156 <literal>ERROR: schema SOMENAME does not exist</literal> (in fact,
1157 you may see one warning per schema) but they can be safely ignored.</para>
1159 <para>If you are entering the above command on a single line, do
1160 not include the <literal>\</literal> (backslash) characters. If
1161 you are using the <command>bash</command> shell, these should only
1162 be used at the end of a line at a <command>bash</command> prompt
1163 to indicate that the command is continued on the next line.</para>
1169 <title>Configure the Apache web server</title>
1171 <primary>web server</primary>
1172 <secondary>Apache</secondary>
1174 <para>In this step you will configure the Apache web server to support Evergreen
1176 <para>First, you must enable some built-in Apache modules and install some
1177 additional Apache configuration files. Then you will create a new Security
1178 Certificate. Finally, you must make several changes to the Apache configuration
1182 <title>Enable the required Apache Modules</title>
1183 <para>As the <systemitem class="username">root</systemitem>
1184 user, enable some modules in the Apache server, then copy the
1185 new configuration files to the Apache server directories:</para>
1187 <primary>Apache modules</primary>
1190 <prompt># as the root user:</prompt>
1191 <userinput>a2enmod ssl # enable mod_ssl</userinput>
1192 <userinput>a2enmod rewrite # enable mod_rewrite</userinput>
1193 <userinput>a2enmod expires # enable mod_expires</userinput>
1195 <para>As the commands execute, you may see warnings similar to:
1196 <literal>Module SOMEMODULE already enabled</literal> but you can
1197 safely ignore them.</para>
1200 <title>Copy Apache configuration files</title>
1201 <para>You must copy the Apache configuration files from the
1202 Evergreen installation directory to the Apache directory. As the
1203 <systemitem class="username">root</systemitem> user, perform the
1204 following commands:</para>
1206 <prompt># as the root user:</prompt>
1207 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput>
1208 <userinput>cp Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/</userinput>
1209 <userinput>cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/</userinput>
1210 <userinput>cp Open-ILS/examples/apache/startup.pl /etc/apache2/</userinput>
1213 <step xml:id="serversideinstallation-createsslcertificate">
1214 <title>Create a Security Certificate</title>
1215 <para>In this step you will create a new Security Certificate (SSL Key)
1216 for the Apache server using the <command>openssl</command> command. For a
1217 public production server you must configure or purchase a signed SSL
1218 certificate, but for now you can just use a self-signed certificate and
1219 accept the warnings in the Staff Client and browser during testing and
1220 development. As the <systemitem class="username">root</systemitem> user,
1221 perform the following commands:</para>
1223 <prompt># as the root user:</prompt>
1224 <userinput>mkdir /etc/apache2/ssl</userinput>
1225 <userinput>cd /etc/apache2/ssl</userinput>
1226 <userinput>openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key</userinput>
1228 <para>You will be prompted for several items of information; enter
1229 the appropriate information for each item. The new files
1230 <filename>server.crt</filename> and <filename>server.key</filename> will
1231 be created in the directory
1232 <filename class="directory">/etc/apache2/ssl</filename> .</para>
1234 <para>This step generates a self-signed SSL
1235 certificate. You must install a proper SSL certificate
1236 for a public production system to avoid warning messages
1237 when users login to their account through the OPAC or
1238 when staff login through the Staff Client.</para>
1239 <para>For further information on installing a proper SSL
1240 certificate, see <xref linkend="serversideinstallation-ssl"/>.</para>
1243 <step xml:id="serversideinstallation-modify-apache">
1244 <title>Update Apache configuration file</title>
1245 <para>You must make several changes to the new Apache
1247 <filename>/etc/apache2/sites-available/eg.conf</filename> .
1248 As the <systemitem class="username">root</systemitem> user,
1249 edit the file and make the following changes:</para>
1252 <para>In the section
1253 <literal><Directory "/openils/var/cgi-bin"></literal>
1255 <literal>Allow from 10.0.0.0/8</literal>
1256 with this line: <literal>Allow from all</literal>.</para>
1257 <warning>This change allows access to your configuration
1258 CGI scripts from any workstation on any network. This is
1259 only a temporary change to expedite testing and should be
1260 removed after you have finished and successfully tested
1261 the Evergreen installation. See
1262 <xref linkend="serversideinstallation-postinstallation"/>
1263 for further details on removing this change after the
1264 Evergreen installation is complete.
1268 <para>Comment out the line <literal>Listen 443</literal>,
1269 since it conflicts with the same declaration in the
1271 <filename>/etc/apache2/ports.conf</filename>. Note that
1272 <systemitem class="osname">Debian </systemitem> users
1273 should not do this since the conflict does not apply to
1274 that operating system.</para>
1277 <para>The following updates are needed to allow the logs
1278 to function properly, but it may break other Apache
1279 applications on your server:</para>
1281 <systemitem class="osname">Linux</systemitem> distributions
1282 <systemitem class="osname">Ubuntu Hardy</systemitem> or
1283 <systemitem class="osname">Debian Etch</systemitem>, as
1284 the <systemitem class="username">root</systemitem> user,
1285 edit the Apache configuration file
1286 <filename>/etc/apache2/apache2.conf</filename> and change
1287 the line <literal>User www-data</literal> to <literal>User
1288 opensrf</literal>.</para>
1290 <systemitem class="osname">Linux</systemitem> distributions
1291 <systemitem class="osname">Ubuntu Karmic</systemitem>,
1292 <systemitem class="osname">Ubuntu Lucid</systemitem> or
1293 <systemitem class="osname">Debian Lenny</systemitem>, as
1294 the <systemitem class="username">root</systemitem> user,
1295 edit the Apache configuration file and change these
1298 <prompt># as the root user:</prompt>
1299 <userinput>export APACHE_RUN_USER=www-data</userinput>
1300 <userinput>export APACHE_RUN_GROUP=www-data</userinput>
1302 <para>to instead read:</para>
1304 <prompt># as the root user:</prompt>
1305 <userinput>export APACHE_RUN_USER=opensrf</userinput>
1306 <userinput>export APACHE_RUN_GROUP=opensrf</userinput>
1311 <systemitem class="username">root</systemitem> user,
1312 edit the Apache configuration file
1313 <filename>/etc/apache2/apache2.conf</filename> and
1314 modify the values for <literal>KeepAliveTimeout</literal>
1315 and <literal>MaxKeepAliveRequests</literal> to match
1316 the following:</para>
1318 <prompt># as the root user:</prompt>
1319 <userinput>KeepAliveTimeout 1</userinput>
1320 <userinput>MaxKeepAliveRequests 100</userinput>
1324 <para>Further configuration changes to Apache may be
1325 necessary for busy systems. These changes increase the
1326 number of Apache server processes that are started to
1327 support additional browser connections.</para>
1329 <systemitem class="username">root</systemitem> user,
1330 edit the Apache configuration file
1331 <filename>/etc/apache2/apache2.conf</filename>, locate
1332 and modify the section related to <emphasis>prefork
1333 configuration</emphasis> to suit the load on your
1335 <programlisting language="xml"><![CDATA[
1336 <IfModule mpm_prefork_module>
1341 MaxRequestsPerChild 10000
1343 ]]></programlisting>
1348 <title>Enable the Evergreen web site</title>
1349 <para>Finally, you must enable the Evergreen web site. As the
1350 <systemitem class="username">root</systemitem> user, execute the
1351 following Apache configuration commands to disable the default
1352 <emphasis>It Works</emphasis> web page and enable the Evergreen
1353 web site, and then restart the Apache server:</para>
1355 <prompt># as the root user:</prompt>
1356 <prompt># disable/enable web sites</prompt>
1357 <userinput>a2dissite default</userinput>
1358 <userinput>a2ensite eg.conf</userinput>
1359 <prompt># restart the server</prompt>
1360 <userinput>/etc/init.d/apache2 reload</userinput>
1365 <step xml:id="serversideinstallation-opensrf-config">
1366 <title>Update the OpenSRF Configuration File</title>
1367 <para>As the <systemitem class="username">opensrf</systemitem> user, edit the
1368 OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename>
1369 to update the Jabber usernames and passwords, and to specify the domain from
1370 which we will accept and to which we will make connections.</para>
1371 <para>If you are installing Evergreen on a single server and using the
1372 <systemitem class="domainname">private.localhost</systemitem> /
1373 <systemitem class="domainname">public.localhost</systemitem> domains,
1374 these will already be set to the correct values. Otherwise, search and replace
1375 to match your customized values.</para>
1376 <para>The left-hand side of <xref linkend="serversideinstallation-xpath-table-2"/>
1377 shows common XPath syntax to indicate the approximate position within the XML
1378 file that needs changes. The right-hand side of the table shows the replacement
1380 <table xml:id="serversideinstallation-xpath-table-2">
1381 <title>Sample XPath syntax for editing "opensrf_core.xml"</title>
1382 <tgroup align="left" cols="2" colsep="1" rowsep="1">
1383 <colspec colname="Xpath" colnum="1" colwidth="1.6*"/>
1384 <colspec colname="Value" colnum="2" colwidth="2.0*"/>
1387 <entry>XPath location</entry>
1388 <entry>Value</entry>
1393 <entry>/config/opensrf/username</entry>
1395 <systemitem class="username">opensrf</systemitem>
1399 <entry>/config/opensrf/passwd </entry>
1400 <entry><systemitem class="domainname">private.localhost</systemitem>
1402 <systemitem class="username">opensrf</systemitem> user
1406 <entry>/config/gateway/username</entry>
1408 <systemitem class="username">opensrf</systemitem>
1412 <entry>/config/gateway/passwd</entry>
1413 <entry><systemitem class="domainname">public.localhost</systemitem>
1415 <systemitem class="username">opensrf</systemitem> user
1419 <entry>/config/routers/router/transport/username,
1420 first entry where server == public.localhost</entry>
1422 <systemitem class="username">router</systemitem>
1426 <entry>/config/routers/router/transport/password,
1427 first entry where server == public.localhost</entry>
1428 <entry><systemitem class="domainname">public.localhost</systemitem>
1430 <systemitem class="username">router</systemitem> user
1434 <entry>/config/routers/router/transport/username,
1435 second entry where server == private.localhost</entry>
1437 <systemitem class="username">router</systemitem>
1441 <entry>/config/routers/router/transport/password,
1442 second entry where server == private.localhost</entry>
1443 <entry><systemitem class="domainname">private.localhost</systemitem>
1445 <systemitem class="username">router</systemitem> user
1452 <step performance="optional">
1453 <title>(OPTIONAL) Create Configuration Files for Users Needing <command>srfsh</command></title>
1454 <para>When OpenSRF was installed in <xref linkend="serversideinstallation-opensrf"/>, the
1455 software installation automatically created a utility named <command>srfsh</command> (surf
1456 shell). This is a command line diagnostic tool for testing and interacting with
1457 OpenSRF. It will be used in a future step to complete and test the Evergreen installation.
1458 Earlier in <xref linkend="serversideinstallation-srfsh"/> you also created a configuration
1459 file <filename>~/.srfsh.xml</filename> for each user that might need to use the utility.
1460 See <xref linkend="serversideinstallation-testing"/> for further information.</para>
1462 <step xml:id="serversideinstallation-opensrf-env">
1463 <title>Modify the OpenSRF Environment</title>
1464 <para>In this step you will make some minor modifications to the OpenSRF environment:</para>
1467 <para>Modify the permissions in the directory
1468 <filename class="directory">/openils/var/cgi-bin</filename>
1469 to make the files executable:</para>
1471 <prompt># as the opensrf user:</prompt>
1472 <userinput>chmod 755 /openils/var/cgi-bin/*.cgi</userinput>
1476 <para>As the <systemitem class="username">opensrf</systemitem> user,
1477 modify the shell configuration file <filename>~/.bashrc</filename> for
1478 user <systemitem class="username">opensrf</systemitem> by adding a Perl
1479 environmental variable, then execute the shell configuration file to load
1480 the new variables into your current environment.</para>
1483 <emphasis>In a multi-server environment, you must add any
1484 modifications to <filename>~/.bashrc</filename> to the top of
1485 the file <emphasis>before</emphasis> the line
1486 <literal>[ -z "$PS1" ] && return </literal>.
1487 This will allow headless (scripted) logins to load the correct
1488 environment.</emphasis>
1492 <prompt># as the opensrf user:</prompt>
1493 <userinput>echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc</userinput>
1494 <userinput>. ~/.bashrc</userinput>
1499 <step performance="optional">
1500 <title>(OPTIONAL) Enable and Disable Language Localizations</title>
1501 <para>You can load translations such as Armenian (hy-AM), Canadian French
1502 (fr-CA), and others into the database to complete the translations available in
1503 the OPAC and Staff Client. For further information, see
1504 <xref linkend="enabling_and_disabling_localization"/>.</para>
1508 <section xml:id="serversideinstallation-starting">
1509 <title>Starting Evergreen</title>
1510 <para>In this section you will learn how to start the Evergreen services.
1511 For completeness, instructions for stopping Evergreen can be found later in
1512 <xref linkend="serversideinstallation-stopping"/>.</para>
1515 <para>As the <systemitem class="username">root</systemitem>
1516 user, start the <systemitem class="service">ejabberd</systemitem> and
1517 <systemitem class="service">memcached</systemitem> services as follows:</para>
1519 <prompt># as the root user:</prompt>
1520 <userinput>/etc/init.d/ejabberd start</userinput>
1521 <userinput>/etc/init.d/memcached start</userinput>
1525 <para>As the <systemitem class="username">opensrf</systemitem> user,
1526 start Evergreen as follows:</para>
1528 <prompt># as the opensrf user:</prompt>
1529 <userinput>osrf_ctl.sh -l -a start_all</userinput>
1531 <para>The flag <option>-l</option> forces Evergreen to use
1532 <systemitem class="domainname">localhost</systemitem> (your current system)
1533 as the hostname. The flag <option>-a start_all</option> starts the other
1534 OpenSRF <systemitem class="service">router</systemitem> ,
1535 <systemitem class="service">Perl</systemitem> , and
1536 <systemitem class="service">C</systemitem> services.</para>
1539 <para>You can also start Evergreen without the
1540 <option>-l</option> flag, but the <command>osrf_ctl.sh</command>
1541 utility must know the fully qualified domain name for the system
1542 on which it will execute. That hostname was probably specified
1543 in the configuration file <filename>opensrf.xml</filename> which
1544 you configured in a previous step.</para>
1547 <para>If you receive an error message similar to
1548 <emphasis>osrf_ctl.sh: command not found</emphasis>, then your
1549 environment variable <envar>PATH</envar> does not include the
1550 directory <filename class="directory">/openils/bin</filename>.
1551 As the <systemitem class="username">opensrf</systemitem> user,
1552 edit the configuration file <filename>~/.bashrc</filename> and
1553 add the following line:
1554 <literal>export PATH=$PATH:/openils/bin</literal></para>
1557 <para>If you receive an error message similar to <emphasis>Can't
1558 locate OpenSRF/System.pm in @INC ... BEGIN failed--compilation
1559 aborted</emphasis>, then your environment variable
1560 <emphasis role="bold">PERL5LIB</emphasis> does not include the
1561 directory <filename class="directory">/openils/lib/perl5</filename>.
1562 As the <systemitem class="username">opensrf</systemitem> user,
1563 edit the configuration file <filename>~/.bashrc</filename> and
1564 add the following line:
1565 <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>
1570 <para>In this step you will generate the Web files needed by the Staff Client
1571 and catalog, and update the proximity of locations in the Organizational Unit
1572 tree (which allows <emphasis>Holds</emphasis> to work properly).</para>
1573 <para>You must do this the first time you start Evergreen and after making any
1574 changes to the library hierarchy.</para>
1575 <para>As the <systemitem class="username">opensrf</systemitem> user, execute the
1576 following command and review the results:</para>
1578 <prompt># as the opensrf user:</prompt>
1579 <userinput>cd /openils/bin</userinput>
1580 <userinput>./autogen.sh -c /openils/conf/opensrf_core.xml -u</userinput>
1581 <computeroutput>Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'</computeroutput>
1582 <computeroutput>Updating fieldmapper</computeroutput>
1583 <computeroutput>Updating web_fieldmapper</computeroutput>
1584 <computeroutput>Updating OrgTree</computeroutput>
1585 <computeroutput>removing OrgTree from the cache for locale hy-AM...</computeroutput>
1586 <computeroutput>removing OrgTree from the cache for locale cs-CZ...</computeroutput>
1587 <computeroutput>removing OrgTree from the cache for locale en-CA...</computeroutput>
1588 <computeroutput>removing OrgTree from the cache for locale en-US...</computeroutput>
1589 <computeroutput>removing OrgTree from the cache for locale fr-CA...</computeroutput>
1590 <computeroutput>removing OrgTree from the cache for locale ru-RU...</computeroutput>
1591 <computeroutput>Updating OrgTree HTML</computeroutput>
1592 <computeroutput>Updating locales selection HTML</computeroutput>
1593 <computeroutput>Updating Search Groups</computeroutput>
1594 <computeroutput>Refreshing proximity of org units</computeroutput>
1595 <computeroutput>Successfully updated the organization proximity</computeroutput>
1596 <computeroutput>Done</computeroutput>
1600 <para>As the <systemitem class="username">root</systemitem> user, restart the
1601 Apache Web server:</para>
1603 <prompt># as the root user:</prompt>
1604 <userinput>/etc/init.d/apache2 restart</userinput>
1607 <para>If the Apache Web server was running when you started the OpenSRF
1608 services, you might not be able to successfully log into the OPAC or
1609 Staff Client until the Apache Web server has been restarted.</para>
1614 <section xml:id="serversideinstallation-testing">
1615 <title>Testing Your Evergreen Installation</title>
1616 <para>This section describes several simple tests you can perform to verify that the Evergreen
1617 server-side software has been installed and configured properly and is running as
1619 <simplesect xml:id="serversideinstallation-testing-connections">
1620 <title>Testing Connections to Evergreen</title>
1621 <para>Once you have installed and started Evergreen, test your connection to Evergreen. Start the
1622 <command>srfsh</command> application and try logging onto the Evergreen server using the default
1623 administrator username and password. Following is sample output generated by executing
1624 <command>srfsh</command> after a successful Evergreen installation. For help with
1625 <command>srfsh</command> commands, type <userinput>help</userinput> at the prompt.
1626 As the <systemitem class="username">opensrf</systemitem> user,
1627 execute the following commands to test your Evergreen connection:</para>
1629 <prompt># as the opensrf user:</prompt>
1630 <userinput>/openils/bin/srfsh</userinput>
1631 <computeroutput>srfsh%</computeroutput>
1632 <userinput>login admin open-ils</userinput>
1633 <computeroutput>Received Data: "250bf1518c7527a03249858687714376"</computeroutput>
1634 <computeroutput>------------------------------------</computeroutput>
1635 <computeroutput>Request Completed Successfully</computeroutput>
1636 <computeroutput>Request Time in seconds: 0.045286</computeroutput>
1637 <computeroutput>------------------------------------</computeroutput>
1638 <computeroutput>Received Data: {</computeroutput>
1639 <computeroutput> "ilsevent":0,</computeroutput>
1640 <computeroutput> "textcode":"SUCCESS",</computeroutput>
1641 <computeroutput> "desc":" ",</computeroutput>
1642 <computeroutput> "pid":21616,</computeroutput>
1643 <computeroutput> "stacktrace":"oils_auth.c:304",</computeroutput>
1644 <computeroutput> "payload":{</computeroutput>
1645 <computeroutput> "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",</computeroutput>
1646 <computeroutput> "authtime":420</computeroutput>
1647 <computeroutput> }</computeroutput>
1648 <computeroutput>}</computeroutput>
1649 <computeroutput>------------------------------------</computeroutput>
1650 <computeroutput>Request Completed Successfully</computeroutput>
1651 <computeroutput>Request Time in seconds: 1.336568</computeroutput>
1652 <computeroutput>------------------------------------</computeroutput>
1654 <para>If this does not work, try the following:</para>
1657 <para>As the <systemitem class="username">opensrf</systemitem> user, run the
1658 <filename>settings-tester.pl</filename> utility to review your Evergreen
1659 installation for any system configuration problems:</para>
1661 <prompt># as the opensrf user:</prompt>
1662 <userinput>cd /home/opensrf</userinput>
1663 <userinput>./Evergreen-ILS-1.6.1.2/Open-ILS/src/support-scripts/settings-tester.pl</userinput>
1665 <para>If the output of <command>settings-tester.pl</command> does not help you
1666 find the problem, please do not make any significant changes to your
1667 configuration.</para>
1670 <para>Follow the steps in the troubleshooting guide in
1671 <xref linkend="troubleshooting"/>.</para>
1674 <para>If you have followed the entire set of installation steps listed here
1675 closely, you are probably extremely close to a working system. Gather your
1676 configuration files and log files and contact the
1677 <ulink url="http://open-ils.org/listserv.php">Evergreen Development Mailing List</ulink>
1678 list for assistance before making any drastic changes to your system
1679 configuration.</para>
1683 <simplesect xml:id="serversideinstallation-running-staffclient">
1684 <title>Testing the Staff Client on Linux</title>
1685 <para>In this section you will confirm that a basic login on the Staff Client works
1687 <para>Run the Evergreen Staff Client on a Linux system by using the application
1688 <emphasis>XULRunner</emphasis> (installed automatically and by default with Firefox
1689 version 3.0 and later on Ubuntu and Debian distributions).</para>
1690 <para>As the <systemitem class="username">root</systemitem> user, start the Staff Client
1693 <prompt># as the root user:</prompt>
1694 <userinput>xulrunner /home/opensrf/Evergreen-ILS-1.6.1.2/Open-ILS/xul/staff_client/build/application.ini</userinput>
1696 <para>The login screen for the Staff Client should appear:</para>
1698 <alt>Logging into the Staff Client</alt>
1700 <imagedata fileref="../media/serversideinstallation-staffclient-running-1.png" format="PNG" scalefit="1" width="70%"/>
1703 <para>First, add the name of your Evergreen server to the field
1704 <literal>Hostname</literal> in the <literal>Server</literal> section. You will probably
1705 want to use <literal>127.0.0.1</literal>. After adding the server name, click Re-Test
1706 Server. You should now see the messages <literal>200:OK</literal> in the fields
1707 <literal>Status</literal> and <literal>Version</literal>.</para>
1708 <para>Because this is the initial run of the Staff Client, you will see a warning in the
1709 upper-right saying: <emphasis role="bold">Not yet configured for the specified
1710 server</emphasis>. To continue, you must assign a workstation name. Refer to
1711 <xref linkend="staffclientinstallation-workstationnames"/> for further details.</para>
1712 <para>Try to log into the Staff Client with the username <literal>admin</literal> and
1713 the password <literal>open-ils</literal>. If the login is successful, you will see the
1714 following screen:</para>
1716 <alt>Logging into the Staff Client</alt>
1718 <imagedata fileref="../media/serversideinstallation-staffclient-running-4.png" format="PNG" scalefit="1" width="70%"/>
1721 <para>Otherwise, you may need to click <guibutton>'Add SSL Exception'</guibutton> in the
1722 main window. You should see a popup window titled <literal>Add Security Exception</literal>:</para>
1724 <alt>Adding an SSL Exception in the Staff Client</alt>
1726 <imagedata fileref="../media/serversideinstallation-staffclient-running-2.png" format="PNG" scalefit="1" width="70%"/>
1729 <para>Click <guibutton>'Get Certificate'</guibutton>, then click <guibutton>'Confirm
1730 Security Exception'</guibutton>, then click <guibutton>'Re-Test Server'</guibutton> in the
1731 main window and try to log in again.</para>
1733 <simplesect xml:id="serversideinstallation-starting-apache-server">
1734 <title>Testing the Apache Web Server</title>
1735 <para>In this section you will test the Apache configuration file(s), then restart the
1736 Apache web server.</para>
1737 <para>As the <emphasis role="bold">root</emphasis> user, execute the following
1738 commands. Note the use of <emphasis>restart</emphasis> to force the new Evergreen
1739 modules to be reloaded even if the Apache server is already running. Any problems found
1740 with your configuration files should be displayed:</para>
1742 <prompt># as the root user:</prompt>
1743 <userinput>apache2ctl configtest && /etc/init.d/apache2 restart</userinput>
1746 <simplesect xml:id="serversideinstallation-stopping">
1747 <title>Stopping Evergreen</title>
1748 <para>In <xref linkend="serversideinstallation-starting"/> you learned how to start the
1749 Evergreen services. For completeness, following are instructions for stopping the
1750 Evergreen services.</para>
1751 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all Evergreen
1752 services by using the following command:</para>
1754 # as the opensrf user
1755 # stop the server; use "-l" to force hostname to be "localhost"
1756 osrf_ctl.sh -l -a stop_all
1759 <para>You can also stop Evergreen services
1760 <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but the
1761 <command>osrf_ctl.sh</command> utility must know the fully qualified domain name
1762 for the system on which it will execute. That hostname may have been specified
1763 in the configuration file <filename>opensrf.xml</filename>, which you configured
1764 in a previous step.</para>
1768 <section xml:id="serversideinstallation-postinstallation">
1769 <title>Post-Installation Chores</title>
1770 <para>There are several additional steps you may need to complete after Evergreen has been
1771 successfully installed and tested. Some steps may not be needed (e.g., setting up support for
1774 <title>Remove temporary Apache configuration changes</title>
1775 <para>You modified the Apache configuration file
1776 <filename>/etc/apache2/sites-available/eg.conf</filename> in an earlier step as a
1777 temporary measure to expedite testing (see
1778 <xref linkend="serversideinstallation-modify-apache"/> for further information).
1779 Those changes must now be reversed in order to deny unwanted access to your
1780 CGI scripts from users on other public networks.</para>
1783 <emphasis>This temporary network update was done to expedite
1784 testing. You <emphasis role="bold">must</emphasis> correct
1785 this for a public production system.</emphasis>
1788 <para>As the <systemitem class="username">root</systemitem> user, edit the configuration
1789 file again and comment out the line <literal>Allow from all</literal> and uncomment the
1790 line <literal>Allow from 10.0.0.0/8</literal>, then change it to match your network
1791 address scheme.</para>
1793 <section xml:id="serversideinstallation-ssl">
1794 <title>Configure a permanent SSL key</title>
1795 <para>In a previous step (see <xref linkend="serversideinstallation-createsslcertificate"/>)
1796 you used the command <command>openssl</command> to temporarily
1797 create a new SSL key for the Apache server. This self-signed security certificate was adequate
1798 during testing and development, but will continue to generate warnings in the Staff Client
1799 and browser. For a public production server you should configure or purchase a signed SSL
1801 <para>There are several open source software solutions that provide schemes to generate and
1802 maintain public key security certificates for your library system. Some popular projects are
1803 listed below; please review them for background information on why you need such a system and
1804 how you can provide it:</para>
1807 <ulink url="http://www.openca.org/projects/openca/">http://www.openca.org/projects/openca/</ulink>
1810 <ulink url="http://sourceforge.net/projects/ejbca/">http://sourceforge.net/projects/ejbca/</ulink>
1813 <ulink url="http://pki.fedoraproject.org">http://pki.fedoraproject.org</ulink>
1818 <emphasis>The temporary SSL key was only created to expedite
1819 testing. You should install a proper SSL certificate for a public
1820 production system.</emphasis>
1825 <title>(OPTIONAL) Set Up Support For Reports</title>
1826 <para>Evergreen reports are extremely powerful but require some simple configuration.
1827 This section describes starting and stopping the Reporter daemon processes.</para>
1830 <para>Starting the Reporter Daemon</para>
1831 <para>Once the <systemitem class="daemon">open-ils.reporter</systemitem>
1832 process is running and enabled on the gateway, you can start the
1833 Reporter daemon. That process periodically checks for requests for new
1834 or scheduled reports, then starts them as required.</para>
1835 <para>As the <systemitem class="username">opensrf</systemitem> user,
1836 start the Reporter daemon using the following command:</para>
1838 <prompt># as the opensrf user:</prompt>
1839 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2/Open-ILS/src/reporter</userinput>
1840 <userinput>./clark-kent.pl --daemon</userinput>
1842 <para>You can control how the <command>clark-kent.pl</command> utility behaves
1843 by specifying any of several command-line options:</para>
1845 <listitem><option>--sleep=interval</option> : number of seconds
1846 to sleep between checks for new reports to run; defaults to
1847 <literal>10</literal></listitem>
1848 <listitem><option>--lockfile=filename</option> : where to place
1849 the lockfile for the process; defaults to
1850 <filename>/tmp/reporter-LOCK</filename></listitem>
1851 <listitem><option>--concurrency=integer</option> : number of
1852 Reporter daemon processes to run; defaults to
1853 <literal>1</literal></listitem>
1854 <listitem><option>--bootstrap=filename</option> : OpenSRF
1855 bootstrap configuration file; defaults to
1856 <filename>/openils/conf/opensrf_core.xml</filename></listitem>
1860 <para>Stopping the Reporter Daemon</para>
1861 <para>To stop the Reporter daemon, you must kill the process and remove
1862 the lockfile. The daemon may have just a single associated process or
1863 there may be several processes if the daemon was started with the optional
1864 <literal>--concurrency</literal> switch. It will also have a lockfile
1865 in the default location.</para>
1866 <para>As the <systemitem class="username">opensrf</systemitem> user,
1867 execute the following shell commands:</para>
1869 <prompt># as the root user:</prompt>
1870 <prompt># find and kill the process ID number(s)</prompt>
1871 <userinput>kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`</userinput>
1872 <prompt># remove the lock file</prompt>
1873 <userinput>rm /tmp/reporter-LOCK</userinput>
1879 <section xml:id="serversideinstallation-virtual">
1880 <title>Installing In Virtualized <systemitem class="osname">Linux</systemitem> Environments</title>
1881 <para>This section describes the installation of Evergreen software in so-called "virtualized"
1882 software environments. Evergreen software runs as a native application on any of several
1883 well-known x86 (32-bit) and x86-64 (64-bit) <systemitem class="osname">Linux</systemitem>
1884 distributions including <systemitem class="osname">Ubuntu</systemitem> and
1885 <systemitem class="osname">Debian</systemitem> but it does not run as a native application
1886 on the <systemitem class="osname">Microsoft Windows</systemitem> operating system.
1887 However, it is possible to execute Evergreen on a <systemitem class="osname">Windows</systemitem>
1888 host system by running it within a virtual Linux-guest installation, which itself executes
1889 on the <systemitem class="osname">Windows</systemitem> system.
1890 The <systemitem class="osname">Linux</systemitem> environment is fully emulated and acts
1891 (within limits) just as if it were executing on a real standalone system.</para>
1892 <para>This technique of emulating a <systemitem class="osname">Linux</systemitem> environment on
1893 a <systemitem class="osname">Windows</systemitem> host is a practical way to install and run an
1894 Evergreen system if it is not possible to dedicate a physical machine solely as a
1895 <systemitem class="osname">Linux</systemitem> host for Evergreen. This architecture is not
1896 recommended for large scale systems since there are performance limitations to running Evergreen
1897 in a virtualized environment. However, it is a reasonable architecture for smaller experimental
1898 systems, as a proof of concept, or as a conference-room pilot.</para>
1900 <title>Installing Virtualization Software</title>
1901 <para>As described above, Evergreen can be installed on top of an emulated
1902 <systemitem class="osname">Linux</systemitem> environment. The
1903 <systemitem class="osname">Linux</systemitem> environment, in turn, is installed
1904 on top of a software application such as <application>"VirtualBox"</application>,
1905 <application>"VMware"</application> or <application>"VirtualPC"</application> which must
1906 first be installed on the <systemitem class="osname">Windows</systemitem> system. This
1907 section contains step-by-step examples that show installing popular virtualization
1908 applications on a <systemitem class="osname">Windows</systemitem> host system. Following
1909 this section are further descriptions of installing
1910 <systemitem class="osname">Linux</systemitem> and Evergreen systems using that
1911 virtualization software.</para>
1913 <title>Installing <application>"VirtualBox"</application> Virtualization Software</title>
1914 <para>This section reviews installation of the
1915 <application>"VirtualBox"</application> application on
1916 <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>.
1917 Download the latest edition of <application>VirtualBox</application> from their official website:
1918 <link xl:href="http://virtualbox.org" xl:title="virtual box">http://virtualbox.org</link>
1919 and follow the on screen instructions to install the software.</para>
1922 <title>Installing VMware Virtualization Software</title>
1924 <primary>virtualization software</primary>
1925 <secondary>VMware</secondary>
1927 <para>This section reviews installation of the
1928 <application>"VMware"</application> application on
1929 <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>.
1930 Find and Download the free virtual machine software of from the VMware
1932 <ulink url="http://downloads.vmware.com">http://downloads.vmware.com</ulink>
1933 and follow the on-screen instructions.</para>
1936 <simplesect xml:id="serversideinstallation-virtual-install-linux-ev">
1937 <title>Installing <systemitem class="osname">Linux</systemitem> /
1938 Evergreen on Virtualization Software</title>
1939 <para>After the virtualization software is installed and running, there are two ways to
1940 continue with installing <systemitem class="osname">Linux</systemitem> and Evergreen
1941 software in the new virtualized environment:</para>
1944 <para>Download and install a prebuilt software image that contains a
1945 working <systemitem class="osname">Linux</systemitem> / Evergreen system
1946 (see <xref linkend="serversideinstall-virtual-prebuilt"/> for
1950 <para>Manually install a <systemitem class="osname">Linux</systemitem>
1951 guest system, then manually install Evergreen on it.</para>
1954 <para>We review each method in the following sections.</para>
1955 <simplesect xml:id="serversideinstall-virtual-prebuilt">
1956 <title>Download and install a prebuilt software image</title>
1957 <para>You can download a prebuilt software image that, when installed with your
1958 virtualization software, emulates a
1959 <systemitem class="osname">Linux</systemitem> guest system containing a running
1960 Evergreen distribution. The image is essentially a snapshot of a hard disk from
1961 a fully configured, functional <systemitem class="osname">Linux</systemitem>
1962 system with Evergreen already installed.</para>
1963 <para>We recommend this approach if you wish to get Evergreen running quickly
1964 with minimal attention to configuration. After reviewing only a few
1965 configuration details you can have a working Evergreen system that integrates
1966 smoothly with the rest of your network. See
1967 <xref linkend="serversideinstall-virtual-versions"/> for a list of prebuilt
1968 software images that are currently available to download and install</para>
1969 <note>DISCLAIMER: The following virtual images have been contributed by members
1970 of the Evergreen community for the purposes of testing, evaluation, training,
1971 and development.</note>
1972 <table xml:id="serversideinstall-virtual-versions">
1973 <title>Linux / Evergreen Virtual Images</title>
1974 <tgroup align="left" cols="4" colsep="1" rowsep="1">
1975 <colspec colnum="1" colwidth="1.0*"/>
1976 <colspec colnum="2" colwidth="1.0*"/>
1977 <colspec colnum="3" colwidth="3.0*"/>
1978 <colspec colnum="4" colwidth="1.0*"/>
1981 <entry>Linux Version</entry>
1982 <entry>Evergreen Version</entry>
1983 <entry>Image</entry>
1984 <entry>Comments</entry>
1989 <entry>Debian lenny (5.0)</entry>
1990 <entry>1.6.0.1</entry>
1992 <ulink url="http://www.open-ils.org/~denials/Evergreen1601_DebianLenny.zip"> download </ulink>
1994 <entry>VirtualBox image</entry>
1997 <entry>Ubuntu karmic koala (9.10)</entry>
1998 <entry>1.6.0.0</entry>
2000 <ulink url="http://www.open-ils.org/~denials/Evergreen-1600-Karmic.zip"> download </ulink>
2002 <entry>VirtualBox image</entry>
2008 <title>VirtualBox Example</title>
2010 <primary>virtualization software</primary>
2011 <secondary>VirtualBox</secondary>
2014 <para>Start VirtualBox for the first time and select
2015 <menuchoice><guimenu>File</guimenu><guimenuitem>VirtualBox Media
2016 Manager</guimenuitem><guimenuitem>Add</guimenuitem></menuchoice>
2017 to locate the prebuilt software image just downloaded (the
2018 example shows it was extracted from the original
2019 <filename class="extension">zip</filename> file into a temporary directory
2020 <filename class="directory">C:\temp</filename>).</para>
2023 <para>After selecting the file, click <guibutton>'Open'</guibutton> to import it.</para>
2026 <para>Then click <guibutton>'OK'</guibutton> to save the selection
2027 and return to the VirtualBox Media Manager</para>
2030 <para>Click <guibutton>'New'</guibutton>, then <guibutton>'Next'</guibutton>
2031 to continue and create a new virtual machine (VM).</para>
2034 <para>Create a new name for the VM and set the operating system
2035 type, then click <guibutton>'Next'</guibutton>.</para>
2038 <para>Set the memory size (at least 512Mb),
2039 then click <guibutton>'Next'</guibutton>.</para>
2042 <para>Edit the Virtual Hard Disk configuration settings; click
2043 the radio boxes <guilabel>Boot Hard Disk</guilabel> and
2044 <guilabel>Use existing hard disk</guilabel>
2045 and ensure that the disk name <guilabel>Evergreen1601_DebianLenny.vmdk</guilabel>
2046 is selected. Click <guibutton>'Finish'</guibutton> to finish the
2050 <para>Install the <application>VirtualBox Guest
2051 Additions</application> (really a required upgrade to
2055 <para>Return to VirtualBox and see the summary of the VM just
2056 created. Click <guibutton>'Start'</guibutton> to boot the new VM.</para>
2059 <para>See the start of the <systemitem class="osname">Linux</systemitem>
2060 boot sequence. Choose <guimenuitem>Debian Gnu/Linux, kernel
2061 2.6.26-2-686</guimenuitem> from the startup menu and click
2062 <guibutton>'Enter'</guibutton> to start
2063 <systemitem class="osname">Linux</systemitem> and Evergreen.
2064 After some delay you should see the command line prompt
2065 <prompt>debian-lenny login:</prompt>. Log in with username
2066 <userinput>root</userinput> and password <userinput>evergreen</userinput>