]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
reorganize ordering of some chapters;
[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 and its associated components. Installation, configuration, testing and verification of the software is straightforward if you follow some simple directions.</para>
7                 </abstract>
8         </info>
9         <section xml:id="serversideinstallation-overview">
10                 <title>Overview</title>
11                 <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current stable software release. See the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-ubuntudebian"> "Installing Evergreen On Ubuntu or Debian" </link></emphasis></emphasis> for instructions tailored to installing on some particular distributions of the Linux operating system. Earlier software distributions are described in the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-previousversions"> "Installing Previous Versions of Evergreen" </link></emphasis></emphasis>.</para>
12                 <para>Current versions of the Evergreen server-side 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, or VirtualPC to emulate a Linux environment). It can also be installed and run on other Linux systems via virtualized environments (using, for example, VirtualBox or VMware). 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>
13                 <para>Installation of some sub-components of the Evergreen server-side software is mentioned only in abbreviated form in this section. More detailed information is available in the accompanying sections:
14 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-opensrf"> "OpenSRF" </link></emphasis></emphasis>, 
15 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-postgresql"> "PostgreSQL Database" </link></emphasis></emphasis>, 
16 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-apache"> "Apache" </link></emphasis></emphasis> and
17 <emphasis><emphasis role="bold"><link linkend="serversideinstallation-memcached"> "memcached Servers" </link></emphasis></emphasis>.
18                 </para>
19                 <para>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>
20                 <section>
21                         <title>Current Stable Software Release</title>
22                         <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> .
23                         </para>
24                         <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> .
25                         </para>
26                 </section>
27                 <section>
28                         <title>Previous Software Releases</title>
29                         <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>
30                         <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> .
31                         </para>
32                         <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> .
33                         </para>
34                 </section>
35                 <section>
36                         <title>System Requirements</title>
37                         <para>This section describes various requirements of the hardware and software environment that must be fulfilled to support a successful Evergreen installation. 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>
38                         <para> [[ ADD FURTHER CONTENT ON HARDWARE AND SOFTWARE REQUIREMENTS ]] </para>
39                         <para>
40                                 <screen>
41                                 From Dan Scott on [http://list.georgialibraries.org/pipermail/
42                                   open-ils-general/2007-July/000316.html|OPEN-ILS-GENERAL]:
43                                 On 8/11/07, lan ye &lt;lye at mail.slcl.org> wrote:
44                                 > We've been researching the Evergreen Open Source Library system,
45                                 > and would like to have a list of hardware requirements for the
46                                 > installation of a small test server. To keep things within a
47                                 > small budget, I would like to just use an ordinary PC. Could you
48                                 > send some information to us?
49         
50                                 For system requirements, it depends on how extensive you want your
51                                 tests to be. Evergreen and all of the pieces it depends on
52                                 (PostgreSQL, Apache, Ejabberd) run happily in a VMWare image
53                                 allocated 512MB of RAM on my laptop with just the Project
54                                 Gutenberg e-books loaded, and that's enough to evaluate the OPAC
55                                 interface / try out the staff client / make some local changes and
56                                 generally experiment. But I'm not going to load one million bib
57                                 records into that system and expect it to perform. So, probably
58                                 any hardware you have lying around would be adequate for a small
59                                 test server.
60         
61                                 > It looks like Evergreen has been successfully installed on two
62                                 > Linux systems: Gentoo and Ubuntu. Which one is the best for us
63                                 > to test using what's already in place at other libraries? Are
64                                 > there any differences / Advantages in functionality between
65                                 > Gentoo and Ubuntu?
66         
67                                 As John said, GPLS is running on Debian, and that's the only
68                                 Evergreen system that is in production at the moment. However, the
69                                 documentation for installing on Debian is a bit scattered right
70                                 now. The developers themselves used Gentoo originally, and that's
71                                 what I'm using at the moment &amp; have documented in the wiki;
72                                 the install process on Ubuntu is very thoroughly documented and
73                                 Ubuntu is reasonably close to Debian.  
74                                 See http://open-ils.org/dokuwiki/doku.php?id=server_installation 
75                                 for the list of install instructions for various distributions.
76         
77                                 As for advantages / disadvantages of particular distributions,
78                                 that's a religious war that I don't want to step into... We'll try
79                                 to help you out no matter what distribution you choose; just
80                                 please choose a current release :)
81         
82                                 -- 
83                                 Dan Scott
84                                 Laurentian University
85                                 </screen>
86                                 <screen>
87                                 And from James Fournie in that same [http://list.georgialibraries.org/
88                                   pipermail/open-ils-general/2007-July/000317.html|thread]:
89                                 We are running a test Ubuntu server on a ~1ghz Celeron PC with
90                                 512mb RAM.  It seems to be ok handling the Gutenberg samples, and
91                                 our collection of about 8000 records. We did have serious problems
92                                 using anything less than 512mb RAM. Also, I tried Evergreen on a
93                                 K6 II 350, but it wasn't pretty.
94         
95                                 James Fournie
96                                 Digitization Librarian
97                                 Union of B.C. Indian Chiefs
98                                 </screen>
99                         </para>
100                 </section>
101                 <section>
102                         <title>Example System Architectures</title>
103                         <para>This sections describes examples of some working Evergreen system architectures, including both server-side software and Staff Client software.</para>
104                         <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>
105                         <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>
106                         <section xml:id="serversideinstallation-example-pines">
107                                 <title>PINES</title>
108                                 <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>
109                                 <para>[[ ADD FURTHER INFORMATION ON PINES ]] </para>
110                         </section>
111                         <section xml:id="serversideinstallation-example-sitka">
112                                 <title>Sitka</title>
113                                 <para>[[ ADD FURTHER INFORMATION ON SITKA ]] </para>
114                         </section>
115                         <section xml:id="serversideinstallation-example-other">
116                                 <title>Other working systems</title>
117                                 <para>[[ ADD FURTHER INFORMATION ON OTHER WORKING SYSTEMS ]] </para>
118                         </section>
119                 </section>
120         </section>
121         <section xml:id="serversideinstallation-ubuntudebian">
122                 <title>Installing Evergreen On Ubuntu or Debian</title>
123                 <para>This section outlines the installation process for the latest stable version of Evergreen (1.6.0.7).</para>
124                 <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>
125                 <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>
126                 <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>
127                 <para/>
128                 <note>
129                         <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>
130                         <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>
131                         <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>
132                 </note>
133                 <section xml:id="serversideinstallation-opensrf-overview">
134                         <title>Installing OpenSRF</title>
135                         <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>
136                         <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>
137                 </section>
138                 <section>
139                         <title>Download and Unpack Latest Evergreen Version</title>
140                         <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>
141                         <para>[[ VERIFY LOCATION OF LATEST VERSION OF EVERGREEN ]]</para>
142                         <figure>
143                                 <title>Commands to download/extract Evergreen</title>
144                                 <screen>
145                                 $ su - opensrf
146                                 $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz
147                                 $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz
148                                 </screen>
149                         </figure>
150                 </section>
151                 <section>
152                         <title>Install Prerequisites to Build Evergreen</title>
153                         <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 using the <emphasis>make</emphasis> utility.</para>
154                         <para>As the <emphasis role="bold">root</emphasis> user, enter the commands show below in <emphasis> Figure 1.3</emphasis> to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[distribution]</emphasis> in the example with the keyword corresponding to the actual Linux distribution listed here:
155                         <figure><title>Keywords used with "make"</title><screen>
156                                         debian-lenny for Debian Lenny (5.0), the most recent version
157                                         debian-etch for Debian Etch (4.0)
158
159                                         ubuntu-karmic for Ubuntu Lucid (10.04) [same as for Karmic]
160                                         ubuntu-karmic for Ubuntu Karmic (9.10)
161                                         ubuntu-intrepid for Ubuntu Intrepid (8.10)
162                                         ubuntu-hardy for Ubuntu Hardy (8.04)
163                                         ubuntu-gutsy for Ubuntu Gutsy (7.10)
164
165                                         gentoo generic for Gentoo versions
166                                         centos generic for Centos versions
167
168                                         [[ ADD INFO FOR OTHER LINUX DISTRIBUTIONS ]]
169                                 </screen></figure></para>
170                         <figure>
171                                 <title>Commands to install prerequisites for Evergreen</title>
172                                 <screen>
173                                 $ su - root
174                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
175                                 $ make -f Open-ILS/src/extras/Makefile.install [distribution]
176                                 </screen>
177                         </figure>
178                 </section>
179                 <section>
180                         <title>(OPTIONAL) Install the PostgreSQL Server</title>
181                         <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>
182                         <para>For further information on installing PostgreSQL, see the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-postgresql"> "Installing PostgreSQL" </link></emphasis></emphasis>.</para>
183                         <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>
184                         <figure>
185                                 <title>Commands to install the PostgreSQL server</title>
186                                 <screen>
187                                 $ su - root
188
189                                 # Debian Lenny and Ubuntu Hardy (8.04)
190                                 $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
191
192                                 # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
193                                 $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
194                                 </screen>
195                         </figure>
196                         <note>
197                                 <para>
198                                         <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>
199                                 </para>
200                         </note>
201                         <para>[[ VERIFY: IS THIS STILL TRUE? ]]</para>
202                         <para>[[ ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE ]]</para>
203                 </section>
204                 <section>
205                         <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
206                         <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>
207                         <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>
208                         <figure>
209                                 <title>Commands to install Perl modules</title>
210                                 <screen>
211                                 # ensure the gcc compiler is installed
212                                 $ su - root
213                                 $ aptitude install gcc
214
215                                 # install the Perl modules
216                                 $ perl -MCPAN -e shell
217                                 cpan> install JSON::XS
218                                 cpan> install MARC::Record
219                                 cpan> install MARC::File::XML
220                                 </screen>
221                         </figure>
222                         <para>[[ ADD INFO ON HOW TO INSTALL THE PERL MODULES ]]</para>
223                         <para>[[ ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED ]]</para>
224                 </section>
225                 <section>
226                         <title>Add Additional Library Paths on Evergreen System</title>
227                         <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>
228                         <figure>
229                                 <title>Commands to modify system dynamic library path</title>
230                                 <screen>
231                                 $ su - root
232                                 $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
233                                 /usr/local/lib
234                                 /usr/local/lib/dbd
235                                 ENDOFFILE
236                                 $ ldconfig
237                                 </screen>
238                         </figure>
239                 </section>
240                 <section>
241                         <title>(OPTIONAL) Restart the PostgreSQL Service</title>
242                         <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>
243                         <para>[[ ADD INFO ON OTHER VERSIONS OF POSTGRESQL ]]</para>
244                         <figure>
245                                 <title>Commands to restart PostgreSQL service</title>
246                                 <screen>
247                                 $ su - root
248                                 $ /etc/init.d/postgresql-8.3 restart
249                                 </screen>
250                         </figure>
251                 </section>
252                 <section>
253                         <title>Configure and Compile Evergreen Sources</title>
254                         <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>
255                         <figure>
256                                 <title>Commands to configure and compile Evergreen</title>
257                                 <screen>
258                                 $ su - opensrf
259                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
260                                 $ ./configure --prefix=/openils --sysconfdir=/openils/conf
261                                 $ make
262                                 </screen>
263                         </figure>
264                 </section>
265                 <section>
266                         <title>Link and Install Evergreen</title>
267                         <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>
268                         <figure>
269                                 <title>Commands to link and install Evergreen</title>
270                                 <screen>
271                                 $ su - root
272                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
273                                 $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_6 install
274                                 $ cd /openils/var/web/xul
275                                 $ ln -sf rel_1_6_0_7/server server
276                                 </screen>
277                         </figure>
278                 </section>
279                 <section>
280                         <title>Copy the OpenSRF Configuration Files</title>
281                         <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>
282                         <figure>
283                                 <title>Commands to copy OpenSRF configuration files</title>
284                                 <screen>
285                                 $ su - root
286                                 $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
287                                 $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
288                                 $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
289                                 $ chown -R opensrf:opensrf /openils/
290                                 </screen>
291                         </figure>
292                 </section>
293                 <section>
294                         <title>Create and configure PostgreSQL Database</title>
295                         <para>As the <emphasis role="bold">postgres</emphasis> user on your PostgreSQL server, create the Evergreen database.</para>
296                         <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>
297                         <orderedlist>
298                                 <listitem>
299                                         <para>
300                                                 <emphasis role="bold">Create and configure the database</emphasis>
301                                         </para>
302                                         <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
303                                         <figure>
304                                                 <title>Commands to create database and adjust the path</title>
305                                                 <screen>
306                                                 # create the database
307                                                 $ su - postgres
308                                                 $ createdb -E UNICODE evergreen
309                                                 $ createlang plperl   evergreen
310                                                 $ createlang plperlu  evergreen
311                                                 $ createlang plpgsql  evergreen
312         
313                                                 # adjust the paths
314                                                 $ psql -f /usr/share/postgresql/8.3/contrib/tablefunc.sql evergreen
315                                                 $ psql -f /usr/share/postgresql/8.3/contrib/tsearch2.sql  evergreen
316                                                 $ psql -f /usr/share/postgresql/8.3/contrib/pgxml.sql     evergreen
317                                                 </screen>
318                                         </figure>
319                                 </listitem>
320                                 <listitem>
321                                         <para><emphasis role="bold">Create new Evergreen superuser</emphasis> </para>
322                                         <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system, create the new user <emphasis role="bold"> evergreen </emphasis>:</para>
323                                         <figure>
324                                                 <title>Commands to create the 'evergreen' user</title>
325                                                 <screen>
326                                                 # create superuser 'evergreen' and set the password
327                                                 $ su - postgres
328                                                 $ createuser -P -s evergreen
329                                                 Enter password for new role:  mynewpassword
330                                                 Enter it again:  mynewpassword
331                                                 </screen>
332                                         </figure>
333                                 </listitem>
334                         </orderedlist>
335                 </section>
336                 <section>
337                         <title>Create Database Schema</title>
338                         <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>
339                         <para>Enter the commands and replace <emphasis>[HOSTNAME], [PORT], [USER], [PASSWORD]</emphasis> and <emphasis>[DATABASENAME]</emphasis> with appropriate values.</para>
340                         <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>
341                         <figure>
342                                 <title>Commands to create Evergreen database schema</title>
343                                 <screen>
344                                 $ su - root
345                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
346                                 $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
347                                         --service all --create-schema --create-bootstrap --create-offline \
348                                         --hostname [HOSTNAME] --port [PORT] \
349                                         --user [USER] --password [PASSWORD] --database [DATABASENAME]
350                                 </screen>
351                         </figure>
352                         <note>
353                                 <para>
354                                         <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>
355                                 </para>
356                         </note>
357                 </section>
358                 <section>
359                         <title>Configure the Apache Server</title>
360                         <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>
361                         <figure>
362                                 <title>Commands to configure the Apache server</title>
363                                 <screen>
364                                 # configure the Apache server
365                                 $ su - root
366                                 $ a2enmod ssl        # enable mod_ssl
367                                 $ a2enmod rewrite    # enable mod_rewrite
368                                 $ a2enmod expires    # enable mod_expires
369                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
370
371                                 # copy files
372                                 $ cp Open-ILS/examples/apache/eg.conf       /etc/apache2/sites-available/
373                                 $ cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/
374                                 $ cp Open-ILS/examples/apache/startup.pl    /etc/apache2/
375                                 </screen>
376                         </figure>
377                 </section>
378                 <section>
379                         <title>Create a Security Certificate (SSL Key)</title>
380                         <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>
381                         <figure>
382                                 <title>Commands to create an SSL key</title>
383                                 <screen>
384                                 $ mkdir /etc/apache2/ssl
385                                 $ cd /etc/apache2/ssl
386                                 $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
387                                 </screen>
388                         </figure>
389                         <warning>
390                                 <para>
391                                         <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>
392                                 </para>
393                         </warning>
394                         <para> [[ ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE ]] </para>
395                 </section>
396                 <section xml:id="serversideinstallation-modify-apache">
397                         <title>Modify the Apache Configuration File</title>
398                         <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>
399                         <itemizedlist>
400                                 <listitem>
401                                         <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>
402                                         <para>
403                                                 <emphasis>This change allows access to your configuration CGI scripts from <emphasis role="bold">any</emphasis> workstation on <emphasis role="bold">any</emphasis> network. This is only a temporary change to expedite testing and should be removed after you have finished and successfully tested the Evergreen installation.</emphasis>
404                                         </para>
405                                         <warning>
406                                                 <para>
407                                                         <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>
408                                                 </para>
409                                         </warning>
410                                 </listitem>
411                                 <listitem>
412                                         <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>
413                                         <para> [[ ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS ]] </para>
414                                 </listitem>
415                                 <listitem>
416                                         <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>
417                                         <para> [[ ADD INFO ON WHETHER THIS IS STILL NECESSARY ]] </para>
418                                         <orderedlist>
419                                                 <listitem>
420                                                         <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>
421                                                         <screen>www-data</screen>
422                                                         <para>to the user:</para>
423                                                         <screen>opensrf</screen>
424                                                 </listitem>
425                                                 <listitem>
426                                                         <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>
427                                                         <screen>export APACHE_RUN_USER=www-data</screen>
428                                                         <para>to the phrase:</para>
429                                                         <screen>export APACHE_RUN_USER=opensrf</screen>
430                                                 </listitem>
431                                         </orderedlist>
432                                 </listitem>
433                                 <listitem>
434                                         <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>
435                                 </listitem>
436                         </itemizedlist>
437                 </section>
438                 <section>
439                         <title>(OPTIONAL) Performance Modifications for Apache</title>
440                         <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>
441                         <itemizedlist>
442                                 <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>
443                                 <listitem>
444                                         <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>
445                                         <figure>
446                                                 <title>(OPTIONAL) Updates to Apache configuration</title>
447                                                 <screen>
448                                                 &lt;IfModule mpm_prefork_module>
449                                                    StartServers           20
450                                                    MinSpareServers         5
451                                                    MaxSpareServers        15
452                                                    MaxClients            150
453                                                    MaxRequestsPerChild 10000
454                                                 &lt;/IfModule>
455                                                 
456                                                 MaxKeepAliveRequests 100
457                                                 </screen>
458                                         </figure>
459                                 </listitem>
460                         </itemizedlist>
461                 </section>
462                 <section>
463                         <title>Enable the Evergreen Site</title>
464                         <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>
465                         <figure>
466                                 <title>Apache Commands to Enable the Evergreen Web Site</title>
467                                 <screen>
468                                 $ su - root
469
470                                 # disables the default site (i.e., the "It Works" page).
471                                 $ a2dissite default
472
473                                 # enables the Evergreen web site
474                                 $ a2ensite eg.conf
475                                 </screen>
476                         </figure>
477                 </section>
478                 <section>
479                         <title>Modify the OpenSRF Configuration File</title>
480                         <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>
481                         <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>
482                         <note>
483                                 <para>
484                                         <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>
485                                 </para>
486                         </note>
487                         <para>[[ ADD A BETTER DIAGRAM HERE ]]</para>
488                         <figure>
489                                 <title>Updates needed to the file "/openils/conf/opensrf_core.xml"</title>
490                                 <screen>
491                                 /config/opensrf/username  = opensrf
492
493                                 /config/opensrf/passwd    = password for "private.localhost" opensrf user
494
495                                 /config/gateway/username  = opensrf
496
497                                 /config/gateway/passwd    = password for "public.localhost" opensrf user
498
499                                 # first entry, where "transport/server" == "public.localhost" :
500                                 /config/routers/router/transport 
501                                     username = router
502                                     password = password for "public.localhost" router user
503                                 # second entry, where "transport/server" == "private.localhost" :
504                                 /config/routers/router/transport
505                                     username = router
506                                     password = password for "private.localhost" router user
507                                 </screen>
508                         </figure>
509                 </section>
510                 <section>
511                         <title>Create Configuration Files for Users Needing srfsh</title>
512                         <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>
513                         <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>
514                         <itemizedlist>
515                                 <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>
516                                 <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>
517                                 <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
518                                 <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
519                         </itemizedlist>
520                         <figure>
521                                 <title>Sample of configuration file /openils/conf/srfsh.xml.example</title>
522                                 <screen>
523                                 &lt;?xml version="1.0"?>
524                                 &lt;!-- This file follows the standard bootstrap config file layout -->
525                                 &lt;!-- found in opensrf_core.xml -->
526                                 &lt;srfsh>
527                                 &lt;router_name>router&lt;/router_name>
528                                 &lt;domain>private.localhost&lt;/domain>
529                                 &lt;username>opensrf&lt;/username>
530                                 &lt;passwd>evergreen&lt;/passwd>
531                                 &lt;port>5222&lt;/port>
532                                 &lt;logfile>/tmp/srfsh.log&lt;/logfile>
533                                 &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
534                                 &lt;loglevel>4&lt;/loglevel>
535                                 &lt;/srfsh>
536                                 </screen>
537                         </figure>
538                 </section>
539                 <section>
540                         <title>Modify the OpenSRF Environment</title>
541                         <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>
542                         <note>
543                                 <para>
544                                         <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>
545                                 </para>
546                         </note>
547                         <figure>
548                                 <title>Modify the OpenSRF environment</title>
549                                 <screen>
550                                 # change permissions
551                                 $ su - opensrf
552                                 $ chmod 755 /openils/var/cgi-bin/*.cgi
553
554                                 # add environmental variable
555                                 $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
556
557                                 # inherit the new environment
558                                 $ . ~/.bashrc
559                                 </screen>
560                         </figure>
561                 </section>
562                 <section xml:id="serversideinstallation-localization">
563                         <title>(OPTIONAL) Configuration for Other Languages</title>
564                         <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>
565                         <para> [[ ADD SECTION ON LANGUAGE LOCALIZATION ]] </para>
566                 </section>
567                 <section xml:id="serversideinstallation-starting">
568                         <title>Starting Evergreen</title>
569                         <orderedlist>
570                                 <listitem>
571                                         <para>As the <emphasis role="bold">root</emphasis> user, start the memcached and ejabberd services (if they aren't already running):</para>
572                                         <figure>
573                                                 <title>Start some services</title>
574                                                 <screen>
575                                                 $ su - root
576                                                 $ /etc/init.d/ejabberd start
577                                                 $ /etc/init.d/memcached start
578                                                 </screen>
579                                         </figure>
580                                 </listitem>
581                                 <listitem>
582                                         <para>As the <emphasis role="bold">opensrf</emphasis> user, start Evergreen.</para>
583                                         <para>Use the flag <emphasis>-l</emphasis> to force Evergreen to use <emphasis>localhost</emphasis> (your current system) as the hostname.</para>
584                                         <figure>
585                                                 <title>Start Evergreen</title>
586                                                 <screen>
587                                                 $ su - opensrf
588
589                                                 # ensure you have the needed path
590                                                 $ export PATH=$PATH:/openils/bin
591
592                                                 # start the server;
593                                                 # use "-l" to force hostname to be "localhost"
594                                                 $ osrf_ctl.sh -l -a start_all     
595                                                 </screen>
596                                         </figure>
597                                         <note>
598                                                 <para>
599                                                         <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>
600                                                 </para>
601                                         </note>
602                                         <para>[[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]]</para>
603                                         <para>Execute the following command to determine the fully qualified domain name of your system:</para>
604                                         <figure>
605                                                 <title>(OPTIONAL) Determine the fully qualified domain name</title>
606                                                 <screen>
607                                                 $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"'
608                                                 </screen>
609                                         </figure>
610                                         <itemizedlist>
611                                                 <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>
612                                                 <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>
613                                         </itemizedlist>
614                                 </listitem>
615                                 <listitem>
616                                         <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>
617                                         <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>
618                                         <figure>
619                                                 <title>Generate web files</title>
620                                                 <screen>
621                                                 $ su - opensrf
622                                                 $ cd /openils/bin
623                                                 $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u
624                                                 Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'
625
626                                                 Updating fieldmapper
627                                                 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!!!
628                                                 </screen>
629                                                 <para>[[ ADD RESULTS OF TESTS FROM "autogen.sh" ]]</para>
630                                         </figure>
631                                 </listitem>
632                                 <listitem>
633                                         <para>As the <emphasis role="bold">root</emphasis> user, restart the Apache Web server:</para>
634                                         <figure>
635                                                 <title>Generate web files</title>
636                                                 <screen>
637                                                 $ su - root
638                                                 $ /etc/init.d/apache2 restart
639                                                 </screen>
640                                         </figure>
641                                         <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>
642                                 </listitem>
643                         </orderedlist>
644                 </section>
645                 <section xml:id="serversideinstallation-testing">
646                         <title>Testing the Installation</title>
647                         <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>
648                         <section xml:id="serversideinstallation-testing-connections">
649                                 <title>Testing Connections to Evergreen</title>
650                                 <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>
651                                 <figure>
652                                         <title>Running the srfsh utility</title>
653                                         <screen>
654                                         $ su - opensrf
655                                         $ /openils/bin/srfsh
656                                         srfsh% login admin open-ils
657                                         Received Data: "250bf1518c7527a03249858687714376"
658                                         ------------------------------------
659                                         Request Completed Successfully
660                                         Request Time in seconds: 0.045286
661                                         ------------------------------------
662                                         Received Data: {
663                                            "ilsevent":0,
664                                            "textcode":"SUCCESS",
665                                            "desc":" ",
666                                            "pid":21616,
667                                            "stacktrace":"oils_auth.c:304",
668                                            "payload":{
669                                               "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
670                                               "authtime":420
671                                            }
672                                         }
673                                         ------------------------------------
674                                         Request Completed Successfully
675                                         Request Time in seconds: 1.336568
676                                         ------------------------------------
677                                         </screen>
678                                 </figure>
679                                 <para>If this does not work, try other simple troubleshooting steps:</para>
680                                 <itemizedlist>
681                                         <listitem>
682                                                 <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>
683                                                 <para>[[ MAY NEED TO REWORK THIS DIAGRAM TO USE SAME IMAGE STANDARDS AS OTHER CHAPTERS ]]</para>
684                                                 <figure>
685                                                         <title>Executing the script <emphasis> settings-test.pl</emphasis></title>
686                                                         <mediaobject>
687                                                                 <imageobject>
688                                                                         <imagedata fileref="../media/serversideinstallation-testing-1.png" scalefit="1" width="100%"/>
689                                                                 </imageobject>
690                                                         </mediaobject>
691                                                         <mediaobject>
692                                                                 <imageobject>
693                                                                         <imagedata fileref="../media/serversideinstallation-testing-2.png" scalefit="1" width="100%"/>
694                                                                 </imageobject>
695                                                         </mediaobject>
696                                                 </figure>
697                                                 <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>
698                                         </listitem>
699                                         <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>
700                                 </itemizedlist>
701                         </section>
702                         <section xml:id="serversideinstallation-testing-opac">
703                                 <title>Testing the Catalog</title>
704                                 <para>By default, the OPAC will live at the URL <emphasis>http://my.domain.com/opac/</emphasis>.</para>
705                                 <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>
706                                 <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>
707                                 <para>[[ ADD OTHER SIMPLE FUNCTIONAL TESTS ]]</para>
708                         </section>
709                         <section xml:id="serversideinstallation-testing-othersrfsh">
710                                 <title>Other Tests with srfsh</title>
711                                 <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>
712                                 <screen>
713                                 srfsh# math_bench 10
714                                 |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
715                                 ++++++++++++++++++++++++++++++++++++++++
716                                 Average round trip time: 0.033425
717                                 srfsh#
718                                 </screen>
719                                 <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>
720                                 <para>For other srfsh commands, type 'help' in at the prompt.</para>
721                         </section>
722                 </section>
723                 <section xml:id="serversideinstallation-postinstallation">
724                         <title>Post-Installation Chores</title>
725                         <itemizedlist>
726                                 <listitem>
727                                         <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>
728                                         <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 in an earlier step as a temporary measure to expedite testing (see the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-modify-apache"> "Modify the Apache Configuration File" </link></emphasis></emphasis> for further information). Those changes must now be reversed in order to deny unwanted access to your CGI scripts from users on other public networks. You <emphasis role="bold"> must </emphasis> secure this for a public production system.</para>
729                                 </listitem>
730                                 <listitem>
731                                         <warning>
732                                                 <para><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><emphasis role="bold"><link linkend="serversideinstallation-ssl"> "Getting a Signed SSL Security Certificate" </link></emphasis></emphasis> </emphasis>.
733
734                 <title>Getting a Signed SSL Security Certificate</title></para>
735                                         </warning>
736                                 </listitem>
737                         </itemizedlist>
738                 </section>
739                 <section xml:id="serversideinstallation-running-staffclient">
740                         <title>Running the Staff Client on Linux</title>
741                         <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>
742                         <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>
743                         <figure>
744                                 <title>Running the Linux Staff Client</title>
745                                 <screen>
746                                 $ su - opensrf
747                                 $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini
748                                 </screen>
749                         </figure>
750                 </section>
751                 <section xml:id="serversideinstallation-starting-apache-server">
752                         <title>Starting the Apache Web Server</title>
753                         <para>Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server.</para>
754                         <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>
755                         <figure>
756                                 <title>Start the Apache Web Server</title>
757                                 <screen>
758                                 $ su - root
759                                 $ apache2ctl configtest &amp;&amp; /etc/init.d/apache2 restart
760                                 </screen>
761                         </figure>
762                 </section>
763                 <section xml:id="serversideinstallation-stopping">
764                         <title>Stopping the Evergreen Services</title>
765                         <para>As the <emphasis role="bold">opensrf</emphasis> user, stop all Evergreen services by using the following command:</para>
766                         <figure>
767                                 <title>Stop all Evergreen services</title>
768                                 <screen>
769                                 $ su - opensrf
770
771                                 # stop the server:
772                                 # use "-l" to force hostname to be "localhost"
773                                 $ osrf_ctl.sh -l -a stop_all
774                                 </screen>
775                         </figure>
776                         <note>
777                                 <para>
778                                         <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>
779                                 </para>
780                         </note>
781                         <para>[[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]]</para>
782                 </section>
783                 <section xml:id="serversideinstallation-reports">
784                         <title>Setting Up Support For Reports</title>
785                         <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>
786                 </section>
787                 <section xml:id="serversideinstallation-starting-reporter-daemon">
788                         <title>Starting the Reporter Daemon</title>
789                         <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>
790                         <para>As the <emphasis role="bold">opensrf</emphasis> user, start the reporter daemon using the following command:</para>
791                         <figure>
792                                 <title>Starting the Reporter Daemon</title>
793                                 <screen>
794                                 $ su - opensrf
795                                 $ cd /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/src/reporter
796                                 $ ./clark-kent.pl --daemon
797                                 </screen>
798                         </figure>
799                         <para>You can also specify other options with this utility:</para>
800                         <itemizedlist>
801                                 <listitem>--sleep=interval      : number of seconds to sleep between checks for new reports to run; defaults to 10</listitem>
802                                 <listitem>--lockfile=filename   : where to place the lockfile for the process; defaults to <emphasis>/tmp/reporter-LOCK</emphasis></listitem>
803                                 <listitem>--concurrency=integer : number of reporter daemon processes to run; defaults to "1"</listitem>
804                                 <listitem>--boostrap=filename   : OpenSRF bootstrap configuration file; defaults to <emphasis>/openils/conf/opensrf_core.xml</emphasis></listitem>
805                         </itemizedlist>
806                 </section>
807                 <section xml:id="serversideinstallation-stopping-reporter-daemon">
808                         <title>Stopping the Reporter Daemon</title>
809                         <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>
810                         <note>
811                                 <para>
812                                         <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>
813                                 </para>
814                         </note>
815                         <figure>
816                                 <title>Stopping the Reporter Daemon</title>
817                                 <screen>
818                                 $ su - opensrf
819                                 # find and kill the process ID number(s)
820                                 $ kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6`
821                                 # remove the lock file
822                                 $ rm /tmp/reporter-LOCK
823                                 </screen>
824                         </figure>
825                 </section>
826         </section>
827         <section xml:id="serversideinstallation-otherlinux">
828                 <title>Installing Evergreen On Other Linux Systems</title>
829                 <para>[[ ADD CONTENT FOR INSTALLING ON OTHER LINUX SYSTEMS ]]</para>
830         </section>
831         <section xml:id="serversideinstallation-virtual">
832                 <title>Installing Evergreen in Virtualized Unix Environments</title>
833                 <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).</para>
834                 <para>[[ ADD CONTENT FOR INSTALLING EVERGREEN IN VIRTUALIZED UNIX ENVIRONMENTS ]]</para>
835                 <section xml:id="serversideinstallation-virtualized-virtualbox">
836                         <title>VirtualBox</title>
837                         <para>[[ ADD CONTENT FOR VirtualBox ]]</para>
838                 </section>
839                 <section xml:id="serversideinstallation-virtualized-vmware">
840                         <title>VMware</title>
841                         <para>[[ ADD CONTENT FOR VMware ]]</para>
842                 </section>
843                 <section xml:id="serversideinstallation-virtualized-virtualpc">
844                         <title>VirtualPC</title>
845                         <para>[[ ADD CONTENT FOR VirtualPC ]]</para>
846                 </section>
847         </section>
848         <section xml:id="serversideinstallation-previousversions">
849                 <title>Installing Previous Versions of Evergreen</title>
850                 <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>
851                 <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold">1.4.0.6</emphasis></emphasis>. The accompanying previous release of OpenSRF is version <emphasis><emphasis role="bold">1.0.x</emphasis></emphasis>.</para>
852                 <section xml:id="serversideinstallation-ubuntudebian-previous">
853                         <title>Installing Evergreen 1.4.0.6 on Ubuntu or Debian</title>
854                         <para>[[ ADD CONTENT FOR INSTALLING EVERGREEN 1.4.0.6 ON UBUNTU OR DEBIAN ]]</para>
855                 </section>
856                 <section xml:id="serversideinstallation-opensrf-previous">
857                         <title>Installing OpenSRF 1.0.x</title>
858                         <para>[[ ADD CONTECNT FOR INSTALLING OPENSRF 1.0.x ]]</para>
859                 </section>
860         </section>
861         <section xml:id="serversideinstallation-opensrf">
862                 <title>OpenSRF</title>
863                 <para>[[ ADD CONTENT FOR OPENSRF ]] </para>
864         </section>
865         <section xml:id="serversideinstallation-staffclient">
866                 <title>Installing the Evergreen Staff Client</title>
867                 <para>[[ ADD CONTENT FOR INSTALLING THE EVERGREEN STAFF CLIENT ]]</para>
868         </section>
869         <section xml:id="serversideinstallation-postgresql">
870                 <title>PostgreSQL</title>
871                 <para>[[ ADD CONTENT FOR POSTGRESQL ]] </para>
872         </section>
873         <section xml:id="serversideinstallation-apache">
874                 <title>Apache</title>
875                 <para>[[ ADD CONTENT FOR APACHE ]] </para>
876         </section>
877         <section xml:id="serversideinstallation-memcached">
878                 <title>memcached Servers</title>
879                 <para>[[ ADD CONTENT FOR MEMCACHED ]] </para>
880         </section>
881         <section xml:id="serversideinstallation-organizationandpolicy">
882                 <title>Organization and Policy Editing</title>
883                 <para>[[ ADD CONTENT FOR ORGANIZATION AND POLICY EDITING ]] </para>
884         </section>
885         <section xml:id="serversideinstallation-sip">
886                 <title>Installing the SIP Server</title>
887                 <para>[[ ADD CONTENT FOR INSTALLING THE SIP SERVER ]]</para>
888         </section>
889         <section xml:id="serversideinstallation-nginx">
890                 <title>Using nginx to serve static content</title>
891                 <para>[[ ADD CONTENT FOR USING NGINX TO SERVE STATIC CONTENT ]]</para>
892         </section>
893         <section xml:id="serversideinstallation-ssl">
894                 <title>Getting a Signed SSL Security Certificate</title>
895                 <para>[[ ADD EXPLANATION OF HOW TO GET A SIGNED SSL CERTIFICATE ]] </para>
896         </section>
897 </chapter>