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