]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
new file;
[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>Specifics in the process of installing server-side software for Evergreen</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 (in fact, that is a reasonable system for simple experiments or a proof-of-concept). 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 Server software at all. But typical real-world systems will probably consist of at least one or two Servers plus multiple Staff Clients.</para>
12                 <para>The Server software currently runs as a native application on any of several well-known Linux distributions (e.g., Debian and Ubuntu). 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 in Virtualized Unix Environments"</link></emphasis></emphasis></para>
13         </section>
14         <section xml:id="serversideinstallation-requirements">
15                 <title>System Requirements</title>
16                 <para>This section describes processes and events that must occur to install the Evergreen server in all supported operating systems / environments. Please review the section <emphasis><emphasis role="bold"><link linkend="serversideinstallation-process">"The Installation Process"</link></emphasis></emphasis> for instructions tailored to specific distributions.</para>
17                 <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>
18                 <para>
19                         <screen>
20                         From Dan Scott on [http://list.georgialibraries.org/pipermail/open-ils-general/2007-July/000316.html|OPEN-ILS-GENERAL]:
21                         > On 8/11/07, lan ye &lt;lye at mail.slcl.org> wrote:
22                         > > We've been researching the Evergreen Open Source Library system, and would
23                         > like to have a list of hardware requirements for the installation of a small
24                         > test server. To keep things within a small budget, I would like to just use
25                         > an ordinary PC. Could you send some information to us?
26
27                         For system requirements, it depends on how extensive you want your
28                         tests to be. Evergreen and all of the pieces it depends on
29                         (PostgreSQL, Apache, Ejabberd) run happily in a VMWare image allocated
30                         512MB of RAM on my laptop with just the Project Gutenberg e-books
31                         loaded, and that's enough to evaluate the OPAC interface / try out the
32                         staff client / make some local changes and generally experiment. But
33                         I'm not going to load one million bib records into that system and
34                         expect it to perform. So, probably any hardware you have lying around
35                         would be adequate for a small test server.
36
37                         > > It looks like Evergreen has been successfully installed on two Linux
38                         > systems: Gentoo and Ubuntu. Which one is the best for us to test using
39                         > what's already in place at other libraries? Are there any differences /
40                         > Advantages in functionality between Gentoo and Ubuntu?
41
42                         As John said, GPLS is running on Debian, and that's the only Evergreen
43                         system that is in production at the moment. However, the documentation
44                         for installing on Debian is a bit scattered right now. The developers
45                         themselves used Gentoo originally, and that's what I'm using at the
46                         moment &amp; have documented in the wiki; the install process on Ubuntu is
47                         very thoroughly documented and Ubuntu is reasonably close to Debian.
48                         See http://open-ils.org/dokuwiki/doku.php?id=server_installation for
49                         the list of install instructions for various distributions.
50
51                         As for advantages / disadvantages of particular distributions, that's
52                         a religious war that I don't want to step into... We'll try to help
53                         you out no matter what distribution you choose; just please choose a
54                         current release :)
55
56                         -- 
57                         Dan Scott
58                         Laurentian University
59                         </screen>
60                         <screen>
61                         And from James Fournie in that same [http://list.georgialibraries.org/pipermail/open-ils-general/2007-July/000317.html|thread]:
62                         We are running a test Ubuntu server on a ~1ghz Celeron PC with 512mb RAM.
63                         It seems to be ok handling the Gutenberg samples, and our collection of
64                         about 8000 records. We did have serious problems using anything less than
65                         512mb RAM. Also, I tried Evergreen on a K6 II 350, but it wasn't pretty.
66
67                         James Fournie
68                         Digitization Librarian
69                         Union of B.C. Indian Chiefs
70                         </screen>
71                 </para>
72         </section>
73         <section xml:id="serversideinstallation-examples">
74                 <title>Example System Architectures</title>
75                 <para>[[real-world examples of working systems]]</para>
76                 <section xml:id="serversideinstallation-example-pines">
77                         <title>PINES</title>
78                         <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>
79                         <para>[[ further information on PINES ]] </para>
80                 </section>
81                 <section xml:id="serversideinstallation-example-other">
82                         <title>Other Architectures</title>
83                         <para>[[ further information on OTHER ]] </para>
84                 </section>
85         </section>
86         <section xml:id="serversideinstallation-virtual">
87                 <title>Installing in Virtualized Unix Environments</title>
88                 <para>[[ Installing in Virtualized Unix Environments ]]</para>
89                 <section xml:id="serversideinstallation-virtualized-virtualbox">
90                         <title>VirtualBox</title>
91                         <para>[[ VirtualBox ]]</para>
92                 </section>
93                 <section xml:id="serversideinstallation-virtualized-vmware">
94                         <title>VMware</title>
95                         <para>[[ VMware ]]</para>
96                 </section>
97                 <section xml:id="serversideinstallation-virtualized-virtualpc">
98                         <title>VirtualPC</title>
99                         <para>[[ VirtualPC ]]</para>
100                 </section>
101         </section>
102         <section xml:id="serversideinstallation-process">
103                 <title>The Installation Process</title>
104                 <section>
105                         <title>Current stable Release</title>
106                         <para>
107                                 <link linkend="serversideinstallation-ubuntudebian">Installing Evergreen 1.6.0.x on Ubuntu or Debian</link>
108                         </para>
109                         <para>
110                                 <link linkend="serversideinstallation-opensrf">Installing OpenSRF 1.2.x</link>
111                         </para>
112                 </section>
113                 <section>
114                         <title>Previous stable release</title>
115                         <para>
116                                 <link linkend="serversideinstallation-ubuntudebian-previous">Installing Evergreen 1.4.0.x on Ubuntu or Debian</link>
117                         </para>
118                         <para>
119                                 <link linkend="serversideinstallation-opensrf-previous">Installing OpenSRF 1.0.x</link>
120                         </para>
121                 </section>
122                 <section>
123                         <title>Configuring the system</title>
124                         <para>
125                                 <link linkend="serversideinstallation-organizationandpolicy">Organization and Policy Editing</link>
126                         </para>
127                         <section>
128                                 <title>Holds</title>
129                                 <para>For holds to work properly, you need to run this command as the user <emphasis role="bold">opensrf</emphasis> to calculate the proximity of locations in the Organizational Unit tree:</para>
130                                 <screen>
131                                 $ autogen.sh -u -c /openils/conf/opensrf_core.xml
132                                 </screen>
133                                 <para>This is an expensive operation if you have a large Organizational Unit tree, so don't run it indiscriminately.</para>
134                         </section>
135                 </section>
136         </section>
137         <section xml:id="serversideinstallation-ubuntudebian">
138                 <title>Installing Evergreen 1.6.0.x On Ubuntu or Debian</title>
139                 <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>
140                 <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>
141                 <para>To become the <emphasis role="bold">root</emphasis> user, issue the command: <emphasis><emphasis role="bold">sudo 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>
142                 <section>
143                         <title>Install the latest version of OpenSRF</title>
144                         <para>For further information on installing the Open Service Request Framework (OpenSRF), see the section <link linkend="serverinstallation-opensrf">Installing OpenSRF</link>.</para>
145                         <para>Follow the steps outlined in that section, then run the specified test(s) to ensure that OpenSRF is properly installed before continuing with any further Evergreen installation steps. The Evergreen application depends on properly installation of OpenSRF. If OpenSRF does not work correctly, Evergreen will not work properly either.</para>
146                 </section>
147                 <section>
148                         <title>Download and Build Evergreen </title>
149                         <para>In this section, you will download, unpack, install and test the Evergreen system, including the Evergreen server and the PostgreSQL database system. You will also 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>
150                         <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>
151                         <para>Of course, when you successfully complete and test the entire 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 institute.</para>
152                         <section>
153                                 <title>Download and Unpack Latest Evergreen Version</title>
154                                 <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>
155                                 <figure>
156                                         <title>Commands to download/extract Evergreen</title>
157                                         <screen>
158                                         $ sudo su - opensrf
159                                         $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz
160                                         $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz
161                                         </screen>
162                                 </figure>
163                         </section>
164                         <section>
165                                 <title>Install Prerequisites to Build Evergreen</title>
166                                 <para>In this step you will install and configure a set of prerequisites for building Evergreen. In a following step you will actually build the software.</para>
167                                 <para>As the <emphasis role="bold">root</emphasis> user, build the prerequisites from the software distribution that you just downloaded and unpacked. Enter the commands show below. Remember to replace <emphasis>[distribution]</emphasis> in the following example with the keyword that corresponds to your actual Linux distribution (see the following list):</para>
168                                 <itemizedlist>
169                                         <listitem><emphasis>debian-etch</emphasis> for Debian Etch (4.0)</listitem>
170                                         <listitem><emphasis>debian-lenny</emphasis> for Debian Lenny (5.0)</listitem>
171                                         <listitem>[[other Debian distributions]]</listitem>
172                                         <listitem><emphasis>ubuntu-hardy</emphasis> for Ubuntu Hardy (8.04)</listitem>
173                                         <listitem><emphasis>ubuntu-karmic</emphasis> for Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)</listitem>
174                                         <listitem>[[other Ubuntu distributions]]</listitem>
175                                 </itemizedlist>
176                                 <figure>
177                                         <title>Commands to install prerequisites for Evergreen</title>
178                                         <screen>
179                                         $ sudo su - root
180                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
181                                         $ make -f Open-ILS/src/extras/Makefile.install [distribution]
182                                         </screen>
183                                 </figure>
184                         </section>
185                         <section>
186                                 <title>(OPTIONAL) Install the PostgreSQL Server</title>
187                                 <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>
188                                 <para>For further information on installing PostgreSQL, see the section <link linkend="serverinstallation-postgresql">Installing PostgreSQL</link>.</para>
189                                 <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>
190                                 <figure>
191                                         <title>Commands to install the PostgreSQL server</title>
192                                         <screen>
193                                         $ sudo su - root
194
195                                         # Debian Lenny and Ubuntu Hardy (8.04)
196                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83
197
198                                         # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04)
199                                         $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84
200                                         </screen>
201                                 </figure>
202                                 <para><emphasis role="bold">Note:</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!</para>
203                                 <para>[[ is this still true? ]]</para>
204                                 <para>[[ how to determine which version of PostgreSQL you have? ]]</para>
205                         </section>
206                         <section>
207                                 <title>(OPTIONAL) Install Perl Modules on PostgreSQL Server</title>
208                                 <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>
209                                 <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>
210                                 <figure>
211                                         <title>Commands to install Perl modules</title>
212                                         <screen>
213                                         # ensure the gcc compiler is installed
214                                         $ sudo su - root
215                                         $ aptitude install gcc
216
217                                         # install the Perl modules
218                                         $ perl -MCPAN -e shell
219                                         cpan> install JSON::XS
220                                         cpan> install MARC::Record
221                                         cpan> install MARC::File::XML
222                                         </screen>
223                                 </figure>
224                                 <para>[[ how to install the Perl modules ]]</para>
225                                 <para>[[ how to verify that the Perl modules are installed ]]</para>
226                         </section>
227                         <section>
228                                 <title>Add Additional Library Paths on Evergreen System</title>
229                                 <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>
230                                 <figure>
231                                         <title>Commands to modify system dynamic library path</title>
232                                         <screen>
233                                         $ sudo su - root
234                                         $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE
235                                         /usr/local/lib
236                                         /usr/local/lib/dbd
237                                         ENDOFFILE
238                                         $ ldconfig
239                                         </screen>
240                                 </figure>
241                         </section>
242                         <section>
243                                 <title>(OPTIONAL) Restart the PostgreSQL Service</title>
244                                 <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>
245                                 <para>[[ other versions of PostgreSQL ]]</para>
246                                 <figure>
247                                         <title>Commands to restart PostgreSQL service</title>
248                                         <screen>
249                                         $ sudo su - root
250                                         $ /etc/init.d/postgresql-8.3 restart
251                                         </screen>
252                                 </figure>
253                         </section>
254                         <section>
255                                 <title>Configure and Compile Evergreen Sources</title>
256                                 <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>
257                                 <figure>
258                                         <title>Commands to configure and compile Evergreen</title>
259                                         <screen>
260                                         $ sudo su - opensrf
261                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
262                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf
263                                         $ make
264                                         </screen>
265                                 </figure>
266                         </section>
267                         <section>
268                                 <title>Link and Install Evergreen</title>
269                                 <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>
270                                 <figure>
271                                         <title>Commands to link and install Evergreen</title>
272                                         <screen>
273                                         $ sudo su - root
274                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
275                                         $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_6 install
276                                         $ cd /openils/var/web/xul
277                                         $ ln -sf rel_1_6_0_7/server server
278                                         </screen>
279                                 </figure>
280                         </section>
281                         <section>
282                                 <title>Copy the OpenSRF Configuration Files</title>
283                                 <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>
284                                 <figure>
285                                         <title>Commands to copy OpenSRF configuration files</title>
286                                         <screen>
287                                         $ sudo su - root
288                                         $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
289                                         $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
290                                         $ cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
291                                         $ chown -R opensrf:opensrf /openils/
292                                         </screen>
293                                 </figure>
294                         </section>
295                         <section>
296                                 <title>Create and configure PostgreSQL Database</title>
297                                 <para>As the <emphasis role="bold">postgres</emphasis> user on your PostgreSQL server, create the Evergreen database.</para>
298                                 <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>
299                                 <orderedlist>
300                                         <listitem>
301                                                 <para>
302                                                         <emphasis role="bold">Create and configure the database</emphasis>
303                                                 </para>
304                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>
305                                                 <figure>
306                                                         <title>Commands to create database and adjust the path</title>
307                                                         <screen>
308                                                         # create the database
309                                                         $ sudo su - postgres
310                                                         $ createdb -E UNICODE evergreen
311                                                         $ createlang plperl   evergreen
312                                                         $ createlang plperlu  evergreen
313                                                         $ createlang plpgsql  evergreen
314         
315                                                         # adjust the paths
316                                                         $ psql -f /usr/share/postgresql/8.3/contrib/tablefunc.sql evergreen
317                                                         $ psql -f /usr/share/postgresql/8.3/contrib/tsearch2.sql  evergreen
318                                                         $ psql -f /usr/share/postgresql/8.3/contrib/pgxml.sql     evergreen
319                                                         </screen>
320                                                 </figure>
321                                         </listitem>
322                                         <listitem>
323                                                 <para><emphasis role="bold">Create new Evergreen superuser</emphasis> </para>
324                                                 <para>As the <emphasis role="bold">postgres</emphasis> user on the PostgreSQL system, create the new user <emphasis role="bold"> evergreen </emphasis>:</para>
325                                                 <figure>
326                                                         <title>Commands to create the 'evergreen' user</title>
327                                                         <screen>
328                                                         # create superuser 'evergreen' and set the password
329                                                         $ sudo su - postgres
330                                                         $ createuser -P -s evergreen
331                                                         Enter password for new role:  mynewpassword
332                                                         Enter it again:  mynewpassword
333                                                         </screen>
334                                                 </figure>
335                                         </listitem>
336                                 </orderedlist>
337                         </section>
338                         <section>
339                                 <title>Create Database Schema</title>
340                                 <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>
341                                 <para>Enter the commands and replace <emphasis>[HOSTNAME], [PORT], [USER], [PASSWORD]</emphasis> and <emphasis>[DATABASENAME]</emphasis> with appropriate values.</para>
342                                 <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>
343                                 <figure>
344                                         <title>Commands to create Evergreen database schema</title>
345                                         <screen>
346                                         $ sudo su - root
347                                         $ cd /home/opensrf/Evergreen-ILS-1.6.0.7
348                                         $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
349                                                 --service all --create-schema --create-bootstrap --create-offline \
350                                                 --hostname [HOSTNAME] --port [PORT] \
351                                                 --user [USER] --password [PASSWORD] --database [DATABASENAME]
352                                         </screen>
353                                 </figure>
354                                 <para>
355                                         <emphasis> NOTE: If you are entering the above command on a single line, do not include the ''\'' 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>
356                                 </para>
357                         </section>
358                         <section>
359                                 <title>Setup 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                                         $ sudo 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                                 <para><emphasis> <emphasis role="bold"> Warning: </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> </para>
390                                 <para> [[how to get a signed SSL certificate]] </para>
391                         </section>
392                         <section>
393                                 <title>Modify the Apache Configuration File</title>
394                                 <para>Edit the Apache configuration file <emphasis>/etc/apache2/sites-available/eg.conf</emphasis> and make the following changes:</para>
395                                 <itemizedlist>
396                                         <listitem>
397                                                 <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>. This is a temporary measure to expedite testing.</para>
398                                                 <para>
399                                                         <emphasis> <emphasis role="bold"> Warning: </emphasis> You must remove these changes after testing is completed. This will enable access to the configuration CGI scripts from any workstation on any network. 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.</emphasis>
400                                                 </para>
401                                         </listitem>
402                                         <listitem>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> .
403                                                 <para> [[Debian Etch users - do not do this!]] </para></listitem>
404                                 </itemizedlist>
405                         </section>
406                         <section>
407                                 <title>Modifications to Keep the Logs Functioning</title>
408                                 <para>You must modify the Apache configuration file 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>
409                                 <para> [[ is this still necessary ? ]] </para>
410                                 <orderedlist>
411                                         <listitem>
412                                                 <para>For the Linux distributions <emphasis>Ubuntu Hardy / 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>
413                                                 <screen>www-data</screen>
414                                                 <para>to the user:</para>
415                                                 <screen>opensrf</screen>
416                                         </listitem>
417                                         <listitem>
418                                                 <para>For the Linux distributions <emphasis>Ubuntu Karmic / Ubuntu Lucid / 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>
419                                                 <screen>export APACHE_RUN_USER=www-data</screen>
420                                                 <para>to the phrase:</para>
421                                                 <screen>export APACHE_RUN_USER=opensrf</screen>
422                                         </listitem>
423                                 </orderedlist>
424                         </section>
425                         <section>
426                                 <title>Modify Apache Configuration File</title>
427                                 <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>
428                         </section>
429                         <section>
430                                 <title>(OPTIONAL) Performance Modifications for Apache</title>
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">MaxKeepAliveRequests 100</emphasis>, or modify an existing line if it already exists. Additionally, locate and modify the section related to <emphasis>prefork configuration</emphasis> to suit the load on your system.</para>
432                                 <para>Following are settings that may apply to a busy system:</para>
433                                 <figure>
434                                         <title>"Prefork configuration" section of Apache configuration file</title>
435                                         <screen>
436                                         &lt;IfModule mpm_prefork_module>
437                                            StartServers    20
438                                            MinSpareServers       5
439                                            MaxSpareServers      15
440                                            MaxClients       150
441                                            MaxRequestsPerChild 10000
442                                         &lt;/IfModule>
443                                         </screen>
444                                 </figure>
445                                 <para>[[ settings of "prefork configuration" section for busy/notbusy systems ]]</para>
446                         </section>
447                         <section>
448                                 <title>Enable the Evergreen Site</title>
449                                 <para>As the <emphasis role="bold">root</emphasis> user, enable the Evergreen site:</para>
450                                 <figure>
451                                         <title>Commands to enabl e the Evergreen site</title>
452                                         <screen>
453                                         $ sudo su - root
454                                         $ a2dissite default    # OPTIONAL: disable the default site (i.e., the "It Works" page).
455                                         $ a2ensite eg.conf
456                                         </screen>
457                                 </figure>
458                         </section>
459                         <section>
460                                 <title>Modify the OpenSRF Configuration File</title>
461                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, edit the OpenSRF configuration file <emphasis>/openils/conf/opensrf_core.xml</emphasis> to update the Jabber usernames and passwords, and to specify the domains from which we'll accept and to which we'll make connections.</para>
462                                 <para>If you are installing Evergreen on a single server and using the ~private.localhost~ / ~public.localhost~ domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values.</para>
463                                 <para><emphasis role="bold">Note:</emphasis> the following example uses common XPath syntax on the left-hand side to indicate the position within the XML file:</para>
464                                 <figure>
465                                         <title>Updates needed to the file /openils/conf/opensrf_core.xml</title>
466                                         <screen>
467                                         /config/opensrf/username  = opensrf
468                                         /config/opensrf/passwd    = password for **private.localhost** opensrf user
469                                         /config/gateway/username  = opensrf
470                                         /config/gateway/passwd    = password for **public.localhost** opensrf user
471                                         /config/routers/router/transport - first entry, where ''transport/server'' == **public.localhost** :
472                                             username = router
473                                             password = password for **public.localhost** router user
474                                         /config/routers/router/transport'' - second entry, where ''transport/server'' == **private.localhost** :
475                                             username = router
476                                             password = password for **private.localhost** router user
477                                         </screen>
478                                 </figure>
479                                 <para>[[ better diagram needed here ]]</para>
480                         </section>
481                         <section>
482                                 <title>Create Private Configuration Files for Certain Users</title>
483                                 <para>Copy the file <emphasis>/openils/conf/srfsh.xml.example</emphasis> to the file <emphasis>.srfsh.xml</emphasis> in the home directory of each user you want to use to run the <emphasis role="bold">srfsh</emphasis> command line client for testing OpenSRF. Finally, edit each file <emphasis>.srfsh.xml</emphasis> and make the following changes:</para>
484                                 <itemizedlist>
485                                         <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>
486                                         <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>
487                                         <listitem>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access</listitem>
488                                         <listitem>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing</listitem>
489                                 </itemizedlist>
490                                 <figure>
491                                         <title>Sample of configuration file /openils/conf/srfsh.xml.example</title>
492                                         <screen>
493                                         &lt;?xml version="1.0"?>
494                                         &lt;!-- This file follows the standard bootstrap config file layout found in opensrf_core.xml -->
495                                         &lt;srfsh>
496                                         &lt;router_name>router&lt;/router_name>
497                                         &lt;domain>private.localhost&lt;/domain>
498                                         &lt;username>opensrf&lt;/username>
499                                         &lt;passwd>evergreen&lt;/passwd>
500                                         &lt;port>5222&lt;/port>
501                                         &lt;logfile>/tmp/srfsh.log&lt;/logfile>
502                                         &lt;!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
503                                         &lt;loglevel>4&lt;/loglevel>
504                                         &lt;/srfsh>
505                                         </screen>
506                                 </figure>
507                         </section>
508                         <section>
509                                 <title>Modify the OpenSRF Environment</title>
510                                 <para>As the <emphasis role="bold">opensrf</emphasis> user, change the permissions of files to <emphasis>executable</emphasis> in the directory <emphasis>/openils/var/cgi-bin</emphasis>, then add a Perl environmental variable to the shell configuration file <emphasis>~/.bashrc</emphasis> for the user <emphasis role="bold">opensrf</emphasis>.</para>
511                                 <para><emphasis role="bold">Note:</emphasis> in a multi-server environment, you must add the modifications to <emphasis role="bold">~/.bashrc</emphasis> at 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.</para>
512                                 <figure>
513                                         <title>Modify the OpenSRF environment</title>
514                                         <screen>
515                                         # change permissions
516                                         $ sudo su - opensrf
517                                         $ chmod 755 /openils/var/cgi-bin/*.cgi
518
519                                         # add environmental variable
520                                         $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc
521                                         $ . ~/.bashrc    # inherit the new environment
522                                         </screen>
523                                 </figure>
524                         </section>
525                         <section>
526                                 <title>(OPTIONAL) Configuration for Other Languages</title>
527                                 <para>Load translations such as Armenian (hy-AM), Canadian French (fr-CA), and others into the database to complete the translations available in the OPAC and staff client. See [[server_installation:adding_localizations|these instructions]] for details.</para>
528                         </section>
529                 </section>
530                 <section xml:id="serverinstallation-ubuntu-debian-starting">
531                         <title>Starting the Server</title>
532                 </section>
533                 <section xml:id="serverinstallation-ubuntu-debian-testing-connections">
534                         <title>Testing Connections to the Server</title>
535                 </section>
536                 <section xml:id="serverinstallation-ubuntu-debian-starting-webserver">
537                         <title>Starting the Web Server</title>
538                 </section>
539                 <section xml:id="serverinstallation-ubuntu-debian-stopping">
540                         <title>Stopping the Server</title>
541                 </section>
542                 <section xml:id="serverinstallation-ubuntu-debian-reports">
543                         <title>Setting Up Support For Reports</title>
544                 </section>
545         </section>
546         <section xml:id="serversideinstallation-opensrf">
547                 <title>Installing OpenSRF 1.2.x</title>
548                 <para>[[ Installing OpenSRF 1.2.x ]]</para>
549         </section>
550         <section xml:id="serversideinstallation-ubuntudebian-previous">
551                 <title>Installing Evergreen 1.4.0.x on Ubuntu or Debian</title>
552                 <para>[[ Installing Evergreen 1.4.0.x on Ubuntu or Debian ]]</para>
553         </section>
554         <section xml:id="serversideinstallation-opensrf-previous">
555                 <title>Installing OpenSRF 1.0.x</title>
556                 <para>[[ Installing OpenSRF 1.0.x ]]</para>
557         </section>
558         <section xml:id="serversideinstallation-organizationandpolicy">
559                 <title>Organization and Policy Editing</title>
560                 <para>[[ Organization and Policy Editing ]] </para>
561         </section>
562         <section xml:id="serversideinstallation-testing">
563                 <title>Testing the Installation</title>
564                 <section xml:id="serversideinstallation-testing-srfsh">
565                         <title>Testing with srfsh</title>
566                         <para>Installing OpenILS will place an executable called 'srfsh' (surf shell) into the BINDIR directory. This is a command line diagnostic tool for interacting with the OpenSRF network.</para>
567                         <para>For starters, there is a command called math_bench in srfsh that sends queries to the math servers. Note that opensrf.math and opensrf.dbmath must be running for this command to work:</para>
568                         <screen>
569                         srfsh# math_bench 10
570                         |.........|.........|.........|.........|.........|.........|.........|.........|.........|.........
571                         
572                         ++++++++++++++++++++++++++++++++++++++++
573                          Average round trip time: 0.033425
574                         srfsh#
575                         </screen>
576                         <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>
577                         <para>For other srfsh commands, type 'help' in at the prompt.</para>
578                 </section>
579                 <section xml:id="serversideinstallation-testing-opac">
580                         <title>Testing the OPAC</title>
581                         <para>By default, the OPAC will live at the URL <emphasis>http://my.domain.com/opac/</emphasis>.</para>
582                         <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>
583                         <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>
584                         <para>[[ other simple functional tests ]]</para>
585                 </section>
586         </section>
587         <section xml:id="serversideinstallation-buildingstaffclient">
588                 <title>Building the Staff Client</title>
589                 <para>[[ Building the Staff Client ]]</para>
590         </section>
591         <section xml:id="serversideinstallation-localizations">
592                 <title>Language Localization</title>
593                 <para>[[ Adding Localized Languages to the Database ]]</para>
594         </section>
595         <section xml:id="serversideinstallation-sip">
596                 <title>Installing the SIP Server</title>
597                 <para>[[ Installing the SIP Server ]]</para>
598         </section>
599         <section xml:id="serversideinstallation-nginx">
600                 <title>Using nginx to serve static content</title>
601                 <para>[[ Using nginx to serve static content ]]</para>
602         </section>
603 </chapter>