]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
rewrite NOTE and WARNING messages;
[working/Evergreen.git] / 1.6 / admin / ServersideInstallation.xml
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">
3         <info>
4                 <title>Server-side Installation of Evergreen Software</title>
5                 <abstract>
6                         <para>This section describes installation of the Evergreen server-side software. Installation, configuration, testing and verification of the Evergreen server-side software is straightforward if you follow some simple directions. Installation of the Evergreen Staff Client software is handled in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-staffclient"> "Installing the Evergreen Staff Client" </link></emphasis></emphasis>. </para>
7                 </abstract>
8         </info>
9         <section xml:id="serversideinstallation-overview">
10                 <title>Overview</title>
11                 <para>A bare-minimum system Evergreen system requires only a single Server and a single Staff Client, both residing on a single server machine. In fact, that is a reasonable architecture for simple experiments or as a proof of concept in a conference-room pilot. But typical real-world systems will probably consist of at least one or two Evergreen servers plus multiple Staff Clients.</para>
12                 <para>Another simple system may require only that you install one or more instances of the Staff Client software. For instance, if your consortium already provides the Evergreen server software or if you are using the hosted version provided by Equinox, you do not need to install the Evergreen server-side software at all.</para>
13                 <para>Current versions of Evergreen software run as native applications on any of several well-known Linux distributions (e.g., <emphasis>Ubuntu</emphasis> and <emphasis>Debian</emphasis>). It does not currently run as a native application on the Windows operating system (e.g., WindowsXP, WindowsXP Professional, Windows7), but the software can still be installed and run on Windows via a so-called <emphasis>virtualized</emphasis> Unix-guest Operating System (using, for example, VirtualBox or VMware to emulate a Linux environment). More information on running Evergreen in virtualized environments can be found in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-virtual">"Installing Evergreen in Virtualized Unix Environments"</link></emphasis></emphasis>.</para>
14         </section>
15         <section xml:id="serversideinstallation-requirements">
16                 <title>System Requirements</title>
17                 <para>This section describes various requirements of the hardware and software environment that must be fulfilled to support a successful Evergreen installation. For a description of the installation process itself and for links to further instructions please review the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-process">"The Installation Process"</link></emphasis></emphasis> .</para>
18                 <para>The system requirements for running Evergreen really depend on what you want to do with it. For just evaluating the software, or for a very small library (for example, 1 circulation station, a few thousand items, and infrequent online catalog use), any modern desktop or laptop made within the last few years capable of running Linux, FreeBSD, etc. should suffice. We recommend at least 512mb of RAM.</para>
19                 <para> [[ ADD OTHER HARDWARE AND SOFTWARE REQUIREMENTS ]] </para>
20                 <para>
21                         <screen>
22                         From Dan Scott on [http://list.georgialibraries.org/pipermail/
23                           open-ils-general/2007-July/000316.html|OPEN-ILS-GENERAL]:
24                         On 8/11/07, lan ye &lt;lye at mail.slcl.org> wrote:
25                         > We've been researching the Evergreen Open Source Library system,
26                         > and would like to have a list of hardware requirements for the
27                         > installation of a small test server. To keep things within a
28                         > small budget, I would like to just use an ordinary PC. Could you
29                         > send some information to us?
30
31                         For system requirements, it depends on how extensive you want your
32                         tests to be. Evergreen and all of the pieces it depends on
33                         (PostgreSQL, Apache, Ejabberd) run happily in a VMWare image
34                         allocated 512MB of RAM on my laptop with just the Project
35                         Gutenberg e-books loaded, and that's enough to evaluate the OPAC
36                         interface / try out the staff client / make some local changes and
37                         generally experiment. But I'm not going to load one million bib
38                         records into that system and expect it to perform. So, probably
39                         any hardware you have lying around would be adequate for a small
40                         test server.
41
42                         > It looks like Evergreen has been successfully installed on two
43                         > Linux systems: Gentoo and Ubuntu. Which one is the best for us
44                         > to test using what's already in place at other libraries? Are
45                         > there any differences / Advantages in functionality between
46                         > Gentoo and Ubuntu?
47
48                         As John said, GPLS is running on Debian, and that's the only
49                         Evergreen system that is in production at the moment. However, the
50                         documentation for installing on Debian is a bit scattered right
51                         now. The developers themselves used Gentoo originally, and that's
52                         what I'm using at the moment &amp; have documented in the wiki;
53                         the install process on Ubuntu is very thoroughly documented and
54                         Ubuntu is reasonably close to Debian.  
55                         See http://open-ils.org/dokuwiki/doku.php?id=server_installation 
56                         for the list of install instructions for various distributions.
57
58                         As for advantages / disadvantages of particular distributions,
59                         that's a religious war that I don't want to step into... We'll try
60                         to help you out no matter what distribution you choose; just
61                         please choose a current release :)
62
63                         -- 
64                         Dan Scott
65                         Laurentian University
66                         </screen>
67                         <screen>
68                         And from James Fournie in that same [http://list.georgialibraries.org/
69                           pipermail/open-ils-general/2007-July/000317.html|thread]:
70                         We are running a test Ubuntu server on a ~1ghz Celeron PC with
71                         512mb RAM.  It seems to be ok handling the Gutenberg samples, and
72                         our collection of about 8000 records. We did have serious problems
73                         using anything less than 512mb RAM. Also, I tried Evergreen on a
74                         K6 II 350, but it wasn't pretty.
75
76                         James Fournie
77                         Digitization Librarian
78                         Union of B.C. Indian Chiefs
79                         </screen>
80                 </para>
81         </section>
82         <section xml:id="serversideinstallation-examples">
83                 <title>Example System Architectures</title>
84                 <para>This sections describes examples of some working Evergreen system architectures, including both server-side software and Staff Client software.</para>
85                 <section xml:id="serversideinstallation-example-pines">
86                         <title>PINES</title>
87                         <para>In order to provide load balancing and high-availability at the OPAC and Staff Client level, PINES has implemented a Linux Virtual Server environment with five independent mini-clusters. This allows live updates of the entire system with no perceived downtime or interruption in service.</para>
88                         <para>[[ ADD FURTHER INFORMATION ON PINES ]] </para>
89                 </section>
90                 <section xml:id="serversideinstallation-example-sitka">
91                         <title>Sitka</title>
92                         <para>[[ ADD FURTHER INFORMATION ON SITKA ]] </para>
93                 </section>
94                 <section xml:id="serversideinstallation-example-other">
95                         <title>Other working systems</title>
96                         <para>[[ ADD FURTHER INFORMATION ON OTHER WORKING SYSTEMS ]] </para>
97                 </section>
98         </section>
99         <section xml:id="serversideinstallation-process">
100                 <title>The Installation Process</title>
101                 <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current stable software release. Earlier software distributions are also available. In the following sections you will find instructions tailored to specific distributions.</para>
102                 <section>
103                         <title>Current Stable Software Release</title>
104                         <para>The current stable release of Evergreen is version <emphasis><emphasis role="bold">1.6.0.7</emphasis></emphasis>. Instructions for installing, configuring and testing that version on the <emphasis>Ubuntu</emphasis> or <emphasis>Debian</emphasis> Linux systems are found in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-ubuntudebian"> "Installing Evergreen on Ubuntu or Debian" </link></emphasis></emphasis> .
105                         </para>
106                         <para>This release of Evergreen software is dependent on the Open Service Request Framework (OpenSRF) software framework. The current stable release of OpenSRF is version <emphasis><emphasis role="bold">1.2.2</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-opensrf"> "Installing OpenSRF" </link></emphasis></emphasis> .
107                         </para>
108                 </section>
109                 <section>
110                         <title>Previous Software Releases</title>
111                         <para>Earlier releases of Evergreen are also available. Instructions for installing, configuring and testing earlier versions are found in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-previousversions">Installing Previous Versions of Evergreen</link></emphasis></emphasis> .</para>
112                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold">1.4.0.6</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-ubuntudebian-previous">Installing Evergreen 1.4.0.6 on Ubuntu or Debian</link></emphasis></emphasis> .
113                         </para>
114                         <para>The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>. Instructions for installing, configuring and testing that version are found in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-opensrf-previous">Installing OpenSRF 1.0.x</link></emphasis></emphasis> .
115                         </para>
116                 </section>
117         </section>
118         <section xml:id="serversideinstallation-ubuntudebian">
119                 <title>Installing Evergreen On Ubuntu or Debian</title>
120                 <para>This section outlines the installation process for the latest stable version of Evergreen (1.6.0.7).</para>
121                 <para/>
122                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) architectures. There may be differences between the Desktop and Server editions of Ubuntu. These instructions assume the Server edition.</para>
123                 <para>In the following instructions, you are asked to perform certain steps as either the <emphasis role="bold">root</emphasis> user, the <emphasis role="bold">opensrf</emphasis> user, or the <emphasis role="bold">postgres</emphasis> user.</para>
124                 <para>To become the <emphasis role="bold">root</emphasis> user, issue the command: <emphasis><emphasis role="bold">su - root</emphasis></emphasis>. To switch from the <emphasis role="bold">root</emphasis> user to a different user, issue a command like: <emphasis><emphasis role="bold">su - USERNAME</emphasis></emphasis>. For example, to switch from the <emphasis role="bold">root</emphasis> user to the <emphasis role="bold">opensrf</emphasis> user, issue this command: <emphasis><emphasis role="bold">su - opensrf</emphasis></emphasis>. Once you have become a non-root user, to become the <emphasis role="bold">root</emphasis> user again, simply issue the <emphasis><emphasis role="bold">exit</emphasis></emphasis> command.</para>
125                 <section>
126                         <title>Downloading and Building Evergreen </title>
127                         <para>In this section you will download, unpack, install, configure and test the Evergreen system, including the Evergreen server and the PostgreSQL database system. You will make several configuration changes and adjustments to the software, including updates to configure the system for your own locale, and some updates needed to work around a few known issues.</para>
128                         <para>As far as possible, perform the following steps in the order they are given, since the success of many steps relies on the successful completion of earlier steps. You should make backup copies of files and environments when you are instructed to do so. In the event of installation problems those copies can allow you to back out of a step gracefully and resume the installation from a known state.</para>
129                         <para>Of course, after you successfully complete and test the entire Evergreen installation you should take a final snapshot backup of your system(s). This can be the first in the series of regularly scheduled system backups that you should probably also begin.</para>
130                         <section>
131                                 <title>Installing OpenSRF</title>
132                                 <para>Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-opensrf"> "Installing OpenSRF" </link></emphasis></emphasis>.</para>
133                                 <para>Follow the steps outlined in that section and run the specified tests to ensure that OpenSRF is properly installed and configured. Do not continue with any further Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>
134                         </section>
135                         <section>
136                                 <title>Download and Unpack Latest Evergreen Version</title>
137                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, download and extract the latest version of Evergreen. The latest version can be found here: <emphasis><emphasis role="bold"><ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz"></ulink></emphasis></emphasis></para>
138                                 <para>[[ VERIFY LOCATION OF LATEST VERSION OF EVERGREEN ]]</para>
139                                 <figure>
140                                         <title>Commands to download/extract Evergreen</title>
141                                         <screen>
142                                         $ su - opensrf
143                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz
144                                         $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz
145                                         </screen>
146                                 </figure>
147                         </section>
148                         <section>
149                                 <title>Install Prerequisites to Build Evergreen</title>
150                                 <para>In this step you will install and configure a set of prerequisites used to build the Evergreen server-side software. In a following step you will actually build the software.</para>
151                                 <para>As the <emphasis role="bold">root</emphasis> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[distribution]</emphasis> in the following example with the keyword that corresponds to the actual Linux distribution listed here:</para>
152                                 <itemizedlist>
153                                         <listitem><emphasis>debian-lenny</emphasis> for Debian Lenny (5.0), the most recent version</listitem>
154                                         <listitem><emphasis>debian-etch</emphasis> for Debian Etch (4.0)</listitem>
155                                         <para/>
156                                         <listitem><emphasis>ubuntu-karmic</emphasis> for Ubuntu Lucid (10.04) [same as for Karmic]</listitem>
157                                         <listitem><emphasis>ubuntu-karmic</emphasis> for Ubuntu Karmic (9.10)</listitem>
158                                         <listitem><emphasis>ubuntu-intrepid</emphasis> for Ubuntu Intrepid (8.10)</listitem>
159                                         <listitem><emphasis>ubuntu-hardy</emphasis> for Ubuntu Hardy (8.04)</listitem>
160                                         <listitem><emphasis>ubuntu-gutsy</emphasis> for Ubuntu Gutsy (7.10)</listitem>
161                                         <para/>
162                                         <listitem><emphasis>gentoo</emphasis> generic for Gentoo versions</listitem>
163                                         <listitem><emphasis>centos</emphasis> generic for Centos versions</listitem>
164                                         <para/>
165                                         <listitem>[[ ADD INFO FOR OTHER LINUX DISTRIBUTIONS ]]</listitem>
166                                 </itemizedlist>
167                                 <figure>
168                                         <title>Commands to install prerequisites for Evergreen</title>
169                                         <screen>
170                                         $ su - root
171                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
172                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]
173                                         </screen>
174                                 </figure>
175                         </section>
176                         <section>
177                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>
178                                 <para>Since the PostgreSQL server is usually a standalone server in multi-server production systems, the prerequisite installer Makefile in the previous step does not automatically install PostgreSQL. If your PostgreSQL server is on a different system, just skip this step.</para>
179                                 <para>For further information on installing PostgreSQL, see the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-postgresql"> "Installing PostgreSQL" </link></emphasis></emphasis>.</para>
180                                 <para>If your PostgreSQL server will be on the same system as your Evergreen software, then as the <emphasis role="bold">root</emphasis> user install the required PostgreSQL server packages:</para>
181                                 <figure>
182                                         <title>Commands to install the PostgreSQL server</title>
183                                         <screen>
184                                         $ su - root
185
186                                         # Debian Lenny and Ubuntu Hardy (8.04)
187                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
188
189                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
190                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
191                                         </screen>
192                                 </figure>
193                                 <note>
194                                         <para>
195                                                 <emphasis>PostgreSQL 8.1 is deprecated and will become unsupported in a future release, though existing installations upgrading from Evergreen 1.4 or before will work fine. However, consider upgrading your Postgres soon!</emphasis>
196                                         </para>
197                                 </note>
198                                 <para>[[ VERIFY: IS THIS STILL TRUE? ]]</para>
199                                 <para>[[ ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE ]]</para>
200                         </section>
201                         <section>
202                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
203                                 <para>If PostgreSQL is running on the same system as your Evergreen software, then the Perl modules will automatically be available. Just skip this step.</para>
204                                 <para>Otherwise, if your PostgreSQL server is running on another system, then as the <emphasis role="bold">root</emphasis> user install the following Perl modules on that system:</para>
205                                 <figure>
206                                         <title>Commands to install Perl modules</title>
207                                         <screen>
208                                         # ensure the gcc compiler is installed
209                                         $ su - root
210                                         $ aptitude install gcc
211
212                                         # install the Perl modules
213                                         $ perl -MCPAN -e shell
214                                         cpan> install JSON::XS
215                                         cpan> install MARC::Record
216                                         cpan> install MARC::File::XML
217                                         </screen>
218                                 </figure>
219                                 <para>[[ ADD INFO ON HOW TO INSTALL THE PERL MODULES ]]</para>
220                                 <para>[[ ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED ]]</para>
221                         </section>
222                         <section>
223                                 <title>Add Additional Library Paths on Evergreen System</title>
224                                 <para>As the <emphasis role="bold">root</emphasis> user, you must update the system dynamic library path to ensure the system will recognize the newly installed libraries. Do this by creating a new file named <emphasis role="bold">/etc/ld.so.conf.d/eg.conf</emphasis> containing the two paths, then run the command <emphasis role="bold">ldconfig</emphasis> to automatically read the file and modify the dynamic library path:</para>
225                                 <figure>
226                                         <title>Commands to modify system dynamic library path</title>
227                                         <screen>
228                                         $ su - root
229                                         $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
230                                         /usr/local/lib
231                                         /usr/local/lib/dbd
232                                         ENDOFFILE
233                                         $ ldconfig
234                                         </screen>
235                                 </figure>
236                         </section>
237                         <section>
238                                 <title>(OPTIONAL) Restart the PostgreSQL Service</title>
239                                 <para>If PostgreSQL is running on the same system as the rest of Evergreen, as the <emphasis role="bold">root</emphasis> user you must restart the PostgreSQL service to avoid a problem where the library <emphasis role="bold">plperl.so</emphasis> cannot be found. If your PostgreSQL server is running on another system, just skip this step.</para>
240                                 <para>[[ ADD INFO ON OTHER VERSIONS OF POSTGRESQL ]]</para>
241                                 <figure>
242                                         <title>Commands to restart PostgreSQL service</title>
243                                         <screen>
244                                         $ su - root
245                                         $ /etc/init.d/postgresql-8.3 restart
246                                         </screen>
247                                 </figure>
248                         </section>
249                         <section>
250                                 <title>Configure and Compile Evergreen Sources</title>
251                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, configure and compile the software from the prerequisites that were set up in previous steps:</para>
252                                 <figure>
253                                         <title>Commands to configure and compile Evergreen</title>
254                                         <screen>
255                                         $ su - opensrf
256                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
257                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
258                                         $ make
259                                         </screen>
260                                 </figure>
261                         </section>
262                         <section>
263                                 <title>Link and Install Evergreen</title>
264                                 <para>As the <emphasis role="bold">root</emphasis> user, link and install the compiled code. In the commands below, remember to set the variable <emphasis role="bold"> STAFF_CLIENT_BUILD_ID </emphasis> to match the version of the Staff Client you will use to connect to the Evergreen server. Finally, create a symbolic link named <emphasis role="bold">server</emphasis> in <emphasis role="bold">/openils/var/web/xul</emphasis> to the <emphasis role="bold">/server</emphasis> subdirectory of your Staff Client build:</para>
265                                 <figure>
266                                         <title>Commands to link and install Evergreen</title>
267                                         <screen>
268                                         $ su - root
269                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
270                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_6 install
271                                         $ cd /openils/var/web/xul
272                                         $ ln -sf rel_1_6_0_7/server server
273                                         </screen>
274                                 </figure>
275                         </section>
276                         <section>
277                                 <title>Copy the OpenSRF Configuration Files</title>
278                                 <para>As the <emphasis role="bold">root</emphasis> user, copy the example OpenSRF configuration files into place. This will replace the OpenSRF configuration files that you set up while installing and testing OpenSRF. You should also create backup copies of the old files for troubleshooting purposes. Finally, change the ownership on the installed files to the user <emphasis role="bold">opensrf</emphasis>:</para>
279                                 <figure>
280                                         <title>Commands to copy OpenSRF configuration files</title>
281                                         <screen>
282                                         $ su - root
283                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
284                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
285                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
286                                         $ chown -R opensrf:opensrf /openils/
287                                         </screen>
288                                 </figure>
289                         </section>
290                         <section>
291                                 <title>Create and configure PostgreSQL Database</title>
292                                 <para>As the <emphasis role="bold">postgres</emphasis> user on your PostgreSQL server, create the Evergreen database.</para>
293                                 <para>Remember to adjust the path for the <emphasis role="bold">contrib</emphasis> repository to match your PostgreSQL server layout. For example, if you built PostgreSQL from source following the cheat sheet, the contrib directory will be located here: <emphasis role="bold">/usr/local/share/contrib</emphasis> . If you installed the PostgreSQL 8.3 server packages on Ubuntu 8.04, the directory will be located here: <emphasis role="bold">/usr/share/postgresql/8.3/contrib/</emphasis> .</para>
294                                 <orderedlist>
295                                         <listitem>
296                                                 <para>
297                                                         <emphasis role="bold">Create and configure the database</emphasis>
298                                                 </para>
299                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
300                                                 <figure>
301                                                         <title>Commands to create database and adjust the path</title>
302                                                         <screen>
303                                                         # create the database
304                                                         $ su - postgres
305                                                         $ createdb -E UNICODE evergreen
306                                                         $ createlang plperl   evergreen
307                                                         $ createlang plperlu  evergreen
308                                                         $ createlang plpgsql  evergreen
309         
310                                                         # adjust the paths
311                                                         $ psql -f /usr/share/postgresql/8.3/contrib/tablefunc.sql evergreen
312                                                         $ psql -f /usr/share/postgresql/8.3/contrib/tsearch2.sql  evergreen
313                                                         $ psql -f /usr/share/postgresql/8.3/contrib/pgxml.sql     evergreen
314                                                         </screen>
315                                                 </figure>
316                                         </listitem>
317                                         <listitem>
318                                                 <para><emphasis role="bold">Create new Evergreen superuser</emphasis> </para>
319                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system, create the new user <emphasis role="bold"> evergreen </emphasis>:</para>
320                                                 <figure>
321                                                         <title>Commands to create the 'evergreen' user</title>
322                                                         <screen>
323                                                         # create superuser 'evergreen' and set the password
324                                                         $ su - postgres
325                                                         $ createuser -P -s evergreen
326                                                         Enter password for new role:  mynewpassword
327                                                         Enter it again:  mynewpassword
328                                                         </screen>
329                                                 </figure>
330                                         </listitem>
331                                 </orderedlist>
332                         </section>
333                         <section>
334                                 <title>Create Database Schema</title>
335                                 <para>As the <emphasis role="bold">root</emphasis> user, create the database schema and configure your system with the corresponding database authentication details for the database user 'evergreen' that you created in the previous step.</para>
336                                 <para>Enter the commands and replace <emphasis>[HOSTNAME], [PORT], [USER], [PASSWORD]</emphasis> and <emphasis>[DATABASENAME]</emphasis> with appropriate values.</para>
337                                 <para>On most systems <emphasis>[HOSTNAME]</emphasis> will be <emphasis role="bold">localhost</emphasis>, and <emphasis>[PORT]</emphasis> will be <emphasis role="bold">5432</emphasis>.</para>
338                                 <figure>
339                                         <title>Commands to create Evergreen database schema</title>
340                                         <screen>
341                                         $ su - root
342                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
343                                         $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
344                                                 --service all --create-schema --create-bootstrap --create-offline \
345                                                 --hostname [HOSTNAME] --port [PORT] \
346                                                 --user [USER] --password [PASSWORD] --database [DATABASENAME]
347                                         </screen>
348                                 </figure>
349                                 <note>
350                                         <para>
351                                                 <emphasis>If you are entering the above command on a single line, do not include the <emphasis><emphasis role="bold">\</emphasis></emphasis> (backslash) characters. If you are using the <emphasis role="bold"> bash </emphasis> shell, these should only be used at the end of a line at a bash prompt to indicate that the command is continued on the next line.</emphasis>
352                                         </para>
353                                 </note>
354                         </section>
355                         <section>
356                                 <title>Configure the Apache Server</title>
357                                 <para>As the <emphasis role="bold">root</emphasis> user, configure the Apache server and copy several new configuration files to the Apache server directories:</para>
358                                 <figure>
359                                         <title>Commands to configure the Apache server</title>
360                                         <screen>
361                                         # configure the Apache server
362                                         $ su - root
363                                         $ a2enmod ssl        # enable mod_ssl
364                                         $ a2enmod rewrite    # enable mod_rewrite
365                                         $ a2enmod expires    # enable mod_expires
366                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
367
368                                         # copy files
369                                         $ cp Open-ILS/examples/apache/eg.conf       /etc/apache2/sites-available/
370                                         $ cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/
371                                         $ cp Open-ILS/examples/apache/startup.pl    /etc/apache2/
372                                         </screen>
373                                 </figure>
374                         </section>
375                         <section>
376                                 <title>Create a Security Certificate (SSL Key)</title>
377                                 <para>Use the command <emphasis role="bold"> openssl </emphasis> to create a new SSL key for your Apache server. For a public production server you should configure or purchase a signed SSL certificate, but for now you can just use a self-signed certificate and accept the warnings in the Staff Client and browser during testing and development:</para>
378                                 <figure>
379                                         <title>Commands to create an SSL key</title>
380                                         <screen>
381                                         $ mkdir /etc/apache2/ssl
382                                         $ cd /etc/apache2/ssl
383                                         $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
384                                         </screen>
385                                 </figure>
386                                 <warning>
387                                         <para>
388                                                 <emphasis> This is only a temporary measure to expedite testing. You <emphasis role="bold"> must </emphasis> get a proper SSL certificate for a public production system. See this section for further comments on setting up a properly signed SSL certificate: </emphasis>
389                                         </para>
390                                 </warning>
391                                 <para> [[ ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE ]] </para>
392                         </section>
393                         <section>
394                                 <title>Modify the Apache Configuration File</title>
395                                 <para>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/sites-available/eg.conf</emphasis> and make the following changes:</para>
396                                 <itemizedlist>
397                                         <listitem>
398                                                 <para>Comment out the line <emphasis role="bold">Allow from 10.0.0.0/8</emphasis>, then uncomment the line <emphasis role="bold">Allow from all</emphasis>.</para>
399                                                 <para>
400                                                         <emphasis>This change allows access to your configuration CGI scripts from <emphasis role="bold">any</emphasis> workstation on <emphasis role="bold">any</emphasis> network. It is a temporary change to expedite testing and should be removed after you have finished and successfully tested the Evergreen installation.</emphasis>
401                                                 </para>
402                                                 <warning>
403                                                         <para>
404                                                                 <emphasis>You must remove these changes after testing is completed. See the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-postinstallation"> "Post-Installation Chores" </link></emphasis></emphasis> for further details on removing this change after the Evergreen installation is complete.</emphasis>
405                                                         </para>
406                                                 </warning>
407                                         </listitem>
408                                         <listitem>
409                                                 <para>Comment out the line <emphasis role="bold">Listen 443</emphasis> as it conflicts with the same declaration in the configuration file: <emphasis role="bold">/etc/apache2/ports.conf</emphasis> . Debian <emphasis>etch</emphasis> users should not do this.</para>
410                                                 <para> [[ ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS ]] </para>
411                                         </listitem>
412                                         <listitem>
413                                                 <para>The following updates are needed to allow the logs to function properly, but it may break other Apache applications on your server. We hope to make this unnecessary soon.</para>
414                                                 <para> [[ ADD INFO ON WHETHER THIS IS STILL NECESSARY ]] </para>
415                                                 <orderedlist>
416                                                         <listitem>
417                                                                 <para>For the Linux distributions <emphasis>Ubuntu Hardy</emphasis> or <emphasis>Debian Etch</emphasis>, as the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis role="bold"> /etc/apache2/apache2.conf </emphasis> and change the user:</para>
418                                                                 <screen>www-data</screen>
419                                                                 <para>to the user:</para>
420                                                                 <screen>opensrf</screen>
421                                                         </listitem>
422                                                         <listitem>
423                                                                 <para>For the Linux distributions <emphasis>Ubuntu Karmic</emphasis> or <emphasis>Ubuntu Lucid</emphasis> or <emphasis>Debian Lenny</emphasis>, as the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis role="bold">/etc/apache2/envvars </emphasis> and change the phrase:</para>
424                                                                 <screen>export APACHE_RUN_USER=www-data</screen>
425                                                                 <para>to the phrase:</para>
426                                                                 <screen>export APACHE_RUN_USER=opensrf</screen>
427                                                         </listitem>
428                                                 </orderedlist>
429                                         </listitem>
430                                         <listitem>
431                                                 <para>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/apache2.conf</emphasis> and add the line <emphasis role="bold">KeepAliveTimeout 1</emphasis>, or modify an existing line if it already exists.</para>
432                                         </listitem>
433                                 </itemizedlist>
434                         </section>
435                         <section>
436                                 <title>(OPTIONAL) Performance Modifications for Apache</title>
437                                 <para>Some further configuration changes to Apache may be necessary for busy systems. These changes increase the number of Apache server processes that can be started to support additional browser connections, and are made to the <emphasis>prefork configuration</emphasis> section of the Apache configuration file.</para>
438                                 <itemizedlist>
439                                         <listitem>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/apache2.conf</emphasis> and add the line <emphasis role="bold">MaxKeepAliveRequests 100</emphasis>, or modify an existing line if it already exists.</listitem>
440                                         <listitem>
441                                                 <para>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/apache2.conf</emphasis>, locate and modify the section related to <emphasis>prefork configuration</emphasis> to suit the load on your system.</para>
442                                                 <figure>
443                                                         <title>(OPTIONAL) Updates to Apache configuration</title>
444                                                         <screen>
445                                                         &lt;IfModule mpm_prefork_module>
446                                                            StartServers           20
447                                                            MinSpareServers         5
448                                                            MaxSpareServers        15
449                                                            MaxClients            150
450                                                            MaxRequestsPerChild 10000
451                                                         &lt;/IfModule>
452                                                         
453                                                         MaxKeepAliveRequests 100
454                                                         </screen>
455                                                 </figure>
456                                         </listitem>
457                                 </itemizedlist>
458                         </section>
459                         <section>
460                                 <title>Enable the Evergreen Site</title>
461                                 <para>You must run additional Apache configuration commands to enable the Evergreen web site. As the <emphasis role="bold">root</emphasis> user, run these commands:</para>
462                                 <figure>
463                                         <title>Apache Commands to Enable the Evergreen Web Site</title>
464                                         <screen>
465                                         $ su - root
466
467                                         # disables the default site (i.e., the "It Works" page).
468                                         $ a2dissite default
469
470                                         # enables the Evergreen web site
471                                         $ a2ensite eg.conf
472                                         </screen>
473                                 </figure>
474                         </section>
475                         <section>
476                                 <title>Modify the OpenSRF Configuration File</title>
477                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, edit the OpenSRF configuration file <emphasis>/openils/conf/opensrf_core.xml</emphasis> to update various usernames and passwords, and to specify the domains from which we will accept and to which we will make connections.</para>
478                                 <para>If you are installing Evergreen on a single server and using the <emphasis> private.localhost </emphasis> / <emphasis> public.localhost </emphasis> domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values.</para>
479                                 <note>
480                                         <para>
481                                                 <emphasis>The following example uses common XPath syntax on the left-hand side to indicate the aproximage position needing changes within the XML file.</emphasis>
482                                         </para>
483                                 </note>
484                                 <para>[[ ADD A BETTER DIAGRAM HERE ]]</para>
485                                 <figure>
486                                         <title>Updates needed to the file "/openils/conf/opensrf_core.xml"</title>
487                                         <screen>
488                                         /config/opensrf/username  = opensrf
489
490                                         /config/opensrf/passwd    = password for "private.localhost" opensrf user
491
492                                         /config/gateway/username  = opensrf
493
494                                         /config/gateway/passwd    = password for "public.localhost" opensrf user
495
496                                         # first entry, where "transport/server" == "public.localhost" :
497                                         /config/routers/router/transport 
498                                             username = router
499                                             password = password for "public.localhost" router user
500                                         # second entry, where "transport/server" == "private.localhost" :
501                                         /config/routers/router/transport
502                                             username = router
503                                             password = password for "private.localhost" router user
504                                         </screen>
505                                 </figure>
506                         </section>
507                         <section>
508                                 <title>Create Configuration Files for Users Needing srfsh</title>
509                                 <para>The software installation will automatically create a utility named <emphasis>srfsh</emphasis> (surf shell). This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-testing"> "Testing the Installation" </link></emphasis></emphasis> for further information.</para>
510                                 <para>In this step you will set up a special configuration file for each user who will need to run the utility. Copy the short sample configuration file <emphasis>/openils/conf/srfsh.xml.example</emphasis> to the file <emphasis>.srfsh.xml</emphasis> (note the leading dot!) in the home directory of each user who will use <emphasis role="bold">srfsh</emphasis>. Finally, edit each file <emphasis>.srfsh.xml</emphasis> and make the following changes:</para>
511                                 <itemizedlist>
512                                         <listitem>Modify <emphasis role="bold">domain</emphasis> to be the router hostname (following our domain examples, <emphasis role="bold">private.localhost</emphasis> will give the utility <emphasis role="bold">srfsh</emphasis> access to all OpenSRF services, while <emphasis role="bold">public.localhost</emphasis> will only allow access to those OpenSRF services that are publicly exposed).</listitem>
513                                         <listitem>Modify <emphasis role="bold">username</emphasis> and <emphasis role="bold">password</emphasis> to match the <emphasis role="bold">opensrf</emphasis> Jabber user for the chosen domain</listitem>
514                                         <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
515                                         <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
516                                 </itemizedlist>
517                                 <figure>
518                                         <title>Sample of configuration file /openils/conf/srfsh.xml.example</title>
519                                         <screen>
520                                         &lt;?xml version="1.0"?>
521                                         &lt;!-- This file follows the standard bootstrap config file layout -->
522                                         &lt;!-- found in opensrf_core.xml -->
523                                         &lt;srfsh>
524                                         &lt;router_name>router&lt;/router_name>
525                                         &lt;domain>private.localhost&lt;/domain>
526                                         &lt;username>opensrf&lt;/username>
527                                         &lt;passwd>evergreen&lt;/passwd>
528                                         &lt;port>5222&lt;/port>
529                                         &lt;logfile>/tmp/srfsh.log&lt;/logfile>
530                                         &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
531                                         &lt;loglevel>4&lt;/loglevel>
532                                         &lt;/srfsh>
533                                         </screen>
534                                 </figure>
535                         </section>
536                         <section>
537                                 <title>Modify the OpenSRF Environment</title>
538                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change the file permissions of the directory <emphasis>/openils/var/cgi-bin</emphasis> to <emphasis>executable</emphasis>, then modify the shell configuration file <emphasis>~/.bashrc</emphasis> of that user by adding a Perl environmental variable. Finally, execute the shell configuration file to load the new variables into your current environment.</para>
539                                 <note>
540                                         <para>
541                                                 <emphasis>In a multi-server environment, you must add any modifications to <emphasis role="bold">~/.bashrc</emphasis> to the top of the file <emphasis>before</emphasis> the line <emphasis role="bold"> [ -z "$PS1" ] &amp;&amp; return</emphasis>. This will allow headless (scripted) logins to load the correct environment.</emphasis>
542                                         </para>
543                                 </note>
544                                 <figure>
545                                         <title>Modify the OpenSRF environment</title>
546                                         <screen>
547                                         # change permissions
548                                         $ su - opensrf
549                                         $ chmod 755 /openils/var/cgi-bin/*.cgi
550
551                                         # add environmental variable
552                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
553
554                                         # inherit the new environment
555                                         $ . ~/.bashrc
556                                         </screen>
557                                 </figure>
558                         </section>
559                         <section xml:id="serversideinstallation-localization">
560                                 <title>(OPTIONAL) Configuration for Other Languages</title>
561                                 <para>This section describes how translations such as Armenian (hy-AM), Canadian French (fr-CA) and others are loaded into the database to complete the translations (default English) available in the OPAC and Staff Client.</para>
562                                 <para> [[ ADD SECTION ON LANGUAGE LOCALIZATION ]] </para>
563                         </section>
564                 </section>
565                 <section xml:id="serversideinstallation-starting">
566                         <title>Starting Evergreen</title>
567                         <orderedlist>
568                                 <listitem>
569                                         <para>As the <emphasis role="bold">root</emphasis> user, start the memcached and ejabberd services (if they aren't already running):</para>
570                                         <figure>
571                                                 <title>Start some services</title>
572                                                 <screen>
573                                                 $ su - root
574                                                 $ /etc/init.d/ejabberd start
575                                                 $ /etc/init.d/memcached start
576                                                 </screen>
577                                         </figure>
578                                 </listitem>
579                                 <listitem>
580                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, start Evergreen.</para>
581                                         <para>Use the flag <emphasis>-l</emphasis> to force Evergreen to use <emphasis>localhost</emphasis> (your current system) as the hostname.</para>
582                                         <figure>
583                                                 <title>Start Evergreen</title>
584                                                 <screen>
585                                                 $ su - opensrf
586
587                                                 # ensure you have the needed path
588                                                 $ export PATH=$PATH:/openils/bin
589
590                                                 # start the server;
591                                                 # use "-l" to force hostname to be "localhost"
592                                                 $ osrf_ctl.sh -l -a start_all     
593                                                 </screen>
594                                         </figure>
595                                         <note>
596                                                 <para>
597                                                         <emphasis> You can also start Evergreen <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but the utility <emphasis> osrf_ctl.sh</emphasis> must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <emphasis>opensrf.xml</emphasis>, which you configured in a previous step.</emphasis>
598                                                 </para>
599                                         </note>
600                                         <para>[[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]]</para>
601                                         <para>Execute the following command to determine the fully qualified domain name of your system:</para>
602                                         <figure>
603                                                 <title>(OPTIONAL) Determine the fully qualified domain name</title>
604                                                 <screen>
605                                                 $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
606                                                 </screen>
607                                         </figure>
608                                         <itemizedlist>
609                                                 <listitem>When you attempt to start Evergreen, if you receive an error message similar to <emphasis>osrf_ctl.sh: command not found</emphasis>, then your environment variable <emphasis role="bold">PATH</emphasis> does not include the directory <emphasis>/openils/bin</emphasis>. As the <emphasis role="bold">opensrf</emphasis> user, edit the configuration file <emphasis>/home/opensrf/.bashrc</emphasis> and add the following line: <emphasis role="bold"><screen>export PATH=$PATH:/openils/bin</screen></emphasis></listitem>
610                                                 <listitem>When you attempt to start Evergreen, if you receive an error message similar to <emphasis>Can't locate OpenSRF/System.pm in @INC ... BEGIN failed--compilation aborted</emphasis>, then your environment variable <emphasis role="bold">PERL5LIB</emphasis> does not include the directory <emphasis>/openils/lib/perl5</emphasis>. As the <emphasis role="bold">opensrf</emphasis> user, edit the configuration file <emphasis>/home/opensrf/.bashrc</emphasis> and add the following line: <emphasis role="bold"><screen>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</screen></emphasis></listitem>
611                                         </itemizedlist>
612                                 </listitem>
613                                 <listitem>
614                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, generate the Web files needed by the Staff Client and catalogue, and calculate the proximity of locations in the Organizational Unit tree (which allows <emphasis>Holds</emphasis> to work properly).</para>
615                                         <para>You must do this the first time you start Evergreen, and after any time you change the library hierarchy in the configuration file <emphasis>config.cgi</emphasis>.</para>
616                                         <figure>
617                                                 <title>Generate web files</title>
618                                                 <screen>
619                                                 $ su - opensrf
620                                                 $ cd /openils/bin
621                                                 $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u
622                                                 Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
623
624                                                 Updating fieldmapper
625                                                 Exception: OpenSRF::EX::Session 2010-04-16T06:31:38 OpenSRF::Utils::SettingsClient /usr/local/share/perl/5.10.0/OpenSRF/Utils/SettingsClient.pm:103 Session Error: router@private.localhost/opensrf.settings IS NOT CONNECTED TO THE NETWORK!!!
626                                                 </screen>
627                                                 <para>[[ ADD RESULTS OF TESTS FROM "autogen.sh" ]]</para>
628                                         </figure>
629                                 </listitem>
630                                 <listitem>
631                                         <para>As the <emphasis role="bold">root</emphasis> user, restart the Apache Web server:</para>
632                                         <figure>
633                                                 <title>Generate web files</title>
634                                                 <screen>
635                                                 $ su - root
636                                                 $ /etc/init.d/apache2 restart
637                                                 </screen>
638                                         </figure>
639                                         <para>If the Apache Web server was running when you started the OpenSRF services, you might not be able to successfully log in to the OPAC or Staff Client until the Apache Web server is restarted.</para>
640                                 </listitem>
641                         </orderedlist>
642                 </section>
643                 <section xml:id="serversideinstallation-testing">
644                         <title>Testing the Installation</title>
645                         <para>This section describes several simple tests you can perform to verify that the Evergreen server-side software has been installed and configured properly and is running as expected.</para>
646                         <section xml:id="serversideinstallation-testing-connections">
647                                 <title>Testing Connections to Evergreen</title>
648                                 <para>Once you have installed and started Evergreen, test your connection to Evergreen. As the <emphasis role="bold">opensrf</emphasis> user start the utility <emphasis>srfsh</emphasis> and try logging onto the Evergreen server using the default administrator username and password. Following is sample output generated by executing that script after a successful Evergreen installation:</para>
649                                 <figure>
650                                         <title>Running the srfsh utility</title>
651                                         <screen>
652                                         $ su - opensrf
653                                         $ /openils/bin/srfsh
654                                         srfsh% login admin open-ils
655                                         Received Data: "250bf1518c7527a03249858687714376"
656                                         ------------------------------------
657                                         Request Completed Successfully
658                                         Request Time in seconds: 0.045286
659                                         ------------------------------------
660                                         Received Data: {
661                                            "ilsevent":0,
662                                            "textcode":"SUCCESS",
663                                            "desc":" ",
664                                            "pid":21616,
665                                            "stacktrace":"oils_auth.c:304",
666                                            "payload":{
667                                               "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
668                                               "authtime":420
669                                            }
670                                         }
671                                         ------------------------------------
672                                         Request Completed Successfully
673                                         Request Time in seconds: 1.336568
674                                         ------------------------------------
675                                         </screen>
676                                 </figure>
677                                 <para>If this does not work, try other simple troubleshooting steps:</para>
678                                 <itemizedlist>
679                                         <listitem>
680                                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, run the script <emphasis>settings-tester.pl</emphasis> to see if it finds any system configuration problems. Following is sample output generated by executing that script after a successful Evergreen installation:</para>
681                                                 <para>[[ MAY NEED TO REWORK THIS DIAGRAM TO USE SAME IMAGE STANDARDS AS OTHER CHAPTERS ]]</para>
682                                                 <figure>
683                                                         <title>Executing the script <emphasis> settings-test.pl</emphasis></title>
684                                                         <mediaobject>
685                                                                 <imageobject>
686                                                                         <imagedata fileref="../media/serversideinstallation-testing-1.png" scalefit="1" width="100%"/>
687                                                                 </imageobject>
688                                                         </mediaobject>
689                                                         <mediaobject>
690                                                                 <imageobject>
691                                                                         <imagedata fileref="../media/serversideinstallation-testing-2.png" scalefit="1" width="100%"/>
692                                                                 </imageobject>
693                                                         </mediaobject>
694                                                 </figure>
695                                                 <para>If the output from the script does not help you find the problem, please do not make any further significant changes to your configuration. Follow the steps in the troubleshooting guide, <emphasis><emphasis role="bold"><link linkend="troubleshooting"> "Troubleshooting" </link></emphasis></emphasis> .</para>
696                                         </listitem>
697                                         <listitem>If you have followed the entire set of installation steps listed here closely, you are probably extremely close to a working system. Gather your configuration files and log files and contact the [[ http://open-ils.org/listserv.php|Evergreen development mailing list ]] for assistance before making any drastic changes to your system configuration.</listitem>
698                                 </itemizedlist>
699                         </section>
700                         <section xml:id="serversideinstallation-testing-opac">
701                                 <title>Testing the Catalog</title>
702                                 <para>By default, the OPAC will live at the URL <emphasis>http://my.domain.com/opac/</emphasis>.</para>
703                                 <para>Navigate to this URL and the front page of the OPAC should load. There is a basic text entry field with some extra search options. If you have any problems loading this page, check the Apache error logs. If the page loads but does not function correctly, then check for possible javascript errors. We hightly reccommend testing with the <emphasis>Firefox</emphasis> browser because of the helpful javascript debugging tools.</para>
704                                 <para>Assuming that the OPAC is functioning and there is data in your database, you can now perform other simple functional tests (e.g., searching the catalog).</para>
705                                 <para>[[ ADD OTHER SIMPLE FUNCTIONAL TESTS ]]</para>
706                         </section>
707                         <section xml:id="serversideinstallation-testing-othersrfsh">
708                                 <title>Other Tests with srfsh</title>
709                                 <para>There is also a <emphasis>srfsh</emphasis> command called <emphasis>math_bench</emphasis> that sends queries to the math servers. Note that opensrf.math and opensrf.dbmath must be running for this command to work:</para>
710                                 <screen>
711                                 srfsh# math_bench 10
712                                 |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
713                                 ++++++++++++++++++++++++++++++++++++++++
714                                 Average round trip time: 0.033425
715                                 srfsh#
716                                 </screen>
717                                 <para>The first argument is how many sets of 4 queries (+ - * /) are sent to <emphasis>opensrf.math</emphasis>. When the response is successful, you will see the string of "+" symbols. If the system is not running correctly, you will either get an exception or no result at all.</para>
718                                 <para>For other srfsh commands, type 'help' in at the prompt.</para>
719                         </section>
720                 </section>
721                 <section xml:id="serversideinstallation-postinstallation">
722                         <title>Post-Installation Chores</title>
723                         <itemizedlist>
724                                 <listitem>
725                                         <para>As the <emphasis role="bold">root</emphasis> user, edit the Apache configuration file <emphasis>/etc/apache2/sites-available/eg.conf</emphasis> again and make the following change:</para>
726                                         <para>Uncomment the line <emphasis role="bold">Allow from 10.0.0.0/8</emphasis>, then comment out the line <emphasis role="bold">Allow from all</emphasis>. You modified this file earlier in step <emphasis role="bold">5.1.15</emphasis> as a temporary measure to expedite testing. Those changes must now be reversed in order to deny access to your CGI scripts by other public networks. You <emphasis role="bold"> must </emphasis> secure this for a public production system, preferably by explicitly specifying the allowed IP addresses and adding proper authentication.</para>
727                                 </listitem>
728                                 <listitem>
729                                         <warning>
730                                                 <para>
731                                                         <emphasis>This is only a temporary measure to expedite testing. You <emphasis role="bold"> must </emphasis> get a proper SSL certificate for a public production system. See this section for further comments on setting up a properly signed SSL certificate: </emphasis>
732                                                 </para>
733                                         </warning>
734                                         <para> [[ ADD EXPLANATION OF HOW TO GET A SIGNED SSL CERTIFICATE ]] </para>
735                                 </listitem>
736                         </itemizedlist>
737                 </section>
738                 <section xml:id="serversideinstallation-running-staffclient">
739                         <title>Running the Staff Client on Linux</title>
740                         <para>Run the Evergreen Staff Client on a Linux system by using the application <emphasis>XULRunner</emphasis> (installed automatically and by default with Firefox version 3.0 and later on Ubuntu and Debian distributions).</para>
741                         <para>For example, if the source files for the Evergreen installation are in the directory <emphasis>/home/opensrf/Evergreen-ILS-1.6.0.7/</emphasis>, start the Staff Client as shown in the following command example:</para>
742                         <figure>
743                                 <title>Running the Linux Staff Client</title>
744                                 <screen>
745                                 $ su - opensrf
746                                 $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
747                                 </screen>
748                         </figure>
749                 </section>
750                 <section xml:id="serversideinstallation-starting-apache-server">
751                         <title>Starting the Apache Web Server</title>
752                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>
753                         <para>As the <emphasis role="bold">root</emphasis> user, execute the following commands. Note the use of <emphasis>restart</emphasis> to force the new Evergreen modules to be reloaded even if the Apache server is already running. Any problems found with your configuration files should be displayed:</para>
754                         <figure>
755                                 <title>Start the Apache Web Server</title>
756                                 <screen>
757                                 $ su - root
758                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart
759                                 </screen>
760                         </figure>
761                 </section>
762                 <section xml:id="serversideinstallation-stopping">
763                         <title>Stopping the Evergreen Services</title>
764                         <para>As the <emphasis role="bold">opensrf</emphasis> user, stop all Evergreen services by using the following command:</para>
765                         <figure>
766                                 <title>Stop all Evergreen services</title>
767                                 <screen>
768                                 $ su - opensrf
769
770                                 # stop the server:
771                                 # use "-l" to force hostname to be "localhost"
772                                 $ osrf_ctl.sh -l -a stop_all
773                                 </screen>
774                         </figure>
775                         <note>
776                                 <para>
777                                         <emphasis> You can also stop Evergreen services <emphasis role="bold">without</emphasis> the <emphasis>-l</emphasis> flag, but the utility <emphasis> osrf_ctl.sh</emphasis> must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file <emphasis>opensrf.xml</emphasis>, which you configured in a previous step.</emphasis>
778                                 </para>
779                         </note>
780                         <para>[[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]]</para>
781                 </section>
782                 <section xml:id="serversideinstallation-reports">
783                         <title>Setting Up Support For Reports</title>
784                         <para>Evergreen reports are extremely powerful, but some configuration is required. See the section <emphasis><emphasis role="bold"><link linkend="report-introduction"> "Reports" </link></emphasis></emphasis> for details.</para>
785                 </section>
786                 <section xml:id="serversideinstallation-starting-reporter-daemon">
787                         <title>Starting the Reporter Daemon</title>
788                         <para>Once the <emphasis>open-ils.reporter</emphasis> process is running and enabled on the gateway, you can start the reporter daemon. That process periodically checks for requests for new reports or scheduled reports and gets them running.</para>
789                         <para>As the <emphasis role="bold">opensrf</emphasis> user, start the reporter daemon using the following command:</para>
790                         <figure>
791                                 <title>Starting the Reporter Daemon</title>
792                                 <screen>
793                                 $ su - opensrf
794                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/src/reporter
795                                 $ ./clark-kent.pl --daemon
796                                 </screen>
797                         </figure>
798                         <para>You can also specify other options with this utility:</para>
799                         <itemizedlist>
800                                 <listitem>--sleep=interval      : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>
801                                 <listitem>--lockfile=filename   : where to place the lockfile for the process; defaults to <emphasis>/tmp/reporter-LOCK</emphasis></listitem>
802                                 <listitem>--concurrency=integer : number of reporter daemon processes to run; defaults to "1"</listitem>
803                                 <listitem>--boostrap=filename   : OpenSRF bootstrap configuration file; defaults to <emphasis>/openils/conf/opensrf_core.xml</emphasis></listitem>
804                         </itemizedlist>
805                 </section>
806                 <section xml:id="serversideinstallation-stopping-reporter-daemon">
807                         <title>Stopping the Reporter Daemon</title>
808                         <para>To stop the Reporter daemon, you must kill the process and remove the lockfile. The daemon may have just a single associated process, with a lockfile in the default location.</para>
809                         <note>
810                                 <para>
811                                         <emphasis> It is possible that several processes are running; see the optional commands in the previous section. As the <emphasis role="bold">opensrf</emphasis> user, perform the following commands to stop the Reporter daemon:</emphasis>
812                                 </para>
813                         </note>
814                         <figure>
815                                 <title>Stopping the Reporter Daemon</title>
816                                 <screen>
817                                 $ su - opensrf
818                                 # find and kill the process ID number(s)
819                                 $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
820                                 # remove the lock file
821                                 $ rm /tmp/reporter-LOCK
822                                 </screen>
823                         </figure>
824                 </section>
825         </section>
826         <section xml:id="serversideinstallation-opensrf">
827                 <title>Installing OpenSRF</title>
828                 <para>[[ Installing OpenSRF 1.2.2 ]]</para>
829         </section>
830         <section xml:id="serversideinstallation-otherlinux">
831                 <title>Installing Evergreen On Other Linux Systems</title>
832                 <para>[[ Installing on Other Linux Systems ]]</para>
833         </section>
834         <section xml:id="serversideinstallation-virtual">
835                 <title>Installing Evergreen in Virtualized Unix Environments</title>
836                 <para>Evergreen software currently runs as a native application on any of several well-known Linux distributions (e.g., <emphasis>Ubuntu</emphasis> and <emphasis>Debian</emphasis>). It does not run as a native application on the Windows operating system (e.g., WindowsXP, WindowsXP Professional, Windows7), but the software can be installed and run on Windows via a virtualized Unix-guest Operating System (using, for example, VirtualBox or VMware to emulate a Linux environment). More information on virtualized environments can be found in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-virtual">"Installing Evergreen in Virtualized Unix Environments"</link></emphasis></emphasis>.</para>
837                 <para>[[ Installing Evergreen in Virtualized Unix Environments ]]</para>
838                 <section xml:id="serversideinstallation-virtualized-virtualbox">
839                         <title>VirtualBox</title>
840                         <para>[[ VirtualBox ]]</para>
841                 </section>
842                 <section xml:id="serversideinstallation-virtualized-vmware">
843                         <title>VMware</title>
844                         <para>[[ VMware ]]</para>
845                 </section>
846                 <section xml:id="serversideinstallation-virtualized-virtualpc">
847                         <title>VirtualPC</title>
848                         <para>[[ VirtualPC ]]</para>
849                 </section>
850         </section>
851         <section xml:id="serversideinstallation-previousversions">
852                 <title>Installing Previous Versions of Evergreen</title>
853                 <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>
854                 <section xml:id="serversideinstallation-ubuntudebian-previous">
855                         <title>Installing Evergreen 1.4.0.6 on Ubuntu or Debian</title>
856                         <para>[[ Installing Evergreen 1.4.0.6 on Ubuntu or Debian ]]</para>
857                 </section>
858                 <section xml:id="serversideinstallation-opensrf-previous">
859                         <title>Installing OpenSRF 1.0.x</title>
860                         <para>[[ Installing OpenSRF 1.0.x ]]</para>
861                 </section>
862         </section>
863         <section xml:id="serversideinstallation-organizationandpolicy">
864                 <title>Organization and Policy Editing</title>
865                 <para>[[ Organization and Policy Editing ]] </para>
866         </section>
867         <section xml:id="serversideinstallation-staffclient">
868                 <title>Installing the Staff Client</title>
869                 <para>[[ Installing the Staff Client ]]</para>
870         </section>
871         <section xml:id="serversideinstallation-sip">
872                 <title>Installing the SIP Server</title>
873                 <para>[[ Installing the SIP Server ]]</para>
874         </section>
875         <section xml:id="serversideinstallation-nginx">
876                 <title>Using nginx to serve static content</title>
877                 <para>[[ Using nginx to serve static content ]]</para>
878         </section>
879 </chapter>