Move PostgreSQL ifnormation from ServersideInstallation to Admin misc.
[working/Evergreen.git] / 1.6 / admin / ServersideInstallation-olderEvergreenVersions.xml
1 <?xml version='1.0' encoding='UTF-8'?>\r
2 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"\r
3         xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:id="serversideinstallation-previousversions">\r
4 \r
5                         <title>Installing Previous Versions of Evergreen</title>\r
6                         <para>Earlier releases of Evergreen are available. Instructions for installing, configuring and testing earlier versions are found below.</para>\r
7                         <para>The next most recent previous release of Evergreen is version <emphasis><emphasis role="bold">1.4.0.6</emphasis></emphasis>. The accompanying previous release of OpenSRF \r
8                         is version <emphasis><emphasis role="bold">1.0.7</emphasis></emphasis>.</para>\r
9                         <section xml:id="serversideinstallation-evergreen-previous">\r
10                                 <title>Installing Evergreen 1.4.0.6 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>\r
11                                 <para>This section outlines the installation process for the previous version 1.4.0.6 of Evergreen.</para>\r
12                                 <para>In this section you will download, unpack, install, configure and test the Evergreen system, including the Evergreen server and the PostgreSQL database system. You will make several configuration changes and adjustments to the software, including updates to configure the system for your own locale, and some updates needed to work around a few known issues.</para>\r
13                                 <note>\r
14                                         <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) architectures. There may be differences between the Desktop and Server editions of <systemitem class="osname">Ubuntu</systemitem>. These instructions assume the Server edition.</para>\r
15                                         <para>If you are starting with a clean install of <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem>, you are strongly recommended <emphasis role="bold">not</emphasis> to install the packaged PostgreSQL server. This can confuse port numbers and system configuration. Evergreen 1.4 requires PostgreSQL 8.2.</para>\r
16                                 </note>\r
17                                 <section>\r
18                                         <title>Installing OpenSRF 1.0.7</title>\r
19                                         <para>Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see <xref linkend="serversideinstallation-opensrf-previous"/>.</para>\r
20                                         <para>Follow the steps outlined in that section and run the specified tests to ensure that OpenSRF is properly installed and configured. Do not continue with any further Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>\r
21                                 </section>\r
22                                 <section>\r
23                                         <title>Download and Unpack Evergreen Version 1.4.0.6</title>\r
24                                         <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of Evergreen. The latest version can be found here: <ulink url="http://evergreen-ils.org/downloads/Evergreen-ILS-1.4.0.6.tar.gz"></ulink></para>\r
25                                         <figure>\r
26                                                 <title>Commands to download and unpack Evergreen</title>\r
27                                                 <screen>\r
28                                                 $ su - opensrf\r
29                                                 $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.4.0.6.tar.gz\r
30                                                 $ tar zxf Evergreen-ILS-1.4.0.6.tar.gz\r
31                                                 </screen>\r
32                                         </figure>\r
33                                         <para>The new directory <filename class="directory">/home/opensrf/Evergreen-ILS-1.4.0.6</filename> will be created.</para>\r
34                                 </section>\r
35                                 <section>\r
36                                         <title>Install Prerequisites to Build Evergreen</title>\r
37                                         <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 the software using the <command>make</command> utility.</para>\r
38                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[distribution]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-2-a">"Keywords"</link> figure below.</para>\r
39                                         <figure>\r
40                                                 <title>Commands to install prerequisites for Evergreen</title>\r
41                                                 <screen>\r
42                                                 $ su - root\r
43                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6\r
44                                                 $ make -f Open-ILS/src/extras/Makefile.install [distribution]\r
45                                                 ...\r
46                                                 </screen>\r
47                                         </figure>\r
48                                         <table xml:id="serversideinstallation-keywords-figure-2-a">\r
49                                                 <title>Keywords Targets for <application>"make"</application> Command</title>\r
50                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
51                                                         <colspec colnum="1" colwidth="1.0*"/>\r
52                                                         <colspec colnum="2" colwidth="3.0*"/>\r
53                                                         <thead>\r
54                                                                 <row>\r
55                                                                         <entry>Keyword</entry>\r
56                                                                         <entry>Description</entry>\r
57                                                                 </row>\r
58                                                         </thead>\r
59                                                         <tbody>\r
60                                                                 <row>\r
61                                                                         <entry>debian-lenny</entry>\r
62                                                                         <entry>for Debian Lenny (5.0)</entry>\r
63                                                                 </row>\r
64                                                                 <row>\r
65                                                                         <entry>debian-etch</entry>\r
66                                                                         <entry>for Debian Etch (4.0)</entry>\r
67                                                                 </row>\r
68                                                                 <row>\r
69                                                                         <entry>ubuntu-intrepid</entry>\r
70                                                                         <entry>for Ubuntu Intrepid (8.10)</entry>\r
71                                                                 </row>\r
72                                                                 <row>\r
73                                                                         <entry>ubuntu-hardy</entry>\r
74                                                                         <entry>for Ubuntu Hardy (8.04)</entry>\r
75                                                                 </row>\r
76                                                         </tbody>\r
77                                                 </tgroup>\r
78                                         </table>\r
79                                 </section>\r
80                                 <section>\r
81                                         <title>Update the System Dynamic Library Path</title>\r
82                                         <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating the new file <filename>/etc/ld.so.conf.d/eg.conf</filename> containing two new library paths, then run the command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>\r
83                                         <figure>\r
84                                                 <title>Commands to modify system dynamic library path</title>\r
85                                                 <screen>\r
86                                                 $ su - root\r
87                                                 $ cat > /etc/ld.so.conf.d/eg.conf &lt;&lt; ENDOFFILE\r
88                                                 /usr/local/lib\r
89                                                 /usr/local/lib/dbd\r
90                                                 ENDOFFILE\r
91                                                 $ ldconfig\r
92                                                 </screen>\r
93                                         </figure>\r
94                                 </section>\r
95                                 <section>\r
96                                         <title>Restart the PostgreSQL Server</title>\r
97                                         <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 the PostgreSQL server to avoid a problem where the library <filename>plperl.so</filename> cannot be found. If your PostgreSQL server is running on another system, just skip this step.</para>\r
98                                         <figure>\r
99                                                 <title>Commands to restart PostgreSQL server</title>\r
100                                                 <screen>\r
101                                                 $ su - root\r
102                                                 $ /etc/init.d/postgresql-8.2 restart\r
103                                                 </screen>\r
104                                         </figure>\r
105                                 </section>\r
106                                 <section>\r
107                                         <title>Configure Evergreen</title>\r
108                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to the Evergreen build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software:</para>\r
109                                         <figure>\r
110                                                 <title>Commands to configure Evergreen</title>\r
111                                                 <screen>\r
112                                                 $ su - opensrf\r
113                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6\r
114                                                 $ ./configure --prefix=/openils --sysconfdir=/openils/conf\r
115                                                 $ make\r
116                                                 ...\r
117                                                 </screen>\r
118                                         </figure>\r
119                                 </section>\r
120                                 <section>\r
121                                         <title>Compile, Link and Install Evergreen</title>\r
122                                         <para>In this step you will actually compile, link and install Evergreen and the default Evergreen Staff Client.</para>\r
123                                         <para>As the <systemitem class="username">root</systemitem> user, return to the Evergreen build directory and use the <command>make</command> utility as shown below. The Staff Client will also be automatically built, but you must remember to set the variable <envar>STAFF_CLIENT_BUILD_ID</envar> to match the version of the Staff Client you will use to connect to the Evergreen server.</para>\r
124                                         <para>For further information on manually building the Staff Client, see <xref linkend="serversideinstallation-building-staffclient"/>.</para>\r
125                                         <figure>\r
126                                                 <title>Commands to build, link and install Evergreen</title>\r
127                                                 <screen>\r
128                                                 $ su - root\r
129                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6\r
130                                                 $ make STAFF_CLIENT_BUILD_ID=rel_1_4_0_6 install\r
131                                                 ...\r
132                                                 </screen>\r
133                                                 <para>The above commands will create a new subdirectory <filename class="directory">/openils/var/web/xul/rel_1_4_0_6</filename> containing the Staff Client.</para>\r
134                                         </figure>\r
135                                 </section>\r
136                                 <section>\r
137                                         <title>Copy the OpenSRF Configuration Files</title>\r
138                                         <para>As the <systemitem class="username">root</systemitem> user, copy the example OpenSRF configuration files into place. This replaces the configuration 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 purposes. Finally, change the ownership on the installed files to the <systemitem class="username">opensrf</systemitem> user:</para>\r
139                                         <figure>\r
140                                                 <title>Commands to copy OpenSRF configuration files</title>\r
141                                                 <screen>\r
142                                                 $ su - root\r
143                                                 $ cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml\r
144                                                 $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml\r
145                                                 $ chown -R opensrf:opensrf /openils/\r
146                                                 </screen>\r
147                                         </figure>\r
148                                 </section>\r
149                                 <section>\r
150                                         <title>Create and Configure PostgreSQL Database</title>\r
151                                         <para>As the <systemitem class="username">postgres</systemitem> user on your PostgreSQL server, create the Evergreen database.</para>\r
152                                         <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 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.2 server packages on <systemitem class="osname">Ubuntu 8.04</systemitem>, the path would be <filename class="directory">/usr/share/postgresql/8.2/contrib/</filename>.</para>\r
153                                         <procedure>\r
154                                                 <step>\r
155                                                         <para>\r
156                                                                 <emphasis role="bold">Create and configure the database</emphasis>\r
157                                                         </para>\r
158                                                         <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system create the PostgreSQL database, then set some internal paths:</para>\r
159                                                         <figure>\r
160                                                                 <title>Commands to create database and adjust the path</title>\r
161                                                                 <screen>\r
162                                                                 # create the database\r
163                                                                 $ su - postgres\r
164                                                                 $ createdb -E UNICODE evergreen\r
165                                                                 $ createlang plperl   evergreen\r
166                                                                 $ createlang plperlu  evergreen\r
167                                                                 $ createlang plpgsql  evergreen\r
168                         \r
169                                                                 # adjust the paths\r
170                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tablefunc.sql evergreen\r
171                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/tsearch2.sql  evergreen\r
172                                                                 $ psql -f /usr/share/postgresql/PGSQL_VERSION/contrib/pgxml.sql     evergreen\r
173                                                                 </screen>\r
174                                                         </figure>\r
175                                                         <emphasis>Where <literal>PGSQL_VERSION</literal> is your installed PostgreSQL version (e.g. <literal>8.2</literal>).</emphasis>\r
176                                                 </step>\r
177                                                 <step>\r
178                                                         <para>\r
179                                                                 <emphasis role="bold">Create new Evergreen superuser</emphasis>\r
180                                                         </para>\r
181                                                         <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL system, create the \r
182                                                         new database <systemitem class="username">evergreen</systemitem> user and assign a password:</para>\r
183 <screen>\r
184 # create superuser 'evergreen' and set the password\r
185 <userinput>su - postgres</userinput>\r
186 <userinput>createuser -P -s evergreen</userinput>\r
187 <prompt>Enter password for new role:</prompt> <userinput>MYNEWPASSWORD</userinput>\r
188 <prompt>Enter it again:</prompt><userinput>MYNEWPASSWORD</userinput>\r
189 </screen>\r
190                                                         <emphasis>Where <literal>MYNEWPASSWORD</literal> is the password chosen.</emphasis>\r
191                                                 </step>\r
192                                         </procedure>\r
193                                 </section>\r
194                                 <section>\r
195                                         <title>Create Database Schema</title>\r
196                                         <para>As the <systemitem class="username">root</systemitem> user, create the database schema and configure your system with the corresponding database authentication details for the <emphasis>evergreen</emphasis> database user that you created in the previous step.</para>\r
197                                         <para>Enter the following commands and replace <emphasis>HOSTNAME, PORT, PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> with appropriate values.</para>\r
198                                         <figure>\r
199                                                 <title>Commands to create Evergreen database schema</title>\r
200                                                 <screen>\r
201                                                 $ su - root\r
202                                                 $ cd /home/opensrf/Evergreen-ILS-1.4.0.6\r
203                                                 $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \\r
204                                                         --service all --create-schema --create-bootstrap --create-offline \\r
205                                                         --hostname HOSTNAME --port PORT \\r
206                                                         --user evergreen --password PASSWORD --database DATABASENAME\r
207                                                 </screen>\r
208                                         </figure>\r
209                                         <emphasis>Where, on most systems, <emphasis>HOSTNAME</emphasis> will be <emphasis role="bold">localhost</emphasis>, <emphasis>PORT</emphasis> will be <emphasis role="bold">5432</emphasis>, and <emphasis>PASSWORD</emphasis> and <emphasis>DATABASENAME</emphasis> will be those assigned when PostgreSQL was installed in the previous step.</emphasis>\r
210                                         <note>\r
211                                                 <para>\r
212                                                         <emphasis>If you are entering the above command on a single line, do not include the <literal>\</literal> (backslash) characters. 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 that the command is continued on the next line.</emphasis>\r
213                                                 </para>\r
214                                         </note>\r
215                                 </section>\r
216                                 <section>\r
217                                         <title>Evergreen installation - (continued)</title>\r
218                                         <para><emphasis>The remainder of the Evergreen installation procedure is identical to that for installing the latest version of Evergreen. Continue with the instructions found in</emphasis> <xref linkend="serversideinstallation-modify-apache"/>.</para>\r
219                                 </section>\r
220                         </section>\r
221                         <section xml:id="serversideinstallation-opensrf-previous">\r
222                                 <title>Installing OpenSRF 1.0.7 On <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem></title>\r
223                                 <para>This section describes the installation of the previous version of the Open Service Request Framework (OpenSRF), a major component of the Evergreen server-side software, on <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> systems. Evergreen software is integrated with and depends on the OpenSRF software system.</para>\r
224                                 <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 Evergreen installation steps until you have verified that OpenSRF has been successfully installed.</para>\r
225                                 <note>\r
226                                         <para>The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) platforms. OpenSRF 1.0.7 has been tested on <systemitem class="osname">Debian Etch (4.0)</systemitem>, <systemitem class="osname">Debian Lenny</systemitem>, <systemitem class="osname">Ubuntu Hardy Heron (8.04)</systemitem>, and <systemitem class="osname">Ubuntu Intrepid Ibex (8.10)</systemitem>.</para>\r
227                                         <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> user, the <systemitem class="username">opensrf</systemitem> user, or the <systemitem class="username">postgres</systemitem> user.</para>\r
228                                         <itemizedlist>\r
229                                                 <listitem><systemitem class="osname">Debian</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
230                                                 <listitem><systemitem class="osname">Ubuntu</systemitem> -- To become the <systemitem class="username">root</systemitem> user, issue the command <command>sudo su -</command> and enter the password of the <systemitem class="username">root</systemitem> user.</listitem>\r
231                                         </itemizedlist>\r
232                                         <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 switch from the <systemitem class="username">root</systemitem> user to the <systemitem class="username">opensrf</systemitem> user, issue the command <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 command <command>exit"</command>.</para>\r
233                                 </note>\r
234                                 <section>\r
235                                         <title>Add the OpenSRF User</title>\r
236                                         <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 <command>/bin/bash</command> to inherit a reasonable environment:</para>\r
237                                         <figure>\r
238                                                 <title>Commands to add <systemitem class="username">opensrf</systemitem> user</title>\r
239                                                 <screen>\r
240                                         $ su - opensrf\r
241                                         $ useradd -m -s /bin/bash opensrf\r
242                                         $ passwd opensrf\r
243                                         Enter new UNIX password: ******\r
244                                         Retype new UNIX password: ******\r
245                                         passwd: password updated successfully\r
246                                         $\r
247                                         </screen>\r
248                                         </figure>\r
249                                 </section>\r
250                                 <section>\r
251                                         <title>Download and Unpack Latest OpenSRF Version</title>\r
252                                         <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the latest version of OpenSRF. The latest version can be found here: <ulink url="http://evergreen-ils.org/downloads/OpenSRF-1.0.7.tar.gz"></ulink></para>\r
253                                         <figure>\r
254                                                 <title>Commands to download and unpack OpenSRF</title>\r
255                                                 <screen>\r
256                                         $ su - opensrf\r
257                                         $ wget http://evergreen-ils.org/downloads/OpenSRF-1.0.7.tar.gz\r
258                                         $ tar zxf OpenSRF-1.0.7.tar.gz\r
259                                         </screen>\r
260                                         </figure>\r
261                                         <para>The new directory <filename class="directory">/home/opensrf/OpenSRF-1.0.7</filename> will be created.</para>\r
262                                 </section>\r
263                                 <section>\r
264                                         <title>Install Prerequisites to Build OpenSRF</title>\r
265                                         <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 software using the <command>make</command> utility.</para>\r
266                                         <para>As the <systemitem class="username">root</systemitem> user, enter the commands show below to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace <emphasis>[DISTRIBUTION]</emphasis> in the example with the keyword corresponding to the actual <systemitem class="osname">Linux</systemitem> distribution listed in the <link linkend="serversideinstallation-keywords-figure-1a">"Keywords"</link> figure below.</para>\r
267                                         <figure>\r
268                                                 <title>Commands to install prerequisites for OpenSRF</title>\r
269                                                 <screen>\r
270                                         $ su - root\r
271                                         $ cd /home/opensrf/OpenSRF-1.0.7\r
272                                         $ make -f src/extras/Makefile.install [DISTRIBUTION]\r
273                                         ...\r
274                                         </screen>\r
275                                         </figure>\r
276                                         <table xml:id="serversideinstallation-keywords-figure-1a">\r
277                                                 <title>Keywords Targets for <application>"make"</application> Command</title>\r
278                                                 <tgroup align="left" cols="2" colsep="1" rowsep="1">\r
279                                                         <colspec colnum="1" colwidth="1.0*"/>\r
280                                                         <colspec colnum="2" colwidth="3.0*"/>\r
281                                                         <thead>\r
282                                                                 <row>\r
283                                                                         <entry>Keyword</entry>\r
284                                                                         <entry>Description</entry>\r
285                                                                 </row>\r
286                                                         </thead>\r
287                                                         <tbody>\r
288                                                                 <row>\r
289                                                                         <entry>debian-lenny</entry>\r
290                                                                         <entry>for Debian Lenny (5.0)</entry>\r
291                                                                 </row>\r
292                                                                 <row>\r
293                                                                         <entry>debian-etch</entry>\r
294                                                                         <entry>for Debian Etch (4.0)</entry>\r
295                                                                 </row>\r
296                                                                 <row>\r
297                                                                         <entry>ubuntu-intrepid</entry>\r
298                                                                         <entry>for Intrepid (8.10)</entry>\r
299                                                                 </row>\r
300                                                                 <row>\r
301                                                                         <entry>ubuntu-hardy</entry>\r
302                                                                         <entry>for Ubuntu Hardy (8.04)</entry>\r
303                                                                 </row>\r
304                                                         </tbody>\r
305                                                 </tgroup>\r
306                                         </table>\r
307                                         <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 the initial CPAN configuration prompt to allow it to automatically configure itself to download and install Perl modules from CPAN. The CPAN installer will ask you a number of times whether it should install prerequisite modules - say <literal>Yes</literal>.</para>\r
308                                 </section>\r
309                                 <section>\r
310                                         <title>Configure OpenSRF</title>\r
311                                         <para>As the <systemitem class="username">opensrf</systemitem> user, return to the OpenSRF build directory and use the <command>configure</command> utility to prepare for the next step of compiling and linking the software. You can include the  <option>--enable-python</option> and <option>--enable-java</option> configuration options if you wish to include support for Python and Java, respectively:</para>\r
312                                         <figure>\r
313                                                 <title>Commands to configure OpenSRF</title>\r
314                                                 <screen>\r
315                                         $ su - opensrf\r
316                                         $ cd /home/opensrf/OpenSRF-1.0.7\r
317                                         $ ./configure --prefix=/openils --sysconfdir=/openils/conf\r
318                                         $ make\r
319                                         ...\r
320                                         </screen>\r
321                                         </figure>\r
322                                 </section>\r
323                                 <section>\r
324                                         <title>Compile, Link and Install OpenSRF</title>\r
325                                         <para>As the <systemitem class="username">root</systemitem> user, return to the OpenSRF build directory and use the <command>make</command> utility to compile, link and install OpenSRF:</para>\r
326                                         <figure>\r
327                                                 <title>Commands to build, link and install OpenSRF</title>\r
328                                                 <screen>\r
329                                         $ su - opensrf\r
330                                         $ cd /home/opensrf/OpenSRF-1.0.7\r
331                                         $ make install\r
332                                         ...\r
333                                         </screen>\r
334                                         </figure>\r
335                                 </section>\r
336                                 <section>\r
337                                         <title>Update the System Dynamic Library Path</title>\r
338                                         <para>As the <systemitem class="username">root</systemitem> user, you must update the system dynamic library path to make your system recognize the newly 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 command <command>ldconfig</command> to automatically read the file and modify the system dynamic library path:</para>\r
339                                         <figure>\r
340                                                 <title>Commands to modify system dynamic library path</title>\r
341                                                 <screen>\r
342                                         $ su - root\r
343                                         $ echo "/openils/lib" > /etc/ld.so.conf.d/osrf.conf\r
344                                         $ ldconfig\r
345                                         </screen>\r
346                                         </figure>\r
347                                 </section>\r
348                                 <section>\r
349                                         <title>Define Public and Private OpenSRF Domains</title>\r
350                                         <para>Define your public and private OpenSRF domains. For security purposes, OpenSRF uses Jabber domains to separate services into public and private realms. Throughout these instructions, we will use the example domains <systemitem class="domainname">public.localhost</systemitem> for the public domain and <systemitem class="domainname">private.localhost</systemitem> for the private domain. On a single-server system, the easiest way to define public and private domains is to define separate host names by adding entries to the file <filename>/etc/hosts</filename>.</para>\r
351                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/hosts</filename> and add the following entries for our example domains:</para>\r
352                                         <figure>\r
353                                                 <title>Example public and private domains in /etc/hosts</title>\r
354                                                 <screen>\r
355                                         127.0.1.2       public.localhost        public\r
356                                         127.0.1.3       private.localhost       private\r
357                                         </screen>\r
358                                         </figure>\r
359                                 </section>\r
360                                 <section>\r
361                                         <title>Change File Ownerships</title>\r
362                                         <para>As the <systemitem class="username">root</systemitem> user, change the ownership of files installed in the directory <filename class="directory">/openils</filename> to the <systemitem class="username">opensrf</systemitem> user:</para>\r
363                                         <figure>\r
364                                                 <title>Commands to change file ownerships</title>\r
365                                                 <screen>\r
366                                         $ chown -R opensrf:opensrf /openils\r
367                                         </screen>\r
368                                         </figure>\r
369                                 </section>\r
370                                 <section>\r
371                                         <title>Stop the <systemitem class="service">ejabberd</systemitem> Service</title>\r
372                                         <para>As the <systemitem class="username">root</systemitem> user, stop the <systemitem class="service">ejabberd</systemitem> service:</para>\r
373                                         <figure>\r
374                                                 <title>Commands to stop the <systemitem class="service">ejabberd</systemitem> service</title>\r
375                                                 <screen>\r
376                                         $ /etc/init.d/ejabberd stop\r
377                                         </screen>\r
378                                         </figure>\r
379                                         <para>If <systemitem class="service">ejabberd</systemitem> reports that it is already stopped, it may have run into a problem starting back at the installation stage. One possible fix is to kill any remaining <systemitem class="daemon">beam</systemitem> and <systemitem class="daemon">epmd</systemitem> processes, then edit the configuration file <filename>/etc/ejabberd/ejabberd.cfg</filename> to hardcode a domain:</para>\r
380                                         <figure>\r
381                                                 <title>Commands to recover from <systemitem class="service">ejabberd</systemitem> errors</title>\r
382                                                 <screen>\r
383                                         $ su - root\r
384                                         $ epmd -kill\r
385                                         $ killall beam; killall beam.smp\r
386                                         $ rm /var/lib/ejabberd/*\r
387                                         $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd\r
388                                         </screen>\r
389                                         </figure>\r
390                                 </section>\r
391                                 <section>\r
392                                         <title>Edit the <systemitem class="service">ejabberd</systemitem> configuration</title>\r
393                                         <para>As the <systemitem class="username">root</systemitem> user, edit the file <filename>/etc/ejabberd/ejabberd.cfg</filename> and make the following changes:</para>\r
394                                         <itemizedlist>\r
395                                                 <listitem>Change <literal>{hosts, ["localhost"]}.</literal> to <literal>{hosts, ["localhost", "private.localhost", "public.localhost"]}.</literal></listitem>\r
396                                                 <listitem>Change <literal>{max_user_sessions, 10}.</literal> to <literal>{max_user_sessions, 1000}.</literal> If you see something like this instead: <literal>{access, max_user_sessions, [{10, all}]}.</literal>, then change it to <literal>{access, max_user_sessions, [{1000, all}]}.</literal></listitem>\r
397                                                 <listitem>Change all three occurrences of <literal>max_stanza_size</literal> to <literal>2000000</literal>.</listitem>\r
398                                                 <listitem>Change both occurrences of <literal>maxrate</literal> to <literal>500000</literal>.</listitem>\r
399                                                 <listitem>Comment out the line <literal>{mod_offline, []}</literal> by placing two <literal>%</literal> comment signs in front.</listitem>\r
400                                         </itemizedlist>\r
401                                 </section>\r
402                                 <section>\r
403                                         <title>OpenSRF installation - (continued)</title>\r
404                                         <para>\r
405                                                 <emphasis>The remainder of the OpenSRF installation procedure is identical to that for installing the latest version of OpenSRF. Continue with the instructions found in <xref linkend="serversideinstallation-opensrf-continued"/>.</emphasis>\r
406                                         </para>\r
407                                 </section>\r
408                         </section>\r
409                 </section>\r
410                 <section xml:id="serversideinstallation-postgresql">\r
411                         <title>Installing PostgreSQL</title>\r
412                         <para>In production Evergreen systems, the PostgreSQL database server may reside on the same system on which Evergreen is installed or on another standalone system so, by default, PostgreSQL is not automatically installed along with Evergreen. This section details the steps needed to manually install PostgreSQL on a <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> system.</para>\r
413                         <para>If your PostgreSQL server will be on the same system as your Evergreen software, return to the previous section <xref linkend="serversideinstallation-postgresql-default"/> and follow those instructions. Otherwise, to manually install PostgreSQL on a system, continue with the instructions below.</para>\r
414                         <note>\r
415                                 <para>Some <systemitem class="osname">Linux</systemitem> distributions, such as <systemitem class="osname">Debian Etch (4.0)</systemitem>, do not offer PostgreSQL version 8.2 as an installable package. Before you continue, examine the software dependencies listed in <xref linkend="serversideinstall-software-dependencies"/> to ensure that your Linux distribution supports the required version of PostgreSQL.</para>\r
416                         </note>\r
417                         <procedure>\r
418                                 <step>\r
419                                         <para>Install the application <application>"stow"</application> on your system if it is not already installed. Issue the following command as the <systemitem class="username">root</systemitem> user:</para>\r
420                                         <figure>\r
421                                                 <title>Installing <application>"stow"</application></title>\r
422                                                 <screen>\r
423                                                 $ apt-get install stow\r
424                                                 ...\r
425                                                 </screen>\r
426                                         </figure>\r
427                                 </step>\r
428                                 <step>\r
429                                         <para>Download, compile, and install the latest release for PostgreSQL 8.2 (which was version <literal>8.2.12</literal> at the time of this writing). As the <systemitem class="username">root</systemitem> user, follow these steps:</para>\r
430                                         <figure>\r
431                                                 <title>Installing PostgreSQL</title>\r
432                                                 <screen>\r
433                                                 $ wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.2.17/postgresql-8.2.17.tar.bz2\r
434                                                 $ tar xzf postgresql-8.2.17.tar.gz\r
435                                                 $ cd postgresql-8.2.17\r
436                                                 $ ./configure --with-perl --enable-integer-datetimes --with-openssl --prefix=/usr/local/stow/pgsql\r
437                                                 ...\r
438                                                 $ make\r
439                                                 ...\r
440                                                 $ make install\r
441                                                 ...\r
442                                                 $ cd contrib\r
443                                                 $ make\r
444                                                 ...\r
445                                                 $ make install\r
446                                                 $ cd xml2\r
447                                                 $ make\r
448                                                 ...\r
449                                                 $ make install\r
450                                                 $ cd /usr/local/stow\r
451                                                 $ stow pgsql\r
452                                                 </screen>\r
453                                         </figure>\r
454                                 </step>\r
455                                 <step>\r
456                                         <para>Create the new user <systemitem class="username">postgres</systemitem> to run the PostgreSQL processes. As the <systemitem class="username">root</systemitem> user, execute this command:</para>\r
457                                         <figure>\r
458                                                 <title>Adding <systemitem class="username">postgres</systemitem></title>\r
459                                                 <screen>\r
460                                                 $ adduser postgres\r
461                                                 </screen>\r
462                                         </figure>\r
463                                 </step>\r
464                                 <step>\r
465                                         <para>Initialize the database directory and start up PostgreSQL. As the <systemitem class="username">root</systemitem> user, follow these steps:</para>\r
466                                         <figure>\r
467                                                 <title>Adding <systemitem class="username">postgres</systemitem></title>\r
468                                                 <screen>\r
469                                                 $ mkdir -p /usr/local/pgsql/data\r
470                                                 $ chown postgres /usr/local/pgsql/data\r
471                                                 $ su - postgres\r
472                                                 $ initdb -D /usr/local/pgsql/data -E UNICODE --locale=C\r
473                                                 $ pg_ctl -D /usr/local/pgsql/data -l /home/postgres/logfile start\r
474                                                 </screen>\r
475                                         </figure>\r
476                                         <note>\r
477                                                 <para>If an error occurs during the final step above, review the path of the home directory for the <systemitem class="username">postgres</systemitem> user. It may be <literal>/var/lib/postresql</literal> instead of <literal>/home/postres</literal>.</para>\r
478                                         </note>\r
479                                 </step>\r
480                                 <step>\r
481                                         <para>The values of several PostreSQL configuration parameters may be changed for enhanced performance. The following table lists the default values and some suggested updates for several useful parameters:</para>\r
482                                         <table>\r
483                                                 <title>Suggested configuration values</title>\r
484                                                 <tgroup align="left" cols="3" colsep="1" rowsep="1">\r
485                                                         <colspec colnum="1" colwidth="1.0*"/>\r
486                                                         <colspec colnum="2" colwidth="1.0*"/>\r
487                                                         <colspec colnum="3" colwidth="1.0*"/>\r
488                                                         <thead>\r
489                                                                 <row>\r
490                                                                         <entry>Parameter</entry>\r
491                                                                         <entry>Default</entry>\r
492                                                                         <entry>Suggested</entry>\r
493                                                                 </row>\r
494                                                         </thead>\r
495                                                         <tbody>\r
496                                                                 <row>\r
497                                                                         <entry>default_statistics_target</entry>\r
498                                                                         <entry>10</entry>\r
499                                                                         <entry>100</entry>\r
500                                                                 </row>\r
501                                                                 <row>\r
502                                                                         <entry>work_mem</entry>\r
503                                                                         <entry>4Mb</entry>\r
504                                                                         <entry>128Mb</entry>\r
505                                                                 </row>\r
506                                                                 <row>\r
507                                                                         <entry>shared_buffers</entry>\r
508                                                                         <entry>8Mb</entry>\r
509                                                                         <entry>512Mb</entry>\r
510                                                                 </row>\r
511                                                                 <row>\r
512                                                                         <entry>effective_cache_size</entry>\r
513                                                                         <entry>128Mb</entry>\r
514                                                                         <entry>4Gb</entry>\r
515                                                                 </row>\r
516                                                         </tbody>\r
517                                                 </tgroup>\r
518                                         </table>\r
519                                         <indexterm>\r
520                                                 <primary>ZZZ-REVIEW</primary>\r
521                                                 <secondary>ADD CONTENT ON HOW TO UPDATE POSTRESQL PARAMETERS</secondary>\r
522                                         </indexterm>\r
523                                         <caution>ADD CONTENT ON HOW TO UPDATE POSTRESQL PARAMETERS </caution>\r
524                                 </step>\r
525                         </procedure>\r
526                 </section>\r
527                 <section xml:id="serversideinstallation-apache">\r
528                         <title>Installing Apache</title>\r
529                         <section>\r
530                                 <title>Securing Apache (httpd)</title>\r
531                                 <para>The main consideration is to secure the directory <filename class="directory">cgi-bin</filename>. The only persons that need access to this directory are Evergreen system administrators. This directory should be restricted by both IP (to those workstations designated as Evergeen Administration systems), and by username/password.</para>\r
532                                 <indexterm>\r
533                                         <primary>ZZZ-REVIEW</primary>\r
534                                         <secondary>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </secondary>\r
535                                 </indexterm>\r
536                                 <caution>ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD </caution>\r
537                                 <para>A user could add new libraries, re-arrange consortia, or change user groups; or a staff member could access the directory, and change his associated security group to administrative level privileges.</para>\r
538                         </section>\r
539                         <indexterm>\r
540                                 <primary>ZZZ-REVIEW</primary>\r
541                                 <secondary>ADD MORE CONTENT FOR APACHE </secondary>\r
542                         </indexterm>\r
543                         <caution>ADD MORE CONTENT FOR APACHE </caution>\r
544                 </section>\r
545         </chapter>\r