]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/ServersideInstallation.xml
add section "Installing In Virtualized Linux Environments";
[working/Evergreen.git] / 1.6 / admin / ServersideInstallation.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
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">\r
3         <info>\r
4                 <title>Server-side Installation of Evergreen Software</title>\r
5                 <abstract>\r
6                         <para>This section describes installation of the Evergreen server-side software and its associated components. Installation, configuration, testing and verification \r
7                         of the software is straightforward if you follow some simple directions.</para>\r
8                 </abstract>\r
9         </info>\r
10         <para>Installing, configuring and testing the Evergreen server-side software is straightforward with the current stable software release. See \r
11                 <xref linkend="serversideinstallation-all"/> for instructions tailored to installing on some particular distributions of the <systemitem class="osname">Linux</systemitem> \r
12                 operating system. Earlier software distributions are described in <xref linkend="serversideinstallation-previousversions"/>.</para>\r
13         <para>The current version of the Evergreen server-side software runs as a native application on any of several well-known <systemitem class="osname">Linux</systemitem> \r
14                 distributions (e.g., <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem>). It does not currently run as a native application \r
15                 on the <systemitem class="osname">Microsoft Windows</systemitem> operating system (e.g., <systemitem class="osname">WindowsXP</systemitem>, \r
16                 <systemitem class="osname">WindowsXP Professional</systemitem>, <systemitem class="osname">Windows7</systemitem>), but the software can still be installed and run on \r
17                 <systemitem class="osname">Windows</systemitem> via a so-called <emphasis>virtualized</emphasis> Linux-guest Operating System (using, for example, \r
18                 <application>"VirtualBox"</application>, or <application>"VMware"</application>, or <application>"VirtualPC"</application> to emulate a \r
19                 <systemitem class="osname">Linux</systemitem> environment). It can also be installed to run on other <systemitem class="osname">Linux</systemitem> systems via virtualized \r
20                 environments (using, for example, <application>"VirtualBox"</application> or <application>"VMware"</application>). More information on virtualized environments can be \r
21                 found in <xref linkend="serversideinstallation-virtual"/>.</para>\r
22         <para>Installation of the Evergreen Staff Client software is reviewed in <xref linkend="serversideinstallation-staffclient"/>. </para>\r
23         <para>The Evergreen server-side software has dependencies on particular versions of certain major software sub-components. Successful installation of Evergreen \r
24                         software requires that software versions agree with those listed here:</para>\r
25         <table xml:id="serversideinstall-software-dependencies">\r
26                 <title>Evergreen Software Dependencies</title>\r
27                 <tgroup align="left" cols="3" colsep="1" rowsep="1">\r
28                         <colspec colname="Evergreen" colnum="1" colwidth="1.0*"/>\r
29                         <colspec colname="OpenSRF" colnum="2" colwidth="1.0*"/>\r
30                         <colspec colname="PostgreSQL" colnum="3" colwidth="1.0*"/>\r
31                         <thead>\r
32                                 <row>\r
33                                         <entry>Evergreen</entry>\r
34                                         <entry>OpenSRF</entry>\r
35                                         <entry>PostgreSQL</entry>\r
36                                 </row>\r
37                         </thead>\r
38                         <tbody>\r
39                                 <row>\r
40                                         <entry>1.6.x</entry>\r
41                                         <entry>1.2</entry>\r
42                                         <entry>8.2 / 8.3</entry>\r
43                                 </row>\r
44                                 <row>\r
45                                         <entry>1.4.x</entry>\r
46                                         <entry>1.0</entry>\r
47                                         <entry>8.1 / 8.2</entry>\r
48                                 </row>\r
49                                 <row>\r
50                                         <entry>1.2.x</entry>\r
51                                         <entry>0.9</entry>\r
52                                         <entry>8.1 / 8.2</entry>\r
53                                 </row>\r
54                         </tbody>\r
55                 </tgroup>\r
56         </table>\r
57         <section xml:id="serversideinstallation-all">\r
58                 <title>Installing Server-Side Software</title>\r
59                 <para>This section describes the installation of the major components of Evergreen server-side software.</para>\r
60                 <para>As far as possible, you should perform the following steps in the exact order given since the success of many steps relies on the successful completion of earlier steps. You \r
61                 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 \r
62                 and resume the installation from a known state. See <xref linkend="backingup"/> for further information.</para>\r
63                 <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 \r
64                 the series of regularly scheduled system backups that you should probably also begin.</para>\r
65                 <section xml:id="serversideinstallation-opensrf">\r
66                         <title>Installing OpenSRF 1.2.2 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>\r
67                         <para>This section describes the installation of the latest version of the Open Service Request Framework (OpenSRF), a major component of the Evergreen server-side software, \r
68                         on <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> systems. Evergreen software is integrated with and depends on the \r
69                         OpenSRF software system.</para>\r
70                         <para>Follow the steps outlined here and run the specified tests to ensure that OpenSRF is properly installed and configured. Do not continue with any further \r
71                         Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>\r
72                         <note>\r
73                                 <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) platforms. OpenSRF 1.2.2 has been tested on <systemitem class="osname">Debian Etch \r
74                                 (4.0)</systemitem>, <systemitem class="osname">Debian Lenny</systemitem>, <systemitem class="osname">Ubuntu Hardy Heron (8.04)</systemitem>, and \r
75                                 <systemitem class="osname">Ubuntu Intrepid Ibex (8.10)</systemitem>.</para>\r
76                                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the \r
77                                 <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>\r
78                                 <itemizedlist>\r
79                                         <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command \r
80                                         <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
81                                         <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command \r
82                                         <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
83                                 </itemizedlist>\r
84                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to \r
85                                 switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command \r
86                                 <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue \r
87                                 the command <command>exit"</command>.</para>\r
88                         </note>\r
89                         <procedure>\r
90                                 <step>\r
91                                         <title>Add the OpenSRF User</title>\r
92                                         <para>As the <systemitem class="username">root</systemitem> user, add the opensrf user to the system. The default shell for the new user is automatically set to \r
93                                         <command>/bin/bash</command> to inherit a reasonable environment:</para>\r
94                                         <screen>\r
95                                                 <userinput>useradd -m -s /bin/bash opensrf</userinput>\r
96                                                 <userinput>passwd opensrf</userinput>\r
97                                         </screen>\r
98                                 </step>\r
99                                 <step>\r
100                                         <title>Download and Unpack Latest OpenSRF Version</title>\r
101                                         <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of OpenSRF. The latest version can be found here: \r
102                                         <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz"></ulink></para>\r
103                                         <screen>\r
104                                                 <userinput>wget http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz</userinput>\r
105                                                 <userinput>tar zxf OpenSRF-1.2.2.tar.gz</userinput>\r
106                                         </screen>\r
107                                         <para>The new directory <filename class="directory">/home/opensrf/OpenSRF-1.2.2</filename> will be created.</para>\r
108                                 </step>\r
109                                 <step>\r
110                                         <title>Install Prerequisites to Build OpenSRF</title>\r
111                                         <para>In this section you will install and configure a set of prerequisites that will be used to build OpenSRF. In a following step you will actually build the \r
112                                         software using the <command>make</command> utility.</para>\r
113                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that \r
114                                         you just downloaded and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the example with the keyword corresponding to the actual \r
115                                         <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-opensrf">distribution \r
116                                         keywords</link>table.</para>\r
117                                         <screen>\r
118                                                 <userinput>cd /home/opensrf/OpenSRF-1.2.2</userinput>\r
119                                                 <userinput>make -f src/extras/Makefile.install [DISTRIBUTION]</userinput>\r
120                                         </screen>\r
121                                         <table xml:id="serversideinstallation-keywords-opensrf">\r
122                                                 <title>Keywords Targets for <application>"make"</application> Command</title>\r
123                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
124                                                         <colspec colnum="1" colwidth="1.0*"/>\r
125                                                         <colspec colnum="2" colwidth="3.0*"/>\r
126                                                         <thead>\r
127                                                                 <row>\r
128                                                                         <entry>Keyword</entry>\r
129                                                                         <entry>Description</entry>\r
130                                                                 </row>\r
131                                                         </thead>\r
132                                                         <tbody>\r
133                                                                 <row>\r
134                                                                         <entry>debian-lenny</entry>\r
135                                                                         <entry>for Debian Lenny (5.0)</entry>\r
136                                                                 </row>\r
137                                                                 <row>\r
138                                                                         <entry>debian-etch</entry>\r
139                                                                         <entry>for Debian Etch (4.0)</entry>\r
140                                                                 </row>\r
141                                                                 <row>\r
142                                                                         <entry>ubuntu-karmic</entry>\r
143                                                                         <entry>for Ubuntu Karmic (9.10)</entry>\r
144                                                                 </row>\r
145                                                                 <row>\r
146                                                                         <entry>ubuntu-intrepid</entry>\r
147                                                                         <entry>for Ubuntu Jaunty (9.04) or Intrepid (8.10)</entry>\r
148                                                                 </row>\r
149                                                                 <row>\r
150                                                                         <entry>ubuntu-hardy</entry>\r
151                                                                         <entry>for Ubuntu Hardy (8.04)</entry>\r
152                                                                 </row>\r
153                                                         </tbody>\r
154                                                 </tgroup>\r
155                                         </table>\r
156                                         <indexterm>\r
157                                                 <primary>ZZZ-REVIEW</primary>\r
158                                                 <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>\r
159                                         </indexterm>\r
160                                         <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>\r
161                                         <para>This will install a number of packages on the system that are required by OpenSRF, including some Perl modules from CPAN. You can say <literal>No</literal> to \r
162                                         the initial CPAN configuration prompt to allow it to automatically configure itself to download and install Perl modules from CPAN. The CPAN installer will \r
163                                         ask you a number of times whether it should install prerequisite modules - say <literal>Yes</literal>.</para>\r
164                                 </step>\r
165                                 <step>\r
166                                         <title>Configure OpenSRF</title>\r
167                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to the OpenSRF build directory and use the <command>configure</command> \r
168                                         utility to prepare for the next step of compiling and linking the software. You can include the  <option>--enable-python</option> and \r
169                                         <option>--enable-java</option> configuration options if you wish to include support for Python and Java, respectively:</para>\r
170                                         <screen>\r
171                                                 <userinput>cd /home/opensrf/OpenSRF-1.2.2</userinput>\r
172                                                 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>\r
173                                                 <userinput>make</userinput>\r
174                                         </screen>\r
175                                 </step>\r
176                                 <step>\r
177                                         <title>Compile, Link and Install OpenSRF</title>\r
178                                         <para>As the <systemitem class="username">root</systemitem> user, return to the OpenSRF build directory and use the <command>make</command> utility to compile, \r
179                                         link and install OpenSRF:</para>\r
180                                         <screen>\r
181                                                 <userinput>cd /home/opensrf/OpenSRF-1.2.2</userinput>\r
182                                                 <userinput>make install</userinput>\r
183                                         </screen>\r
184                                 </step>\r
185                                 <step>\r
186                                         <title>Update the System Dynamic Library Path</title>\r
187                                         <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly \r
188                                         installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/osrf.conf</filename> containing a new library path, then run the \r
189                                         command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>\r
190                                         <screen>\r
191                                                 <userinput>echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf</userinput>\r
192                                                 <userinput>ldconfig</userinput>\r
193                                         </screen>\r
194                                 </step>\r
195                                 <step>\r
196                                         <title>Define Public and Private OpenSRF Domains</title>\r
197                                         <para>Define your public and private OpenSRF domains. For security purposes, OpenSRF uses Jabber domains to separate services into public and private realms. \r
198                                         Throughout these instructions, we will use the example domains <systemitem class="domainname">public.localhost</systemitem> for the public domain and \r
199                                         <systemitem class="domainname">private.localhost</systemitem> for the private domain. On a single-server system, the easiest way to define public and \r
200                                         private domains is to define separate host names by adding entries to the file <filename>/etc/hosts</filename>.</para>\r
201                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/hosts</filename> and add the following entries for \r
202                                         our example domains:</para>\r
203                                         <screen>\r
204 127.0.1.2       public.localhost        public\r
205 127.0.1.3       private.localhost       private\r
206 </screen>\r
207                                 </step>\r
208                                 <step>\r
209                                         <title>Change File Ownerships</title>\r
210                                         <para>As the <systemitem class="username">root</systemitem> user, change the ownership of files installed in the directory \r
211                                         <filename class="directory">/openils</filename> to the <systemitem class="username">opensrf</systemitem> user:</para>\r
212                                         <screen>\r
213                                                 <userinput>chown -R opensrf:opensrf /openils</userinput>\r
214                                         </screen>\r
215                                 </step>\r
216                                 <step>\r
217                                         <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>\r
218                                         <para>As the <systemitem class="username">root</systemitem> user, stop the <systemitem class="service">ejabberd</systemitem> service:</para>\r
219                                         <screen>\r
220 $ /etc/init.d/ejabberd stop\r
221 </screen>\r
222                                         <para>If <systemitem class="service">ejabberd</systemitem> eeports that it is already stopped, it may have run into a problem starting back at the \r
223                                         installation stage. One possible fix is to kill any remaining <systemitem class="daemon">beam</systemitem> and \r
224                                         <systemitem class="daemon">epmd</systemitem> processes, then edit the configuration file <filename>/etc/ejabberd/ejabberd.cfg</filename> to hardcode a \r
225                                         domain:</para>\r
226                                         <screen>\r
227                                                 <userinput>epmd -kill</userinput>\r
228                                                 <userinput>killall beam; killall beam.smp</userinput>\r
229                                                 <userinput>rm /var/lib/ejabberd/*</userinput>\r
230                                                 <userinput>echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd</userinput>\r
231                                         </screen>\r
232                                 </step>\r
233                                 <step>\r
234                                         <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>\r
235                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following \r
236                                         changes:</para>\r
237                                         <itemizedlist>\r
238                                                 <listitem>Change <literal>{hosts, ["localhost"]}.</literal> to <literal>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</literal></listitem>\r
239                                                 <listitem>Change <literal>{max_user_sessions, 10}.</literal> to <literal>{max_user_sessions, 10000}.</literal> If you see something like this instead: \r
240                                                 <literal>{access, max_user_sessions, [{10, all}]}.</literal>, then change it to <literal>{access, max_user_sessions, [{10000, all}]}.</literal></listitem>\r
241                                                 <listitem>Change all three occurrences of <literal>max_stanza_size</literal> to <literal>2000000</literal>.</listitem>\r
242                                                 <listitem>Change both occurrences of <literal>maxrate</literal> to <literal>500000</literal>.</listitem>\r
243                                                 <listitem>Comment out the line <literal>{mod_offline, []}</literal> by placing two <literal>%</literal> comment signs in front.</listitem>\r
244                                         </itemizedlist>\r
245                                 </step>\r
246                                 <step xml:id="serversideinstallation-opensrf-continued">\r
247                                         <title>Restart the <systemitem class="service">ejabberd</systemitem> service</title>\r
248                                         <para>As the <systemitem class="username">root</systemitem> user, restart the <systemitem class="service">ejabberd</systemitem> service to test the configuration \r
249                                         changes and to register your users:</para>\r
250                                         <screen>\r
251                                                 <userinput>/etc/init.d/ejabberd start</userinput>\r
252                                         </screen>\r
253                                 </step>\r
254                                 <step>\r
255                                         <title>Register <systemitem class="username">router</systemitem> and <systemitem class="username">ejabberd</systemitem> users</title>\r
256                                         <para>On each domain, you need two <systemitem class="service">ejabberd</systemitem> users to manage the OpenSRF communications:</para>\r
257                                         <itemizedlist>\r
258                                                 <listitem>a <systemitem class="username">router</systemitem> user, to whom all requests to connect to an OpenSRF service will be routed; this \r
259                                                 <systemitem class="service">ejabberd</systemitem> user must be named <systemitem class="username">router</systemitem></listitem>\r
260                                                 <listitem>an <systemitem class="username">opensrf</systemitem> user, which clients use to connect to OpenSRF services; this user can be named anything you \r
261                                                 like, but we will use <literal>opensrf</literal> in our examples</listitem>\r
262                                         </itemizedlist>\r
263                                         <para>As the <systemitem class="username">root</systemitem> user, use the <command>ejabberdctl</command> utility to register your ejabber users \r
264                                         <emphasis>router</emphasis> and <emphasis>opensrf</emphasis> for the OpenSRF router service on each domain. The users should have different passwords on \r
265                                         each domain. The syntax for registering a user with ejabberdctl is  <command>ejabberdctl register &lt;user> &lt;domain> &lt;password></command>\r
266                                         These users will correspond to those configured in the file <filename>/openils/conf/opensrf_core.xml</filename>:</para>\r
267                                         <screen>\r
268                                                 <userinput>ejabberdctl register router private.localhost  &lt;password></userinput>\r
269                                                 <userinput>ejabberdctl register opensrf private.localhost &lt;password></userinput>\r
270                                                 <userinput>ejabberdctl register router public.localhost   &lt;password></userinput>\r
271                                                 <userinput>ejabberdctl register opensrf public.localhost  &lt;password></userinput>\r
272                                         </screen>\r
273                                 </step>\r
274                                 <step>\r
275                                         <title>Create configuration files</title>\r
276                                         <para>As the <systemitem class="username">opensrf</systemitem> user, use the example templates to create the configuration files \r
277                                         <filename>/openils/conf/opensrf_core.xml</filename> and <filename>/openils/conf/opensrf.xml</filename>:</para>\r
278                                         <screen>\r
279                                                 <userinput>cd /openils/conf</userinput>\r
280                                                 <userinput>cp opensrf.xml.example      opensrf.xml</userinput>\r
281                                                 <userinput>cp opensrf_core.xml.example opensrf_core.xml</userinput>\r
282                                         </screen>\r
283                                 </step>\r
284                                 <step>\r
285                                         <title>Edit opensrf_core.xml</title>\r
286                                         <para>Edit the file <filename>/openils/conf/opensrf_core.xml</filename> to change the <systemitem class="service">ejabberd</systemitem> usernames and passwords as \r
287                                         follows.</para>\r
288                                         <note>\r
289                                                 <para>\r
290                                                         <emphasis>The following example uses common XPath syntax on the left-hand side to indicate the approximate position needing changes within the XML \r
291                                                         file.</emphasis>\r
292                                                 </para>\r
293                                         </note>\r
294                                         <para>/config/opensrf/username = <systemitem class="username">opensrf</systemitem></para>\r
295                                         <para>/config/opensrf/passwd = password for <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">opensrf</systemitem> user</para>\r
296                                         <para>/config/opensrf/passwd = password for <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">opensrf</systemitem>  user</para>\r
297                                         <para>/config/gateway/username = <systemitem class="username">opensrf</systemitem></para>\r
298                                         <para>/config/gateway/passwd = password for <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">opensrf</systemitem>  user</para>\r
299                                         <para>/config/routers/router/transport  (first entry, where \r
300                                                 <quote>transport/server</quote> ==<systemitem class="domainname">public.localhost</systemitem>)</para>\r
301                                         <itemizedlist>\r
302                                                 <listitem>username = <systemitem class="username">router</systemitem></listitem>\r
303                                                 <listitem>password = password for <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">router</systemitem> \r
304                                                                 user</listitem>\r
305                                         </itemizedlist>\r
306                                         <para>/config/routers/router/transport  (second entry, where \r
307                                                 <quote>transport/server</quote> == <systemitem class="domainname">private.localhost</systemitem>) </para>\r
308                                         <itemizedlist>\r
309                                                 <listitem>username = <systemitem class="username">router</systemitem></listitem>\r
310                                                 <listitem>password = password for <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">router</systemitem> \r
311                                                                 user</listitem>\r
312                                         </itemizedlist>\r
313                                         <para>You also need to specify the domains from which <systemitem class="service">OpenSRF</systemitem> will accept and to which \r
314                                         <systemitem class="service">OpenSRF</systemitem> will make connections. If you are installing <application>OpenSRF</application> on a single server and using the \r
315                                         <systemitem class="domainname">private.localhost</systemitem> / <systemitem class="domainname">public.localhost</systemitem> domains, these will already be set to \r
316                                         the correct values. Otherwise, search and replace to match your values.</para>\r
317                                 </step>\r
318                                 <step>\r
319                                         <title>Modify the file <filename>opensrf.xml</filename></title>\r
320                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the file <filename>/openils/conf/opensrf.xml</filename> to set the location of the \r
321                                         persistent database in the <literal>dbfile</literal> element near the end of the file:</para>\r
322                                         <programlisting language="xml"><![CDATA[\r
323 <!-- Example of an app-specific setting override -->\r
324 <opensrf.persist>\r
325   <app_settings>\r
326     <dbfile>/tmp/persist.db</dbfile>\r
327   </app_settings>\r
328 </opensrf.persist>\r
329 ]]></programlisting>\r
330                                 </step>\r
331                                 <step>\r
332                                         <title>Create Configuration Files for Users Needing <command>srfsh</command></title>\r
333                                         <para>In this section you will set up a special configuration file for each user who will need to run the <command>srfsh</command> \r
334                                         (pronounced <emphasis>surf shell</emphasis>) utility.</para>\r
335                                         <para>The software installation will automatically create <command>srfsh</command>. This is a command line diagnostic tool for testing and interacting with \r
336                                         <application>OpenSRF</application>. It will be used in a future step to complete and test the Evergreen installation. \r
337                                         See <xref linkend="serversideinstallation-testing"/> for further information.</para>\r
338                                         <para>As the <systemitem class="username">root</systemitem> user, copy the short sample configuration file <filename>/openils/conf/srfsh.xml.example</filename> \r
339                                         to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of each user who will use <command>srfsh</command>. Finally, \r
340                                         edit each file <filename>.srfsh.xml</filename> and make the following changes. When you finish, remember to change the owner of the file to match the owner of the \r
341                                         home directory.</para>\r
342                                         <itemizedlist>\r
343                                                 <listitem>Modify <literal>domain</literal> to be the router hostname (following our domain examples, \r
344                                                 <systemitem class="domainname">private.localhost</systemitem> will give <command>srfsh</command> access to all OpenSRF services, \r
345                                                 while <systemitem class="domainname">public.localhost</systemitem> will only allow access to those OpenSRF services that are publicly exposed).</listitem>\r
346                                                 <listitem>Modify <literal>username</literal> and <literal>password</literal> to match the <literal>opensrf</literal> Jabber user for the chosen \r
347                                                 domain</listitem>\r
348                                                 <listitem>Modify <literal>logfile</literal> to be the full path for a log file to which the user has write access</listitem>\r
349                                                 <listitem>Modify <literal>loglevel</literal> as needed for testing</listitem>\r
350                                         </itemizedlist>\r
351                                         <programlisting language="xml"><![CDATA[\r
352 <?xml version="1.0"?>\r
353 <!-- This file follows the standard bootstrap config file layout -->\r
354 <!-- found in opensrf_core.xml -->\r
355 <srfsh>\r
356 <router_name>router</router_name>\r
357 <domain>private.localhost</domain>\r
358 <username>opensrf</username>\r
359 <passwd>privsrf</passwd>\r
360 <port>5222</port>\r
361 <logfile>/tmp/srfsh.log</logfile>\r
362 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->\r
363 <loglevel>4</loglevel>\r
364 </srfsh>\r
365 ]]></programlisting>\r
366                                 </step>\r
367                                 <step>\r
368                                         <title>Modify Environmental Variable PATH for <systemitem class="username">opensrf</systemitem> User</title>\r
369                                         <para>As the <systemitem class="username">opensrf</systemitem> user, modify the environmental variable <envar>PATH</envar> by adding a new file path to \r
370                                         the <systemitem class="username">opensrf</systemitem> user's shell configuration file <filename>.bashrc</filename>:</para>\r
371                                         <screen>\r
372                                                 <userinput>echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc</userinput>\r
373                                         </screen>\r
374                                 </step>\r
375                                 <step>\r
376                                         <title>Start OpenSRF</title>\r
377                                         <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and \r
378                                         <systemitem class="service">memcached</systemitem> services:</para>\r
379                                         <screen>\r
380                                                 <userinput>/etc/init.d/ejabberd start</userinput>\r
381                                                 <userinput>/etc/init.d/memcached start</userinput>\r
382                                         </screen>\r
383                                         <para>Finally, as the <systemitem class="username">opensrf</systemitem> user, start OpenSRF:</para>\r
384                                         <screen>\r
385                                                 <userinput>start the OpenSRF service:</userinput>\r
386                                                 <userinput>use "-l" to force hostname to be "localhost"</userinput>\r
387                                                 <userinput>osrf_ctl.sh -l -a start_all</userinput>\r
388                                         </screen>\r
389                                         <note>\r
390                                                 <para>If you receive the error message <errortext>bash: osrf_ctl.sh: command not found</errortext>, then your environment variable <envar>PATH</envar> does \r
391                                                 not include the <filename class="directory">/openils/bin</filename> directory; \r
392                                                 this should have been set by <filename>.bashrc</filename> when you logged in as the <systemitem class="username">opensrf</systemitem> user, but you \r
393                                                 can manually set it using the following command:</para>\r
394                                                 <screen>\r
395                                                         <userinput>export PATH=$PATH:/openils/bin</userinput>\r
396                                                 </screen>\r
397                                         </note>\r
398                                         <para>You can also start Evergreen <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but <command>osrf_ctl.sh</command> must know the \r
399                                         fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file \r
400                                         <filename>opensrf.xml</filename>, \r
401                                         which you configured in a previous step.</para>\r
402                                 </step>\r
403                                 <step>\r
404                                         <title>Test connections to OpenSRF</title>\r
405                                         <para>Once you have installed and started OpenSRF, as the <systemitem class="username">root</systemitem> user, test your connection to \r
406                                         <systemitem class="service">OpenSRF</systemitem> \r
407                                         using the <command>srfsh</command> utility and trying to call the <command>add</command> method on the OpenSRF \r
408                                         <systemitem class="service">math</systemitem> service:</para>\r
409                                         <screen><userinput>/openils/bin/srfsh</userinput><prompt>srfsh#</prompt> <userinput>request opensrf.math add 2 2</userinput>\r
410 Received Data: 4\r
411 ------------------------------------\r
412 Request Completed Successfully\r
413 Request Time in seconds: 0.007519\r
414 ------------------------------------\r
415 <prompt>srfsh#</prompt></screen>\r
416                                         <para>For other <command>srfsh</command> commands, type <userinput>help</userinput> in at the prompt.</para>\r
417                                 </step>\r
418                                 <step>\r
419                                         <title>Stopping OpenSRF</title>\r
420                                         <para>As the <systemitem class="username">opensrf</systemitem> user, stop OpenSRF:</para>\r
421                                         <screen>\r
422                                                 <userinput>osrf_ctl.sh -l -a stop_all</userinput>\r
423                                         </screen>\r
424                                 </step>\r
425                         </procedure>\r
426                 </section>\r
427                 <section xml:id="serversideinstallation-ubuntudebian">\r
428                         <title>Installing Evergreen 1.6.0.7 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>\r
429                         <para>This section outlines the installation process for the latest stable version of Evergreen.</para>\r
430                         <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 \r
431                         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 \r
432                         around a few known issues.</para>\r
433                         <note>\r
434                                 <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 \r
435                                 of <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server edition.</para>\r
436                                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the \r
437                                 <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>\r
438                                 <itemizedlist>\r
439                                         <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command \r
440                                         <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
441                                         <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo \r
442                                         su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
443                                 </itemizedlist>\r
444                                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the command <command>su - USERNAME</command>. For example, to \r
445                                 switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command \r
446                                 <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again, simply issue the \r
447                                 command <command>exit</command>.</para>\r
448                         </note>\r
449                         <procedure>\r
450                                 <step>\r
451                                         <title>Install OpenSRF</title>\r
452                                         <para>Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, \r
453                                         configuring and testing OpenSRF, see <xref linkend="serversideinstallation-opensrf"/>.</para>\r
454                                         <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 \r
455                                         further Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>\r
456                                 </step>\r
457                                 <step>\r
458                                         <title>Download and Unpack Latest Evergreen Version</title>\r
459                                         <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of Evergreen. The latest version can be found here: \r
460                                         <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz"></ulink></para>\r
461                                         <screen>\r
462                                                 <userinput>wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz</userinput>\r
463                                                 <userinput>tar zxf Evergreen-ILS-1.6.0.7.tar.gz</userinput>\r
464                                         </screen>\r
465                                         <para>The new directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.6.0.7</filename> will be created.</para>\r
466                                 </step>\r
467                                 <step>\r
468                                         <title>Install Prerequisites to Build Evergreen</title>\r
469                                         <para>In this section you will install and configure a set of prerequisites that will be used to build Evergreen. In a following step you will actually build \r
470                                         the software using the <command>make</command> utility.</para>\r
471                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you \r
472                                         just downloaded and unpacked. Remember to replace <emphasis>[distribution]</emphasis> in the example with the keyword corresponding to the actual \r
473                                         <systemitem class="osname">Linux</systemitem> distribution listed in the \r
474                                         <link linkend="serversideinstallation-keywords-evergreen">distribution keywords</link> table.</para>\r
475                                         <screen>\r
476                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7</userinput>\r
477                                                 <userinput>make -f Open-ILS/src/extras/Makefile.install [distribution]</userinput>\r
478                                         </screen>\r
479                                         <table xml:id="serversideinstallation-keywords-evergreen">\r
480                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
481                                                         <colspec colnum="1" colwidth="1.0*"/>\r
482                                                         <colspec colnum="2" colwidth="3.0*"/>\r
483                                                         <thead>\r
484                                                                 <row>\r
485                                                                         <entry>Keyword</entry>\r
486                                                                         <entry>Description</entry>\r
487                                                                 </row>\r
488                                                         </thead>\r
489                                                         <tbody>\r
490                                                                 <row>\r
491                                                                         <entry>debian-lenny</entry>\r
492                                                                         <entry>for Debian Lenny (5.0), the most recent version</entry>\r
493                                                                 </row>\r
494                                                                 <row>\r
495                                                                         <entry>debian-etch</entry>\r
496                                                                         <entry>for Debian Etch (4.0)</entry>\r
497                                                                 </row>\r
498                                                                 <row>\r
499                                                                         <entry>ubuntu-karmic</entry>\r
500                                                                         <entry>for Ubuntu Lucid (10.04) [same as for Karmic]</entry>\r
501                                                                 </row>\r
502                                                                 <row>\r
503                                                                         <entry>ubuntu-karmic</entry>\r
504                                                                         <entry>for Ubuntu Karmic (9.10)</entry>\r
505                                                                 </row>\r
506                                                                 <row>\r
507                                                                         <entry>ubuntu-intrepid</entry>\r
508                                                                         <entry>for Ubuntu Intrepid (8.10)</entry>\r
509                                                                 </row>\r
510                                                                 <row>\r
511                                                                         <entry>ubuntu-hardy</entry>\r
512                                                                         <entry>for Ubuntu Hardy (8.04)</entry>\r
513                                                                 </row>\r
514                                                                 <row>\r
515                                                                         <entry>ubuntu-gutsy</entry>\r
516                                                                         <entry>for Ubuntu Gutsy (7.10)</entry>\r
517                                                                 </row>\r
518                                                                 <row>\r
519                                                                         <entry>gentoo</entry>\r
520                                                                         <entry>generic for Gentoo versions</entry>\r
521                                                                 </row>\r
522                                                                 <row>\r
523                                                                         <entry>centos</entry>\r
524                                                                         <entry>generic for Centos versions</entry>\r
525                                                                 </row>\r
526                                                         </tbody>\r
527                                                 </tgroup>\r
528                                         </table>\r
529                                         <indexterm>\r
530                                                 <primary>ZZZ-REVIEW</primary>\r
531                                                 <secondary>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </secondary>\r
532                                         </indexterm>\r
533                                         <caution>ADD INFO FOR OTHER LINUX DISTRIBUTIONS </caution>\r
534                                 </step>\r
535                                 <step xml:id="serversideinstallation-postgresql-default">\r
536                                         <title>(OPTIONAL) Install the PostgreSQL Server</title>\r
537                                         <para>Since the PostgreSQL server is usually a standalone server in multi-server production systems, the prerequisite installer Makefile in the previous step \r
538                                         does not automatically install PostgreSQL. If your PostgreSQL server is on a different system, just skip this step.</para>\r
539                                         <para>For further information on manually installing PostgreSQL, visit the <link xl:href="http://www.postgresql.org/">PostgreSQL Site</link>.</para>\r
540                                         <para>If your PostgreSQL server will be on the same system as your Evergreen software, then as the <systemitem class="username">root</systemitem> user install the \r
541                                         required PostgreSQL server packages:</para>\r
542                                         <screen>\r
543                                                 <userinput>su - root</userinput>\r
544                                         </screen>\r
545                                         <para>For <systemitem class="osname">Debian Lenny</systemitem> and <systemitem class="osname">Ubuntu Hardy (8.04)</systemitem>:</para>\r
546                                         <screen>\r
547                                                 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83</userinput>\r
548                                         </screen>\r
549                                         <para>For <systemitem class="osname">Ubuntu Karmic (9.10)</systemitem> and <systemitem class="osname">Ubuntu Lucid (10.04)</systemitem>:</para>\r
550                                         <screen>\r
551                                                 <userinput>make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84</userinput>\r
552                                         </screen>\r
553                                         <note>\r
554                                                 <para>Postgresql 8.3 or 8.4 are the recommended versions to work with Evergreen 1.6. If you have an older version of PostgreSQL, you should upgrade before \r
555                                                 installing Evergreen. To find the running version of PostgreSQL, switch to the <systemitem class="username">postgres</systemitem> user and run the \r
556                                                 <command>psql</command>. Then type <userinput>SELECT version();</userinput> to get detailed information of your version of PostgreSQL.</para>\r
557                                         </note>\r
558                                 </step>\r
559                                 <step performance="optional">\r
560                                         <title>Install Perl Modules on PostgreSQL Server</title>\r
561                                         <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>\r
562                                         <para>Otherwise, if your PostgreSQL server is running on another system, then as the <systemitem class="username">root</systemitem> user install the following Perl \r
563                                         modules on that system:</para>\r
564                                         <para>ensure the gcc compiler is installed:</para>\r
565                                         <screen>\r
566                                                 <userinput>apt-get install gcc</userinput>\r
567                                         </screen>\r
568                                         <para>install the Perl modules</para>\r
569                                         <screen><userinput>perl -MCPAN -e shell</userinput><prompt>cpan></prompt> <userinput>install JSON::XS</userinput><prompt>cpan></prompt> <userinput>install MARC::Record</userinput><prompt>cpan></prompt> <userinput>install MARC::File::XML</userinput></screen>\r
570                                         <para>For more information on installing Perl Modules vist the <link xl:href="http://www.cpan.org/">CPAN</link> site.</para>\r
571                                 </step>\r
572                                 <step>\r
573                                         <title>Update the System Dynamic Library Path</title>\r
574                                         <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly \r
575                                         installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/eg.conf</filename> containing two new library path.</para>\r
576                                         <para>Create a file named /etc/ld.so.conf.d/eg.conf containing the following lines:</para>\r
577                                         <programlisting>\r
578 /usr/local/lib\r
579 /usr/local/lib/dbd\r
580 </programlisting>\r
581                                         <para>Then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>\r
582                                         <screen>\r
583                                                 <userinput>ldconfig</userinput>\r
584                                         </screen>\r
585                                 </step>\r
586                                 <step preformance="optional">\r
587                                         <title>Restart the PostgreSQL Server</title>\r
588                                         <para>If PostgreSQL is running on the same system as the rest of Evergreen, as the <systemitem class="username">root</systemitem> user you must restart \r
589                                         PostgreSQL. If PostgreSQL is running on another system, you may skip this step.</para>\r
590                                         <screen>\r
591                                                 <userinput>/etc/init.d/postgresql-[PGSQL_VERSION] restart</userinput>\r
592                                         </screen>\r
593                                         <para>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</para>\r
594                                 </step>\r
595                                 <step xml:id="serversideinstallation-configure">\r
596                                         <title>Configure Evergreen</title>\r
597                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to the Evergreen build directory and use the <command>configure</command> utility to \r
598                                         prepare for the next step of compiling and linking the software:</para>\r
599                                         <screen>\r
600                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7</userinput>\r
601                                                 <userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput>\r
602                                                 <userinput>make</userinput>\r
603                                         </screen>\r
604                                 </step>\r
605                                 <step xml:id="serversideinstallation-compilingevergreen">\r
606                                         <title>Compile, Link and Install Evergreen</title>\r
607                                         <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>\r
608                                         <para>As the <systemitem class="username">root</systemitem> user, return to the Evergreen build directory and use the <command>make</command> utility as \r
609                                         shown below. The Staff Client will also be automatically built, but you must remember to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version                                             of the Staff Client you will use to connect to the Evergreen server.</para>\r
610                                         <para>For further information on manually building the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>\r
611                                         <screen>\r
612                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7</userinput>\r
613                                                 <userinput>make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install</userinput>\r
614                                         </screen>\r
615                                         <para>The above commands will create a new subdirectory <filename class="directory">/openils/var/web/xul/rel_1_6_0_7</filename> containing the Staff Client.</para>\r
616                                         <para>To complete the Staff Client installation, as the <systemitem class="username">root</systemitem> user create a symbolic link named <emphasis>server</emphasis> \r
617                                         in the head of the Staff Client directory <filename class="directory">/openils/var/web/xul</filename> that points to the subdirectory \r
618                                         <filename class="directory">/server</filename> of the new Staff Client build:</para>\r
619                                         <screen>\r
620                                                 <userinput>cd /openils/var/web/xul</userinput>\r
621                                                 <userinput>ln -sf rel_1_6_0_7/server server</userinput>\r
622                                         </screen>\r
623                                 </step>\r
624                                 <step>\r
625                                         <title>Copy the OpenSRF Configuration Files</title>\r
626                                         <para>As the <systemitem class="username">root</systemitem> user, copy the example OpenSRF configuration files into place. This replaces the configuration \r
627                                         files that you set up in a previous step when you installed and tested OpenSRF. You should also create backup copies of the old files for troubleshooting \r
628                                         purposes. Finally, change the ownership on the installed files to the <systemitem class="username">opensrf</systemitem> user:</para>\r
629                                         <screen>\r
630                                                 <userinput>cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml</userinput>\r
631                                                 <userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput>\r
632                                                 <userinput>cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml</userinput>\r
633                                                 <userinput>chown -R opensrf:opensrf /openils/</userinput>\r
634                                         </screen>\r
635                                 </step>\r
636                                 <step>\r
637                                         <title>Create and Configure PostgreSQL Database</title>\r
638                                         <para>As the <systemitem class="username">postgres</systemitem> user on your PostgreSQL server, create the Evergreen database.</para>\r
639                                         <para>In the commands below, remember to adjust the path of the <emphasis role="bold">contrib</emphasis> repository to match your PostgreSQL server layout. For \r
640                                         example, if you built PostgreSQL from source the path would be <filename class="directory">/usr/local/share/contrib</filename>; if you installed the PostgreSQL 8.3 \r
641                                         server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>, the path would be \r
642                                         <filename class="directory">/usr/share/postgresql/8.3/contrib/</filename>.</para>\r
643                                         <substeps>\r
644                                                 <step>\r
645                                                         <para>\r
646                                                                 <emphasis role="bold">Create and configure the database</emphasis>\r
647                                                         </para>\r
648                                                         <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system create the PostgreSQL database, then set some internal \r
649                                                         paths:</para>\r
650                                                         <para>Create the database:</para>\r
651                                                         <screen>\r
652                                                                 <userinput>createdb -E UNICODE evergreen</userinput>\r
653                                                                 <userinput>createlang plperl   evergreen</userinput>\r
654                                                                 <userinput>createlang plperlu  evergreen</userinput>\r
655                                                                 <userinput>createlang plpgsql  evergreen</userinput>\r
656                                                         </screen>\r
657                                                         <para>Adjust the paths:</para>\r
658                                                         <screen>\r
659                                                                 <userinput>psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen</userinput>\r
660                                                                 <userinput>psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen</userinput>\r
661                                                                 <userinput>psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen</userinput>\r
662                                                         </screen>\r
663                                                         <para>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.3</literal>).</para>\r
664                                                 </step>\r
665                                                 <step>\r
666                                                         <title>Create a new Evergreen superuser</title>\r
667                                                         <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system, create the new database \r
668                                                         <systemitem class="username">evergreen</systemitem> user and assign a password:</para>\r
669                                                         <screen>\r
670                                                                 <userinput>createuser -P -s evergreen</userinput>\r
671                                                         </screen>\r
672                                                         <para>Enter the password twice for new role when prompted.</para>\r
673                                                 </step>\r
674                                                 <step>\r
675                                                         <title>Create Database Schema</title>\r
676                                                         <para>As the <systemitem class="username">root</systemitem> user, create the database schema and configure your system with the corresponding \r
677                                                         database authentication details for the <emphasis>evergreen</emphasis> database user that you created in the previous step.</para>\r
678                                                         <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate \r
679                                                         values.</para>\r
680                                                         <screen>\r
681                                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.6.0.7</userinput>\r
682                                                                 <userinput>perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \\r
683         --service all --create-schema --create-bootstrap --create-offline \\r
684         --hostname HOSTNAME --port PORT \\r
685         --user evergreen --password PASSWORD --database DATABASENAME</userinput>\r
686                                                         </screen>\r
687                                                         <para>On most systems, <emphasis>HOSTNAME</emphasis> will be <emphasis role="bold">localhost</emphasis>, <emphasis>PORT</emphasis> will be \r
688                                                         <emphasis role="bold">5432</emphasis>, and <emphasis>PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> will be\r
689                                                          <emphasis role="bold">evergreen</emphasis>.</para>\r
690                                                         <note>\r
691                                                                 <para>If you are entering the above command on a single line, do not include the <literal>\</literal> (backslash) characters. \r
692                                                                         If you are using the <command>bash</command> shell, these should only be used at the end of a line at a bash prompt to indicate \r
693                                                                         that the command is continued on the next line.</para>\r
694                                                         </note>\r
695                                                 </step>\r
696                                                 <step>\r
697                                                         <title>Modify the Apache configuration files for the Evergreen site.</title>\r
698                                                         <substeps>\r
699                                                                 <step>\r
700                                                                         <para>Enable some built-in Apache modules with the utility <command>a2enmod</command>, and install some additional Apache \r
701                                                                         configuration files. As the <systemitem class="username">root</systemitem> user, enable some modules in the Apache server, then copy \r
702                                                                         the new configuration files to the Apache server directories:</para>\r
703                                                                         <para>Enable the required Apache Modules:</para>\r
704                                                                         <screen>\r
705                                                                                 <userinput>a2enmod ssl       # enable mod_ssl</userinput>\r
706                                                                                 <userinput>a2enmod rewrite    # enable mod_rewrite</userinput>\r
707                                                                                 <userinput>a2enmod expires    # enable mod_expires</userinput>\r
708                                                                                 <userinput>cd /home/opensrf/Evergreen-ILS-1.x.x.x</userinput>\r
709                                                                         </screen>\r
710                                                                 </step>\r
711                                                                 <step>\r
712                                                                         <para>Copy the Apache configuration files from the Evergreen installation dierectory:</para>\r
713                                                                         <screen>\r
714                                                                                 <userinput>cp Open-ILS/examples/apache/eg.conf   /etc/apache2/sites-available/</userinput>\r
715                                                                                 <userinput>cp Open-ILS/examples/apache/eg_vhost.conf   /etc/apache2/</userinput>\r
716                                                                                 <userinput>cp Open-ILS/examples/apache/startup.pl      /etc/apache2/</userinput>\r
717                                                                         </screen>\r
718                                                                 </step>\r
719                                                                 <step xml:id="serversideinstallation-createsslkey">\r
720                                                                         <para>Create a new Security Certificate (SSL Key) for the Apache server with the command <command>openssl</command>. For a \r
721                                                                         public production server you should configure or purchase a signed SSL certificate, but for now you can just use a \r
722                                                                         self-signed certificate and accept the warnings in the Staff Client and browser during testing and development:</para>\r
723                                                                         <screen>\r
724                                                                                 <userinput>mkdir /etc/apache2/ssl</userinput>\r
725                                                                                 <userinput>cd /etc/apache2/ssl</userinput>\r
726                                                                                 <userinput>openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key</userinput>\r
727                                                                         </screen>\r
728                                                                         <note>\r
729                                                                                 <para>This generates a self-signed SSL certificate. You should acquire a proper SSL certificate for a public \r
730                                                                                 production system to avoid warning messages when users login to their account through the OPAC or when staff \r
731                                                                                 login through the staff client.</para>\r
732                                                                                 <para>For further information on getting a proper SSL certificate, see <xref linkend="serversideinstallation-ssl"/>.</para>\r
733                                                                         </note>\r
734                                                                 </step>\r
735                                                                 <step>\r
736                                                                         <para>Several changes are needed in the new Apache configuration file <filename>/etc/apache2/sites-available/eg.conf</filename>. \r
737                                                                 As the <systemitem class="username">root</systemitem> user, edit the file and make the following changes:</para>\r
738                                                                         <substeps>\r
739                                                                                 <step>\r
740                                                                                         <para>Comment out the line <literal>Listen 443</literal>, since it conflicts with the same declaration in the configuration \r
741                                                                                 file: <filename>/etc/apache2/ports.conf</filename>. <systemitem class="osname">Debian Etch</systemitem> users should not \r
742                                                                                 do this since the conflict does not apply to that OS.</para>\r
743                                                                                 </step>\r
744                                                                                 <step>\r
745                                                                                         <para>For the <systemitem class="osname">Linux</systemitem> distributions \r
746                                                                                 <systemitem class="osname">Ubuntu Hardy</systemitem> \r
747                                                                                 or <systemitem class="osname">Debian Etch</systemitem>, as the <systemitem class="username">root</systemitem> user, edit the \r
748                                                                                 Apache configuration file <filename>/etc/apache2/apache2.conf</filename> and change <literal>User www-data</literal> to \r
749                                                                                 <literal>User opensrf</literal>.</para>\r
750                                                                                         <para>For the <systemitem class="osname">Linux</systemitem> distributions <systemitem class="osname">Ubuntu \r
751                                                                                 Karmic</systemitem> or  <systemitem class="osname">Ubuntu Lucid</systemitem> or \r
752                                                                                 <systemitem class="osname">Debian Lenny</systemitem>, as the <systemitem class="username">root</systemitem> user, \r
753                                                                                 edit the Apache configuration file <filename>/etc/apache2/envvars</filename> and \r
754                                                                                 change the line <literal>export APACHE_RUN_USER=www-data</literal> to  <literal>export APACHE_RUN_USER=opensrf</literal>.\r
755                                                                                 </para>\r
756                                                                                         <para>The following updates are needed to allow the logs to function properly, but it may break other Apache applications \r
757                                                                                 on your server.</para>\r
758                                                                                 </step>\r
759                                                                         </substeps>\r
760                                                                 </step>\r
761                                                                 <step>\r
762                                                                         <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file \r
763                                                                 <filename>/etc/apache2/apache2.conf</filename> and add the lines <literal>KeepAliveTimeout 1</literal> and \r
764                                                                 <literal>MaxKeepAliveRequests 100</literal>, or modify any existing lines.</para>\r
765                                                                 </step>\r
766                                                         </substeps>\r
767                                                 </step>\r
768                                                 <step performance="optional">\r
769                                                         <title>Performance Modifications for Apache</title>\r
770                                                         <para>Some further configuration changes to Apache may be necessary for busy systems. These changes increase the number of Apache server processes that are \r
771                                                 started to support additional browser connections.</para>\r
772                                                         <para>As the <systemitem class="username">root</systemitem> user, edit the Apache configuration file <filename>/etc/apache2/apache2.conf</filename>, \r
773                                                 locate and modify the section related to <emphasis>prefork configuration</emphasis> to suit the load on your system.</para>\r
774                                                         <programlisting language="xml"><![CDATA[\r
775 <IfModule mpm_prefork_module>\r
776    StartServers           20\r
777    MinSpareServers         5\r
778    MaxSpareServers        15\r
779    MaxClients            150\r
780    MaxRequestsPerChild 10000\r
781 </IfModule>\r
782 ]]></programlisting>\r
783                                                 </step>\r
784                                                 <step>\r
785                                                         <para>Finally, as the <systemitem class="username">root</systemitem> user, execute the following Apache configuration commands to disable the default \r
786                                                 <emphasis>It Works</emphasis> web page and to enable the Evergreen web site:</para>\r
787                                                         <screen>\r
788                                                                 <userinput>a2dissite default</userinput>\r
789                                                                 <userinput>a2ensite eg.conf</userinput>\r
790                                                         </screen>\r
791                                                 </step>\r
792                                         </substeps>\r
793                                 </step>\r
794                                 <step xml:id="serversideinstallation-opensrf-config">\r
795                                         <title>Modify the OpenSRF Configuration File</title>\r
796                                         <para>As the <systemitem class="username">opensrf</systemitem> user, edit the OpenSRF configuration file <filename>/openils/conf/opensrf_core.xml</filename> to \r
797                                 update the Jabber usernames and passwords, and to specify the domain from which we will accept and to which we will make connections.</para>\r
798                                         <para>If you are installing Evergreen on a single server and using the <systemitem class="domainname">private.localhost</systemitem> / \r
799                                 <systemitem class="domainname">public.localhost</systemitem> domains, these will already be set to the correct values. Otherwise, search and replace to match \r
800                                 your customized values.</para>\r
801                                         <para>The following example uses common XPath syntax on the left-hand side to indicate the approximate position needing changes within the XML file:</para>\r
802                                         <para>/config/opensrf/username = <systemitem class="username">opensrf</systemitem></para>\r
803                                         <para>/config/opensrf/passwd = password for <systemitem class="domainname">private.localhost</systemitem><systemitem class="username">opensrf</systemitem> user</para>\r
804                                         <para>/config/gateway/username = <systemitem class="username">opensrf</systemitem></para>\r
805                                         <para>/config/gateway/passwd = password for <systemitem class="domainname">public.localhost</systemitem><systemitem class="username">opensrf</systemitem>  user</para>\r
806                                         <para>/config/routers/router/transport  (first entry, where <quote>transport/server</quote> == <systemitem class="domainname">public.localhost</systemitem>)</para>\r
807                                         <itemizedlist>\r
808                                                 <listitem>username = <systemitem class="username">router</systemitem></listitem>\r
809                                                 <listitem>password = password for <systemitem class="domainname">public.localhost</systemitem> <systemitem class="username">router</systemitem> \r
810                                                         user</listitem>\r
811                                         </itemizedlist>\r
812                                         <para>/config/routers/router/transport  (second entry, where <quote>transport/server</quote> == <systemitem class="domainname">private.localhost</systemitem>) </para>\r
813                                         <itemizedlist>\r
814                                                 <listitem>username = <systemitem class="username">router</systemitem></listitem>\r
815                                                 <listitem>password = password for <systemitem class="domainname">private.localhost</systemitem> <systemitem class="username">router</systemitem> \r
816                                                         user</listitem>\r
817                                         </itemizedlist>\r
818                                 </step>\r
819                                 <step xml:id="serversideinstallation-srfsh">\r
820                                         <title>Create Configuration Files for Users Needing <command>srfsh</command></title>\r
821                                         <para>The software installation will automatically create a utility named <command>srfsh</command> (surf shell). This is a command line diagnostic tool for \r
822                                 testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. \r
823                                 See <xref linkend="serversideinstallation-testing"/> for further information.</para>\r
824                                         <para>In this section you will set up a special configuration file for each user who will need to run the utility. Copy the short sample configuration \r
825                                 file <filename>/openils/conf/srfsh.xml.example</filename> to the file <filename>.srfsh.xml</filename> (note the leading dot!) in the home directory of \r
826                                 each user who will use <command>srfsh</command>. Finally, edit each users' <filename>.srfsh.xml</filename> file and make the following changes:</para>\r
827                                         <substeps>\r
828                                                 <step>\r
829                                                         <para>Modify <emphasis role="bold">domain</emphasis> to be the router hostname (following our domain examples, \r
830                                                 <systemitem class="domainname">private.localhost</systemitem>> will give <command>srfsh</command> access to all OpenSRF services, \r
831                                                 while <systemitem class="domainname">public.localhost</systemitem> will only allow access to those OpenSRF services that are publicly exposed).</para>\r
832                                                 </step>\r
833                                                 <step>\r
834                                                         <para>Modify <emphasis role="bold">username</emphasis> and <emphasis role="bold">password</emphasis> to match the \r
835                                                 <systemitem class="username">opensrf</systemitem> Jabber user for the chosen domain.</para>\r
836                                                 </step>\r
837                                                 <step>\r
838                                                         <para>Modify <emphasis role="bold">logfile</emphasis> to be the full path for a log file to which the user has write access.</para>\r
839                                                 </step>\r
840                                                 <step>\r
841                                                         <para>Modify <emphasis role="bold">loglevel</emphasis> as needed for testing.</para>\r
842                                                 </step>\r
843                                         </substeps>\r
844                                         <programlisting language="xml"><![CDATA[\r
845 <?xml version="1.0"?>\r
846 <!-- This file follows the standard bootstrap config file layout -->\r
847 <!-- found in opensrf_core.xml -->\r
848 <srfsh>\r
849 <router_name>router</router_name>\r
850 <domain>private.localhost</domain>\r
851 <username>opensrf</username>\r
852 <passwd>evergreen</passwd>\r
853 <port>5222</port>\r
854 <logfile>/tmp/srfsh.log</logfile>\r
855 <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->\r
856 <loglevel>4</loglevel>\r
857 </srfsh>\r
858 ]]></programlisting>\r
859                                 </step>\r
860                                 <step xml:id="serversideinstallation-opensrf-env">\r
861                                         <title>Modify the OpenSRF Environment</title>\r
862                                         <para>Modify the shell configuration file <filename>~/.bashrc</filename> for <systemitem class="username">opensrf</systemitem> by adding a Perl environmental \r
863                                 variable and execute the shell configuration file to load the new variables into your current environment.</para>\r
864                                         <note>\r
865                                                 <para>\r
866                                                         <emphasis>In a multi-server environment, you must add any modifications to <filename>~/.bashrc</filename> to the top of the file \r
867                                                 <emphasis>before</emphasis> the line <literal>[ -z "$PS1" ] &amp;&amp; return </literal>. This will allow headless (scripted) logins to \r
868                                                 load the correct environment.</emphasis>\r
869                                                 </para>\r
870                                         </note>\r
871                                         <screen>\r
872                                                 <userinput>echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc</userinput>\r
873                                                 <userinput>. ~/.bashrc</userinput>\r
874                                         </screen>\r
875                                 </step>\r
876                                 <step xml:id="serversideinstallation-starting">\r
877                                         <title>Start Evergreen</title>\r
878                                         <substeps>\r
879                                                 <step>\r
880                                                         <para>As the <systemitem class="username">root</systemitem> user, start the <systemitem class="service">ejabberd</systemitem> and \r
881                                                 <systemitem class="service">memcached</systemitem> services (if they are not already running):</para>\r
882                                                         <screen>\r
883                                                                 <userinput>/etc/init.d/ejabberd start</userinput>\r
884                                                                 <userinput>/etc/init.d/memcached start</userinput>\r
885                                                         </screen>\r
886                                                 </step>\r
887                                                 <step>\r
888                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, start Evergreen.</para>\r
889                                                         <para>Use the flag <option>-l</option> to force Evergreen to use <systemitem class="domainname">localhost</systemitem> \r
890                                                 (your current system) as the hostname. \r
891                                                 Using the <option>start_all</option> option will start the OpenSRF <systemitem class="service">router</systemitem> , \r
892                                                 <systemitem class="service">Perl</systemitem> , and <systemitem class="service">C</systemitem> services:</para>\r
893                                                         <screen>$ osrf_ctl.sh -l -a start_all</screen>\r
894                                                         <note>\r
895                                                                 <para>\r
896                                                                         <emphasis>You can also start Evergreen <emphasis role="bold">without</emphasis> the <option>-l</option> flag, but the \r
897                                                                 <command>osrf_ctl.sh</command> utility must know the fully qualified domain name for the system on which it will execute. \r
898                                                                 That hostname may have been specified in the configuration file <filename>opensrf.xml</filename>, which you configured in a \r
899                                                                 previous step.</emphasis>\r
900                                                                 </para>\r
901                                                                 <para>Use the <command>hostname</command> command to determine the fully qualified domain name of your system.</para>\r
902                                                         </note>\r
903                                                         <itemizedlist>\r
904                                                                 <listitem>\r
905                                                                         <para>If you receive an error message similar to <emphasis>osrf_ctl.sh: command not found</emphasis>, then your environment \r
906                                                                 variable <envar>PATH</envar> does not include the directory <filename class="directory">/openils/bin</filename>. \r
907                                                                 As the <systemitem class="username">opensrf</systemitem> user, edit the configuration file <filename>/home/opensrf/.bashrc</filename> \r
908                                                                 and add the following line: <literal>export PATH=$PATH:/openils/bin</literal></para>\r
909                                                                 </listitem>\r
910                                                                 <listitem>\r
911                                                                         <para>If you receive an error message similar to <errortext>Can't locate OpenSRF/System.pm in @INC ... \r
912                                                                 BEGIN failed--compilation aborted</errortext>, then your environment variable <emphasis role="bold">PERL5LIB</emphasis> does not \r
913                                                                 include the directory <filename class="directory">/openils/lib/perl5</filename>. As the \r
914                                                                 <systemitem class="username">opensrf</systemitem> user, edit the configuration file <filename>/home/opensrf/.bashrc</filename> \r
915                                                                 and add the following line: <literal>export PERL5LIB=$PERL5LIB:/openils/lib/perl5</literal></para>\r
916                                                                 </listitem>\r
917                                                         </itemizedlist>\r
918                                                 </step>\r
919                                                 <step>\r
920                                                         <para>As the <systemitem class="username">opensrf</systemitem> user, generate the Web files needed by the Staff Client and catalog, \r
921                                                 and calculate the proximity of locations in the Organizational Unit tree (which allows <emphasis>Holds</emphasis> to work properly).</para>\r
922                                                         <para>You must do this the first time you start Evergreen, and after making any changes to the library hierarchy.</para>\r
923                                                         <screen><userinput>cd /openils/bin</userinput><userinput>./autogen.sh -c /openils/conf/opensrf_core.xml -u</userinput>\r
924 Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml'\r
925 Updating fieldmapper\r
926 </screen>\r
927                                                 </step>\r
928                                                 <step>\r
929                                                         <para>As the <systemitem class="username">root</systemitem> user, restart the Apache Web server:</para>\r
930                                                         <screen>/etc/init.d/apache2 restart</screen>\r
931                                                         <note>\r
932                                                                 <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 \r
933                                                 Client until the Apache Web server is restarted.</para>\r
934                                                         </note>\r
935                                                 </step>\r
936                                         </substeps>\r
937                                 </step>\r
938                         </procedure>\r
939                 </section>\r
940                 <section xml:id="serversideinstallation-testing">\r
941                         <title>Testing the Installation</title>\r
942                         <para>This section describes several simple tests you can perform to verify that the Evergreen server-side software has been installed and configured properly \r
943                                 and is running as expected.</para>\r
944                         <simplesect xml:id="serversideinstallation-testing-connections">\r
945                                 <title>Testing Connections to Evergreen</title>\r
946                                 <para>Once you have installed and started Evergreen, test your connection to Evergreen. As the <systemitem class="username">opensrf</systemitem> user start \r
947                                         the <command>srfsh</command> application and try logging onto the Evergreen server using the default administrator username and password. Following \r
948                                         is sample output generated by executing that script after a successful Evergreen installation:</para>\r
949                                 <screen><userinput>/openils/bin/srfsh</userinput><prompt>srfsh%</prompt> <userinput>login admin open-ils</userinput>\r
950 Received Data: "250bf1518c7527a03249858687714376"\r
951 ------------------------------------\r
952 Request Completed Successfully\r
953 Request Time in seconds: 0.045286\r
954 ------------------------------------\r
955 Received Data: {\r
956    "ilsevent":0,\r
957    "textcode":"SUCCESS",\r
958    "desc":" ",\r
959    "pid":21616,\r
960    "stacktrace":"oils_auth.c:304",\r
961    "payload":{\r
962       "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",\r
963       "authtime":420\r
964    }\r
965 }\r
966 ------------------------------------\r
967 Request Completed Successfully\r
968 Request Time in seconds: 1.336568\r
969 ------------------------------------\r
970 </screen>\r
971                                 <para>The first argument is how many sets of 4 queries (+ - * /) are sent to <systemitem class="service">opensrf.math</systemitem>. When the response is \r
972                                         successful, you will see the string of <literal>+</literal> symbols. If the system is not running correctly, you will either get an exception or no result at \r
973                                         all.</para>\r
974                                 <para>For other <command>srfsh</command> commands, type <userinput>help</userinput> in at the prompt.</para>\r
975                                 <para/>\r
976                                 <para>If this test fails or you have any other problems during installation, refer to the <xref linkend="troubleshooting"/> chapter.</para>\r
977                         </simplesect>\r
978                 </section>\r
979                 <section xml:id="serversideinstallation-virtual">\r
980                         <title>Installing In Virtualized <systemitem class="osname">Linux</systemitem> Environments</title>\r
981                         <para>This section describes the installation of Evergreen software in so-called "virtualized" software environments. Evergreen software runs as a native application on any of several well-known x86 (32-bit) and x86-64 (64-bit) <systemitem class="osname">Linux</systemitem> distributions including <systemitem class="osname">Ubuntu</systemitem> and <systemitem class="osname">Debian</systemitem> but it does not run as a native application on the <systemitem class="osname">Microsoft Windows</systemitem> operating system. However, it is possible to execute Evergreen on a <systemitem class="osname">Windows</systemitem> host system by running it within a virtual Linux-guest installation, which itself executes on the <systemitem class="osname">Windows</systemitem> system. The <systemitem class="osname">Linux</systemitem> environment is fully emulated and acts (within limits) just as if it were executing on a real standalone system.</para>\r
982                         <para>This technique of emulating a <systemitem class="osname">Linux</systemitem> environment on a <systemitem class="osname">Windows</systemitem> host is a practical way to install and run an Evergreen system if it is not possible to dedicate a physical machine solely as a <systemitem class="osname">Linux</systemitem> host for Evergreen. This architecture is not recommended for large scale systems since there are performance limitations to running Evergreen in a virtualized environment. However, it is a reasonable architecture for smaller experimental systems, as a proof of concept, or as a conference-room pilot.</para>\r
983                         <simplesect>\r
984                                 <title>Installing Virtualization Software</title>\r
985                                 <para>As described above, Evergreen can be installed on top of an emulated <systemitem class="osname">Linux</systemitem> environment. The <systemitem class="osname">Linux</systemitem> environment, in turn, is installed on top of a software application such as <application>"VirtualBox"</application>, <application>"VMware"</application> or <application>"VirtualPC"</application> which must first be installed on the <systemitem class="osname">Windows</systemitem> system. This section contains step-by-step examples that show installing popular virtualization applications on a <systemitem class="osname">Windows</systemitem> host system. Following this section are further descriptions of installing <systemitem class="osname">Linux</systemitem> and Evergreen systems using that virtualization software.</para>\r
986                                 <section xml:id="serversideinstallation-virtual-vbox-install">\r
987                                         <title>Installing <application>"VirtualBox"</application> Virtualization Software</title>\r
988                                         <para>This section reviews installation of the <application>"VirtualBox"</application> application on <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. Download <application>VirtualBox</application> from their official website: <ulink url="http://download.virtualbox.org/virtualbox/3.2.8/VirtualBox-3.2.8-64453-Win.exe">http://download.virtualbox.org/virtualbox/3.2.8/VirtualBox-3.2.8-64453-Win.exe</ulink>, then run the executable file. Continue with the steps shown in the next five figures until the software has been successfully installed:</para>\r
989                                         <figure>\r
990                                                 <title>Starting the Windows installation file</title>\r
991                                                 <mediaobject>\r
992                                                         <imageobject>\r
993                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vbox-install-1.png" scalefit="1" width="70%"/>\r
994                                                         </imageobject>\r
995                                                 </mediaobject>\r
996                                         </figure>\r
997                                         <figure>\r
998                                                 <title>Welcome to <application>VirtualBox</application> setup wizard</title>\r
999                                                 <mediaobject>\r
1000                                                         <imageobject>\r
1001                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vbox-install-2.png" scalefit="1" width="70%"/>\r
1002                                                         </imageobject>\r
1003                                                 </mediaobject>\r
1004                                         </figure>\r
1005                                         <figure>\r
1006                                                 <title>Accept the license agreement</title>\r
1007                                                 <mediaobject>\r
1008                                                         <imageobject>\r
1009                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vbox-install-3.png" scalefit="1" width="70%"/>\r
1010                                                         </imageobject>\r
1011                                                 </mediaobject>\r
1012                                         </figure>\r
1013                                         <figure>\r
1014                                                 <title>Waiting for files to be copied</title>\r
1015                                                 <mediaobject>\r
1016                                                         <imageobject>\r
1017                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vbox-install-4.png" scalefit="1" width="70%"/>\r
1018                                                         </imageobject>\r
1019                                                 </mediaobject>\r
1020                                         </figure>\r
1021                                         <figure>\r
1022                                                 <title>Installation is complete</title>\r
1023                                                 <mediaobject>\r
1024                                                         <imageobject>\r
1025                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vbox-install-5.png" scalefit="1" width="70%"/>\r
1026                                                         </imageobject>\r
1027                                                 </mediaobject>\r
1028                                         </figure>\r
1029                                 </section>\r
1030                                 <section>\r
1031                                         <title>Installing <application>"VMware"</application> Virtualization Software</title>\r
1032                                         <para>This section reviews installation of the <application>"VMware"</application> application on <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. Download <application>VMware</application> from their official website: <ulink url="">link</ulink>, then run the executable file. Continue with the steps shown in the figures until the software has been successfully installed:</para>\r
1033                                         <figure>\r
1034                                                 <title>Starting the Windows installation file</title>\r
1035                                                 <mediaobject>\r
1036                                                         <imageobject>\r
1037                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vbox-install-1.png" scalefit="1" width="75%"/>\r
1038                                                         </imageobject>\r
1039                                                 </mediaobject>\r
1040                                         </figure>\r
1041                                         <indexterm>\r
1042                                                 <primary>ZZZ-REVIEW</primary>\r
1043                                                 <secondary>ADD INFO ON VMWARE</secondary>\r
1044                                         </indexterm>\r
1045                                         <caution>ADD INFO ON VMWARE</caution>\r
1046                                         <para>At this point, <application>VirtualBox</application> has been installed, started for the first time, and a new virtual machine (VM) has been created. This VM is the environment in which the <systemitem class="osname">Linux</systemitem> / Evergreen installation will execute. Please continue in <xref linkend="serversideinstallation-virtual-install-linux-ev"/> with the installation of the <systemitem class="osname">Linux</systemitem> / Evergreen distribution.</para>\r
1047                                 </section>\r
1048                                 <section>\r
1049                                         <title>Installing <application>"VirtualPC"</application> Virtualization Software</title>\r
1050                                         <para>This section reviews installation of the <application>"VirtualPC"</application> application on <systemitem class="osname">WindowsXP Professional (SP2)</systemitem>. Download <application>VMware</application> from their official website: <ulink url="">link</ulink>, then run the executable file. Continue with the steps shown in the figures until the software has been successfully installed:</para>\r
1051                                         <figure>\r
1052                                                 <title>Starting the Windows installation file</title>\r
1053                                                 <mediaobject>\r
1054                                                         <imageobject>\r
1055                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vbox-install-1.png" scalefit="1" width="75%"/>\r
1056                                                         </imageobject>\r
1057                                                 </mediaobject>\r
1058                                         </figure>\r
1059                                         <indexterm>\r
1060                                                 <primary>ZZZ-REVIEW</primary>\r
1061                                                 <secondary>ADD INFO ON VIRTUALPC</secondary>\r
1062                                         </indexterm>\r
1063                                         <caution>ADD INFO ON VIRTUALPC</caution>\r
1064                                         <para>At this point, <application>VirtualBox</application> has been installed, started for the first time, and a new virtual machine (VM) has been created. This VM is the environment in which the <systemitem class="osname">Linux</systemitem> / Evergreen installation will execute. Please continue in <xref linkend="serversideinstallation-virtual-install-linux-ev"/> with the installation of the <systemitem class="osname">Linux</systemitem> / Evergreen distribution.</para>\r
1065                                 </section>\r
1066                         </simplesect>\r
1067                         <simplesect xml:id="serversideinstallation-virtual-install-linux-ev">\r
1068                                 <title>Installing <systemitem class="osname">Linux</systemitem> / Evergreen on Virtualization Software</title>\r
1069                                 <para>After the virtualization software is installed and running, there are two ways to continue with installing <systemitem class="osname">Linux</systemitem> and Evergreen software in the new virtualized environment:</para>\r
1070                                 <orderedlist>\r
1071                                         <listitem>\r
1072                                                 <para>Download and install a prebuilt software image that contains a working <systemitem class="osname">Linux</systemitem> / Evergreen system (see <xref linkend="serversideinstall-virtual-prebuilt"/> for details)</para>\r
1073                                         </listitem>\r
1074                                         <listitem>\r
1075                                                 <para>Manually install a <systemitem class="osname">Linux</systemitem> guest system, then manually install Evergreen on it (see <xref linkend="serversideinstall-virtual-manual"/> for details)</para>\r
1076                                         </listitem>\r
1077                                 </orderedlist>\r
1078                                 <para>We review each method in the following sections.</para>\r
1079                                 <section xml:id="serversideinstall-virtual-prebuilt">\r
1080                                         <title>Download and install a prebuilt software image</title>\r
1081                                         <para>You can download a prebuilt software image that, when installed with your virtualization software, emulates a <systemitem class="osname">Linux</systemitem> guest system containing a running Evergreen distribution. The image is essentially a snapshot of a hard disk from a fully configured, functional <systemitem class="osname">Linux</systemitem> system with Evergreen already installed.</para>\r
1082                                         <para>We recommend this approach if you wish to get Evergreen running quickly with minimal attention to configuration. After reviewing only a few configuration details you can have a working Evergreen system that integrates smoothly with the rest of your network. See <xref linkend="serversideinstall-virtual-versions"/> for a list of prebuilt software images that are currently available to download and install</para>\r
1083                                         <note>DISCLAIMER: The following virtual images have been contributed by members of the Evergreen community for the purposes of testing, evaluation, training, and development.</note>\r
1084                                         <table xml:id="serversideinstall-virtual-versions">\r
1085                                                 <title>Linux / Evergreen Virtual Images</title>\r
1086                                                 <tgroup align="left" cols="4" colsep="1" rowsep="1">\r
1087                                                         <thead>\r
1088                                                                 <row>\r
1089                                                                         <entry>Linux Version</entry>\r
1090                                                                         <entry>Evergreen Version</entry>\r
1091                                                                         <entry>Image</entry>\r
1092                                                                         <entry>Comments</entry>\r
1093                                                                 </row>\r
1094                                                         </thead>\r
1095                                                         <tbody>\r
1096                                                                 <row>\r
1097                                                                         <entry>Debian lenny (5.0)</entry>\r
1098                                                                         <entry>1.6.0.1</entry>\r
1099                                                                         <entry>\r
1100                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen1601_DebianLenny.zip"> download </ulink>\r
1101                                                                         </entry>\r
1102                                                                         <entry>VirtualBox image</entry>\r
1103                                                                 </row>\r
1104                                                                 <row>\r
1105                                                                         <entry>Ubuntu karmic koala (9.10)</entry>\r
1106                                                                         <entry>1.6.0.0</entry>\r
1107                                                                         <entry>\r
1108                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen-1600-Karmic.zip"> download </ulink>\r
1109                                                                         </entry>\r
1110                                                                         <entry>VirtualBox image</entry>\r
1111                                                                 </row>\r
1112                                                                 <row>\r
1113                                                                         <entry>Ubuntu hardy heron (8.04)</entry>\r
1114                                                                         <entry>1.2.3.1</entry>\r
1115                                                                         <entry>\r
1116                                                                                 <ulink url="http://open-ils.org/dokuwiki/doku.php?id=server:1.2:ubuntu804:readme"> download </ulink>\r
1117                                                                         </entry>\r
1118                                                                         <entry>VirtualBox image; no preloaded data</entry>\r
1119                                                                 </row>\r
1120                                                                 <row>\r
1121                                                                         <entry>Debian etch (4.0)</entry>\r
1122                                                                         <entry>1.2.2.3</entry>\r
1123                                                                         <entry>\r
1124                                                                                 <ulink url="http://open-ils.org/dokuwiki/doku.php?id=vmware:debian"> download </ulink>\r
1125                                                                         </entry>\r
1126                                                                         <entry>VMware image; preloaded with 13,000 Gutenberg records</entry>\r
1127                                                                 </row>\r
1128                                                                 <row>\r
1129                                                                         <entry>Ubuntu gutsy gibbon (7.10)</entry>\r
1130                                                                         <entry>1.2.1.4</entry>\r
1131                                                                         <entry>\r
1132                                                                                 <ulink url="http://www.open-ils.org/downloads/vmware/Evergreen_1.2.1.4_on_Ubuntu_7.10.zip"> download </ulink>\r
1133                                                                         </entry>\r
1134                                                                         <entry>VMware image</entry>\r
1135                                                                 </row>\r
1136                                                                 <row>\r
1137                                                                         <entry>Gentoo</entry>\r
1138                                                                         <entry>1.1.5</entry>\r
1139                                                                         <entry>\r
1140                                                                                 <ulink url="http://www.open-ils.org/~denials/Evergreen_1.1.5_Gentoo_x86.zip"> download </ulink>\r
1141                                                                         </entry>\r
1142                                                                         <entry>VMware image</entry>\r
1143                                                                 </row>\r
1144                                                         </tbody>\r
1145                                                 </tgroup>\r
1146                                         </table>\r
1147                                         <indexterm>\r
1148                                                 <primary>ZZZ-REVIEW</primary>\r
1149                                                 <secondary>EXPAND LIST OF OTHER PREBUILT IMAGES</secondary>\r
1150                                         </indexterm>\r
1151                                         <caution>EXPAND LIST OF OTHER PREBUILT IMAGES</caution>\r
1152                                         <para>For the following example, we have already installed the <application>VirtualBox</application> application (see <xref linkend="serversideinstallation-virtual-vbox-install"/> for details). Continue with the steps as shown; refer to the accompanying figures for further information:</para>\r
1153                                         <procedure>\r
1154                                                 <step>Start VirtualBox for the first time and select <menuchoice><guimenu>File</guimenu><guimenuitem>VirtualBox Media Manager</guimenuitem><guimenuitem>Add</guimenuitem></menuchoice> to locate the prebuilt software image just downloaded (the example shows it was extracted from the original <literal>.ZIP</literal> file into a temporary directory <literal>C:\temp</literal>). See <xref linkend="serversideinstallation-virtual-vm-install-2"/> for details.</step>\r
1155                                                 <step>After selecting the file, click <guibutton>Open</guibutton> to import it (see <xref linkend="serversideinstallation-virtual-vm-install-3"/> for details).</step>\r
1156                                                 <step>Then click <guibutton>OK</guibutton> to save the selection and return to the VirtualBox Media Manager (see <xref linkend="serversideinstallation-virtual-vm-install-4"/> for details).</step>\r
1157                                                 <step>Click <guibutton>New</guibutton> to start the "Virtual Machine Wizard", then <guibutton>Next</guibutton> to continue and create a new virtual machine (VM) <xref linkend="serversideinstallation-virtual-vm-install-5"/>).</step>\r
1158                                                 <step>Create a new name for the VM and set the operating system type, then click <guibutton>Next</guibutton> (see <xref linkend="serversideinstallation-virtual-vm-install-6"/>).</step>\r
1159                                                 <step>Set the memory size (we chose the default value of 512Mb), then click <guibutton>Next</guibutton> (see <xref linkend="serversideinstallation-virtual-vm-install-7"/>).</step>\r
1160                                                 <step>Edit the Virtual Hard Disk configuration settings; click the radio boxes "Boot Hard Disk" and "Use existing hard disk" and ensure that the disk name "Evergreen1601_DebianLenny.vmdk" is selected. Click <guibutton>Finish</guibutton> to finish the setup (see <xref linkend="serversideinstallation-virtual-vm-install-8"/>).</step>\r
1161                                                 <step>\r
1162                                                         <para>Install the <application>VirtualBox Guest Additions</application> (really a required upgrade to VirtualBox)</para>\r
1163                                                         <indexterm>\r
1164                                                                 <primary>ZZZ-REVIEW</primary>\r
1165                                                                 <secondary>ADD INFO ON INSTALLING VIRTUALBOX GUEST ADDITIONS</secondary>\r
1166                                                         </indexterm>\r
1167                                                         <caution>ADD INFO ON INSTALLING VIRTUALBOX GUEST ADDITIONS</caution>\r
1168                                                 </step>\r
1169                                                 <step>Return to VirtualBox and see the summary of the VM just created. Click <guibutton>Start</guibutton> to boot the new VM (see <xref linkend="serversideinstallation-virtual-vm-install-9"/>).</step>\r
1170                                                 <step>See the start of the <systemitem class="osname">Linux</systemitem> boot sequence. Choose "Debian Gnu/Linux, kernel 2.6.26-2-686" from the startup menu and type <guibutton>Enter</guibutton> to start <systemitem class="osname">Linux</systemitem> and Evergreen (see <xref linkend="serversideinstallation-virtual-vm-install-11"/>). After some delay you should see the command line prompt: <literal>debian-lenny login:</literal>  .  Log in with username <literal>root</literal> and password <literal>evergreen</literal> to continue (see <xref linkend="serversideinstallation-virtual-vm-install-14"/>).</step>\r
1171                                         </procedure>\r
1172                                         <para>At this point you have a running <systemitem class="osname">Linux</systemitem> / Evergreen system. If you need to modify the Evergreen configuration in any way, review the sectons of the standard Evergreen installation instructions in <xref linkend="serversideinstallation-ubuntudebian"/> that deal with configuration.</para>\r
1173                                         <figure xml:id="serversideinstallation-virtual-vm-install-2">\r
1174                                                 <title>Starting <application>VirtualBox</application> for the first time</title>\r
1175                                                 <mediaobject>\r
1176                                                         <imageobject>\r
1177                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-2.png" scalefit="1" width="70%"/>\r
1178                                                         </imageobject>\r
1179                                                 </mediaobject>\r
1180                                         </figure>\r
1181                                         <figure xml:id="serversideinstallation-virtual-vm-install-3">\r
1182                                                 <title>Selecting the software image in Virtual Media Manager</title>\r
1183                                                 <mediaobject>\r
1184                                                         <imageobject>\r
1185                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-3.png" scalefit="1" width="70%"/>\r
1186                                                         </imageobject>\r
1187                                                 </mediaobject>\r
1188                                         </figure>\r
1189                                         <figure xml:id="serversideinstallation-virtual-vm-install-4">\r
1190                                                 <title>New software image added to <application>VirtualBox</application></title>\r
1191                                                 <mediaobject>\r
1192                                                         <imageobject>\r
1193                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-4.png" scalefit="1" width="75%"/>\r
1194                                                         </imageobject>\r
1195                                                 </mediaobject>\r
1196                                         </figure>\r
1197                                         <figure xml:id="serversideinstallation-virtual-vm-install-5">\r
1198                                                 <title>Creating a new VM</title>\r
1199                                                 <mediaobject>\r
1200                                                         <imageobject>\r
1201                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-5.png" scalefit="1" width="75%"/>\r
1202                                                         </imageobject>\r
1203                                                 </mediaobject>\r
1204                                         </figure>\r
1205                                         <figure xml:id="serversideinstallation-virtual-vm-install-6">\r
1206                                                 <title>Setting the VM name and OS type</title>\r
1207                                                 <mediaobject>\r
1208                                                         <imageobject>\r
1209                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-6.png" scalefit="1" width="75%"/>\r
1210                                                         </imageobject>\r
1211                                                 </mediaobject>\r
1212                                         </figure>\r
1213                                         <figure xml:id="serversideinstallation-virtual-vm-install-7">\r
1214                                                 <title>Setting memory size</title>\r
1215                                                 <mediaobject>\r
1216                                                         <imageobject>\r
1217                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-7.png" scalefit="1" width="75%"/>\r
1218                                                         </imageobject>\r
1219                                                 </mediaobject>\r
1220                                         </figure>\r
1221                                         <figure xml:id="serversideinstallation-virtual-vm-install-8">\r
1222                                                 <title>Setting up the Virtual Hard Disk</title>\r
1223                                                 <mediaobject>\r
1224                                                         <imageobject>\r
1225                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-8.png" scalefit="1" width="75%"/>\r
1226                                                         </imageobject>\r
1227                                                 </mediaobject>\r
1228                                         </figure>\r
1229                                         <figure xml:id="serversideinstallation-virtual-vm-install-9">\r
1230                                                 <title>Finishing definition of new VM</title>\r
1231                                                 <mediaobject>\r
1232                                                         <imageobject>\r
1233                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-9.png" scalefit="1" width="75%"/>\r
1234                                                         </imageobject>\r
1235                                                 </mediaobject>\r
1236                                         </figure>\r
1237                                         <figure xml:id="serversideinstallation-virtual-vm-install-10">\r
1238                                                 <title>Summary of the new VM</title>\r
1239                                                 <mediaobject>\r
1240                                                         <imageobject>\r
1241                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-10.png" scalefit="1" width="75%"/>\r
1242                                                         </imageobject>\r
1243                                                 </mediaobject>\r
1244                                         </figure>\r
1245                                         <figure xml:id="serversideinstallation-virtual-vm-install-11">\r
1246                                                 <title>Selecting VM from startup menu</title>\r
1247                                                 <mediaobject>\r
1248                                                         <imageobject>\r
1249                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-11.png" scalefit="1" width="75%"/>\r
1250                                                         </imageobject>\r
1251                                                 </mediaobject>\r
1252                                         </figure>\r
1253                                         <figure xml:id="serversideinstallation-virtual-vm-install-12">\r
1254                                                 <title>Starting the new VM</title>\r
1255                                                 <mediaobject>\r
1256                                                         <imageobject>\r
1257                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-12.png" scalefit="1" width="75%"/>\r
1258                                                         </imageobject>\r
1259                                                 </mediaobject>\r
1260                                         </figure>\r
1261                                         <figure xml:id="serversideinstallation-virtual-vm-install-13">\r
1262                                                 <title>Starting the new VM (continued)</title>\r
1263                                                 <mediaobject>\r
1264                                                         <imageobject>\r
1265                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-13.png" scalefit="1" width="75%"/>\r
1266                                                         </imageobject>\r
1267                                                 </mediaobject>\r
1268                                         </figure>\r
1269                                         <figure xml:id="serversideinstallation-virtual-vm-install-14">\r
1270                                                 <title>Logging into the new VM</title>\r
1271                                                 <mediaobject>\r
1272                                                         <imageobject>\r
1273                                                                 <imagedata fileref="../media/serversideinstallation-virtual-vm-install-14.png" scalefit="1" width="75%"/>\r
1274                                                         </imageobject>\r
1275                                                 </mediaobject>\r
1276                                         </figure>\r
1277                                 </section>\r
1278                                 <section xml:id="serversideinstall-virtual-manual">\r
1279                                         <title>Manually install <systemitem class="osname">Linux</systemitem> and Evergreen</title>\r
1280                                         <para>You can manually install a <systemitem class="osname">Linux</systemitem> guest system and Evergreen on your virtualization software.</para>\r
1281                                         <para>We recommend this approach if you need to specially configure either the <systemitem class="osname">Linux</systemitem> system or Evergreen itself. This will require a detailed review of both <systemitem class="osname">Linux</systemitem> and Evergreen configuration details. You are essentially doing a normal Evergreen installation on a <systemitem class="osname">Linux</systemitem> system; it just happens that <systemitem class="osname">Linux</systemitem> is running within a virtualized environment. Refer to <xref linkend="serversideinstallation-ubuntudebian"/> for information on the normal Evergreen installation, then continue with this section.</para>\r
1282                                         <para>For the following example, we have already installed the <application>VirtualBox</application> application (see <xref linkend="serversideinstallation-virtual-vbox-install"/> for details). Continue with the steps as shown; refer to the accompanying figures for further information:</para>\r
1283                                         <procedure>\r
1284                                                 <step>\r
1285                                                         <para>Download and install a standard <systemitem class="osname">Ubuntu</systemitem> distribution in <application>"VirtualBox"</application>.</para>\r
1286                                                         <para>You can download a software image of a prebuilt <systemitem class="osname">Ubuntu</systemitem> distribution and immediately import it into <application>"VirtualBox"</application> , or you can download and install \r
1287 </para>\r
1288                                                         <indexterm>\r
1289                                                                 <primary>ZZZ-REVIEW</primary>\r
1290                                                                 <secondary>ADD DETAILS ON MANUAL INSTALLATION OF LINUX</secondary>\r
1291                                                         </indexterm>\r
1292                                                         <caution>ADD DETAILS ON MANUAL INSTALLATION OF LINUX</caution>\r
1293                                                 </step>\r
1294                                                 <step>\r
1295                                                         <para>Start (boot) <systemitem class="osname">Ubuntu</systemitem>.</para>\r
1296                                                         <indexterm>\r
1297                                                                 <primary>ZZZ-REVIEW</primary>\r
1298                                                                 <secondary>ADD DETAILS ON VM LINUX BOOT SEQUENCE</secondary>\r
1299                                                         </indexterm>\r
1300                                                         <caution>ADD DETAILS ON VM LINUX BOOT SEQUENCE</caution>\r
1301                                                 </step>\r
1302                                                 <step>\r
1303                                                         <para>Install Evergreen on <systemitem class="osname">Ubuntu</systemitem>.</para>\r
1304                                                         <indexterm>\r
1305                                                                 <primary>ZZZ-REVIEW</primary>\r
1306                                                                 <secondary>ADD DETAILS ON MANUAL INSTALLATION OF EVERGREEN</secondary>\r
1307                                                         </indexterm>\r
1308                                                         <caution>ADD DETAILS ON MANUAL INSTALLATION OF EVERGREEN</caution>\r
1309                                                 </step>\r
1310                                         </procedure>\r
1311                                         <para>At this point, the <systemitem class="osname">Windows</systemitem> system is hosting an <systemitem class="osname">Ubuntu</systemitem> system, which itself is hosting the Evergreen distribution. So far as Evergreen is concerned, it is happily executing in a standard <systemitem class="osname">Ubuntu</systemitem> environment and behaves exactly as if it were executing on a standalone <systemitem class="osname">Ubuntu</systemitem> system.</para>\r
1312                                         <para>Of course, there are limitations to how well a virtualized <systemitem class="osname">Ubuntu</systemitem> system emulates a real one. The <application>"VirtualBox"</application> application itself consumes memory, and it contributes to the CPU load on the <systemitem class="osname">Windows</systemitem> host system. The emulated <systemitem class="osname">Ubuntu</systemitem> system will have less available memory and will execute more slowly than if it were a standalone system, therefore Evergreen itself will inherit some limitations from this overall environment.</para>\r
1313                                         <para>However, this technique of using a <systemitem class="osname">Windows</systemitem> host to emulate a <systemitem class="osname">Linux</systemitem> environment is a practical way to install and run an Evergreen system even if it isn't possible to dedicate a real machine solely as a <systemitem class="osname">Linux</systemitem> host for testing. This is a reasonable architecture for simple experiments, or as a proof of concept, or as a conference-room pilot.</para>\r
1314                                 </section>\r
1315                         </simplesect>\r
1316                 </section>\r
1317                 <section xml:id="serversideinstallation-postgresql">\r
1318                         <title>Installing PostgreSQL</title>\r
1319                         <para>In production Evergreen systems, the PostgreSQL database server may reside on the same system on which Evergreen is installed or on another standalone system so, by default, PostgreSQL is not automatically installed along with Evergreen. This section details the steps needed to manually install PostgreSQL on a <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> system.</para>\r
1320                         <para>If your PostgreSQL server will be on the same system as your Evergreen software, return to the previous section <xref linkend="serversideinstallation-postgresql-default"/> and follow those instructions. Otherwise, to manually install PostgreSQL on a system, continue with the instructions below.</para>\r
1321                         <note>\r
1322                                 <para>Some <systemitem class="osname">Linux</systemitem> distributions, such as <systemitem class="osname">Debian Etch (4.0)</systemitem>, do not offer PostgreSQL version 8.2 as an installable package. Before you continue, examine the software dependencies listed in <xref linkend="serversideinstall-software-dependencies"/> to ensure that your Linux distribution supports the required version of PostgreSQL.</para>\r
1323                         </note>\r
1324                         <procedure>\r
1325                                 <step>\r
1326                                         <para>Install the application <application>"stow"</application> on your system if it is not already installed. Issue the following command as the <systemitem class="username">root</systemitem> user:</para>\r
1327                                         <figure>\r
1328                                                 <title>Installing <application>"stow"</application></title>\r
1329                                                 <screen>\r
1330                                                 $ apt-get install stow\r
1331                                                 ...\r
1332                                                 </screen>\r
1333                                         </figure>\r
1334                                 </step>\r
1335                                 <step>\r
1336                                         <para>Download, compile, and install the latest release for PostgreSQL 8.2 (which was version <literal>8.2.12</literal> at the time of this writing). As the <systemitem class="username">root</systemitem> user, follow these steps:</para>\r
1337                                         <figure>\r
1338                                                 <title>Installing PostgreSQL</title>\r
1339                                                 <screen>\r
1340                                                 $ wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.2.17/postgresql-8.2.17.tar.bz2\r
1341                                                 $ tar xzf postgresql-8.2.17.tar.gz\r
1342                                                 $ cd postgresql-8.2.17\r
1343                                                 $ ./configure --with-perl --enable-integer-datetimes --with-openssl --prefix=/usr/local/stow/pgsql\r
1344                                                 ...\r
1345                                                 $ make\r
1346                                                 ...\r
1347                                                 $ make install\r
1348                                                 ...\r
1349                                                 $ cd contrib\r
1350                                                 $ make\r
1351                                                 ...\r
1352                                                 $ make install\r
1353                                                 $ cd xml2\r
1354                                                 $ make\r
1355                                                 ...\r
1356                                                 $ make install\r
1357                                                 $ cd /usr/local/stow\r
1358                                                 $ stow pgsql\r
1359                                                 </screen>\r
1360                                         </figure>\r
1361                                 </step>\r
1362                                 <step>\r
1363                                         <para>Create the new user <systemitem class="username">postgres</systemitem> to run the PostgreSQL processes. As the <systemitem class="username">root</systemitem> user, execute this command:</para>\r
1364                                         <figure>\r
1365                                                 <title>Adding <systemitem class="username">postgres</systemitem></title>\r
1366                                                 <screen>\r
1367                                                 $ adduser postgres\r
1368                                                 </screen>\r
1369                                         </figure>\r
1370                                 </step>\r
1371                                 <step>\r
1372                                         <para>Initialize the database directory and start up PostgreSQL. As the <systemitem class="username">root</systemitem> user, follow these steps:</para>\r
1373                                         <figure>\r
1374                                                 <title>Adding <systemitem class="username">postgres</systemitem></title>\r
1375                                                 <screen>\r
1376                                                 $ mkdir -p /usr/local/pgsql/data\r
1377                                                 $ chown postgres /usr/local/pgsql/data\r
1378                                                 $ su - postgres\r
1379                                                 $ initdb -D /usr/local/pgsql/data -E UNICODE --locale=C\r
1380                                                 $ pg_ctl -D /usr/local/pgsql/data -l /home/postgres/logfile start\r
1381                                                 </screen>\r
1382                                         </figure>\r
1383                                         <note>\r
1384                                                 <para>If an error occurs during the final step above, review the path of the home directory for the <systemitem class="username">postgres</systemitem> user. It may be <literal>/var/lib/postresql</literal> instead of <literal>/home/postres</literal>.</para>\r
1385                                         </note>\r
1386                                 </step>\r
1387                                 <step>\r
1388                                         <para>The values of several PostreSQL configuration parameters may be changed for enhanced performance. The following table lists the default values and some suggested updates for several useful parameters:</para>\r
1389                                         <table>\r
1390                                                 <title>Suggested configuration values</title>\r
1391                                                 <tgroup align="left" cols="3" colsep="1" rowsep="1">\r
1392                                                         <colspec colnum="1" colwidth="1*"/>\r
1393                                                         <colspec colnum="2" colwidth="1*"/>\r
1394                                                         <colspec colnum="3" colwidth="1*"/>\r
1395                                                         <thead>\r
1396                                                                 <row>\r
1397                                                                         <entry>Parameter</entry>\r
1398                                                                         <entry>Default</entry>\r
1399                                                                         <entry>Suggested</entry>\r
1400                                                                 </row>\r
1401                                                         </thead>\r
1402                                                         <tbody>\r
1403                                                                 <row>\r
1404                                                                         <entry>default_statistics_target</entry>\r
1405                                                                         <entry>10</entry>\r
1406                                                                         <entry>100</entry>\r
1407                                                                 </row>\r
1408                                                                 <row>\r
1409                                                                         <entry>work_mem</entry>\r
1410                                                                         <entry>4Mb</entry>\r
1411                                                                         <entry>128Mb</entry>\r
1412                                                                 </row>\r
1413                                                                 <row>\r
1414                                                                         <entry>shared_buffers</entry>\r
1415                                                                         <entry>8Mb</entry>\r
1416                                                                         <entry>512Mb</entry>\r
1417                                                                 </row>\r
1418                                                                 <row>\r
1419                                                                         <entry>effective_cache_size</entry>\r
1420                                                                         <entry>128Mb</entry>\r
1421                                                                         <entry>4Gb</entry>\r
1422                                                                 </row>\r
1423                                                         </tbody>\r
1424                                                 </tgroup>\r
1425                                         </table>\r
1426                                         <indexterm>\r
1427                                                 <primary>ZZZ-REVIEW</primary>\r
1428                                                 <secondary>ADD CONTENT ON HOW TO UPDATE POSTRESQL PARAMETERS</secondary>\r
1429                                         </indexterm>\r
1430                                         <caution>ADD CONTENT ON HOW TO UPDATE POSTRESQL PARAMETERS </caution>\r
1431                                 </step>\r
1432                         </procedure>\r
1433                 </section>\r
1434                 <section xml:id="serversideinstallation-apache">\r
1435                         <title>Installing Apache</title>\r
1436                         <simplesect>\r
1437                                 <title>Securing Apache (httpd)</title>\r
1438                                 <para>The main consideration is to secure the directory <filename class="directory">cgi-bin</filename>. The only persons that need access to this directory are Evergreen system administrators. This directory should be restricted by both IP (to those workstations designated as Evergeen Administration systems), and by username/password.</para>\r
1439                                 <indexterm>\r
1440                                         <primary>ZZZ-REVIEW</primary>\r
1441                                         <secondary>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </secondary>\r
1442                                 </indexterm>\r
1443                                 <caution>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </caution>\r
1444                                 <para>A user could add new libraries, re-arrange consortia, or change user groups; or a staff member could access the directory, and change his associated security group to administrative level privileges.</para>\r
1445                         </simplesect>\r
1446                         <indexterm>\r
1447                                 <primary>ZZZ-REVIEW</primary>\r
1448                                 <secondary>ADD MORE CONTENT FOR APACHE </secondary>\r
1449                         </indexterm>\r
1450                         <caution>ADD MORE CONTENT FOR APACHE </caution>\r
1451                 </section>\r
1452         </section>\r
1453 </chapter>\r