From 3dade98a0fbdae6f3147c5d0b4b0cfb7bb89259d Mon Sep 17 00:00:00 2001 From: Steve Sheppard Date: Mon, 30 Aug 2010 22:16:22 -0400 Subject: [PATCH] expand the section "Installing OpenSRF on Ubuntu or Debian"; minor bug fixes to section "Installing Evergreen on Ubuntu or Debian"; --- 1.6/admin/ServersideInstallation.xml | 1754 ++++++++++++++++++++++------------ 1 file changed, 1127 insertions(+), 627 deletions(-) diff --git a/1.6/admin/ServersideInstallation.xml b/1.6/admin/ServersideInstallation.xml index 9f41bf6842..54e8fd7e0e 100644 --- a/1.6/admin/ServersideInstallation.xml +++ b/1.6/admin/ServersideInstallation.xml @@ -18,11 +18,53 @@ Installation of the Evergreen Staff Client software is handled in the section "Installing the Evergreen Staff Client" .
+ Evergreen Software Dependencies + The Evergreen server-side software is keyed to certain major software sub-components in the Evergreen environment. Successful installation of Evergreen software requires that software versions agree with those listed here: +
+ Evergreen software dependencies + + + + + + + + Evergreen + OpenSRF + PostgreSQL + + + + + 1.6.x + 1.2 + 8.2 / 8.3 + + + + + 1.4.x + 1.0 + 8.1 / 8.2 + + + + + 1.2.x + 0.9 + 8.1 / 8.2 + + + + +
+ [[ VERIFY THE DEPENDENCIES IN THIS TABLE ]] +
+
Current Stable Software Release The current stable release of Evergreen is version 1.6.0.7. Instructions for installing, configuring and testing that version on the Ubuntu or Debian Linux systems are found in the section "Installing Evergreen on Ubuntu or Debian" . - This release of Evergreen software is dependent on the Open Service Request Framework (OpenSRF) software framework. The current stable release of OpenSRF is version 1.2.2. Instructions for installing, configuring and testing that version are found in the section "Installing OpenSRF" . - + This release of Evergreen software is dependent on the Open Service Request Framework (OpenSRF) software framework. The current stable release of OpenSRF is version 1.2.2. Instructions for installing, configuring and testing that version are found in the section "Installing OpenSRF" .
Previous Software Releases @@ -118,673 +160,1123 @@
-
- Installing Evergreen On Ubuntu or Debian - This section outlines the installation process for the latest stable version of Evergreen (1.6.0.7). - 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. - As far as possible, perform the following steps in the order they are given since the success of many steps relies on the successful completion of earlier steps. You should make backup copies of files and environments when you are instructed to do so. In the event of installation problems those copies can allow you to back out of a step gracefully and resume the installation from a known state. +
+ Installation of Server-Side Software + This section describes the installation of the major components of Evergreen server-side software, including the Open Service Request Framework (OpenSRF), and Evergreen itself. + As far as possible, perform the following steps in the exact order they are given since the success of many steps relies on the successful completion of earlier steps. You should make backup copies of files and environments when you are instructed to do so. In the event of installation problems those copies can allow you to back out of a step gracefully and resume the installation from a known state. See the section on "Backing Up" for further information. Of course, after you successfully complete and test the entire Evergreen installation you should take a final snapshot backup of your system(s). This can be the first in the series of regularly scheduled system backups that you should probably also begin. - - - The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) architectures. There may be differences between the Desktop and Server editions of Ubuntu. These instructions assume the Server edition. - In the following instructions, you are asked to perform certain steps as either the root user, the opensrf user, or the postgres user. - To become the root user, issue the command: su - root. To switch from the root user to a different user, issue a command like: su - USERNAME. For example, to switch from the root user to the opensrf user, issue this command: su - opensrf. Once you have become a non-root user, to become the root user again, simply issue the exit command. - -
- Installing OpenSRF - Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see the section "Installing OpenSRF" . - 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. -
-
- Download and Unpack Latest Evergreen Version - As the opensrf user, download and extract the latest version of Evergreen. The latest version can be found here: - [[ VERIFY LOCATION OF LATEST VERSION OF EVERGREEN ]] -
- Commands to download/extract Evergreen - - $ su - opensrf - $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz - $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz - -
-
-
- Install Prerequisites to Build Evergreen - In this step you will install and configure a set of prerequisites used to build the Evergreen server-side software. In a following step you will actually build the software using the make utility. - As the root user, enter the commands show below in Figure 1.3 to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace [distribution] in the example with the keyword corresponding to the actual Linux distribution listed here: -
Keywords used with "make" - debian-lenny for Debian Lenny (5.0), the most recent version - debian-etch for Debian Etch (4.0) - - ubuntu-karmic for Ubuntu Lucid (10.04) [same as for Karmic] - ubuntu-karmic for Ubuntu Karmic (9.10) - ubuntu-intrepid for Ubuntu Intrepid (8.10) - ubuntu-hardy for Ubuntu Hardy (8.04) - ubuntu-gutsy for Ubuntu Gutsy (7.10) - - gentoo generic for Gentoo versions - centos generic for Centos versions - - [[ ADD INFO FOR OTHER LINUX DISTRIBUTIONS ]] -
-
- Commands to install prerequisites for Evergreen - - $ su - root - $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 - $ make -f Open-ILS/src/extras/Makefile.install [distribution] - -
-
-
- (OPTIONAL) Install the PostgreSQL Server - Since the PostgreSQL server is usually a standalone server in multi-server production systems, the prerequisite installer Makefile in the previous step does not automatically install PostgreSQL. If your PostgreSQL server is on a different system, just skip this step. - For further information on installing PostgreSQL, see the section "Installing PostgreSQL" . - If your PostgreSQL server will be on the same system as your Evergreen software, then as the root user install the required PostgreSQL server packages: -
- Commands to install the PostgreSQL server - - $ su - root - - # Debian Lenny and Ubuntu Hardy (8.04) - $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83 - - # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04) - $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84 - -
- - - PostgreSQL 8.1 is deprecated and will become unsupported in a future release, though existing installations upgrading from Evergreen 1.4 or before will work fine. However, consider upgrading your Postgres soon! - - - [[ VERIFY: IS THIS STILL TRUE? ]] - [[ ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE ]] -
-
- (OPTIONAL) Install Perl Modules on PostgreSQL Server - If PostgreSQL is running on the same system as your Evergreen software, then the Perl modules will automatically be available. Just skip this step. - Otherwise, if your PostgreSQL server is running on another system, then as the root user install the following Perl modules on that system: -
- Commands to install Perl modules - - # ensure the gcc compiler is installed - $ su - root - $ aptitude install gcc - - # install the Perl modules - $ perl -MCPAN -e shell - cpan> install JSON::XS - cpan> install MARC::Record - cpan> install MARC::File::XML - -
- [[ ADD INFO ON HOW TO INSTALL THE PERL MODULES ]] - [[ ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED ]] -
-
- Add Additional Library Paths on Evergreen System - As the root user, you must update the system dynamic library path to ensure the system will recognize the newly installed libraries. Do this by creating a new file named /etc/ld.so.conf.d/eg.conf containing the two paths, then run the command ldconfig to automatically read the file and modify the dynamic library path: -
- Commands to modify system dynamic library path - - $ su - root - $ cat > /etc/ld.so.conf.d/eg.conf << ENDOFFILE - /usr/local/lib - /usr/local/lib/dbd - ENDOFFILE - $ ldconfig - -
-
-
- (OPTIONAL) Restart the PostgreSQL Service - If PostgreSQL is running on the same system as the rest of Evergreen, as the root user you must restart the PostgreSQL service to avoid a problem where the library plperl.so cannot be found. If your PostgreSQL server is running on another system, just skip this step. - [[ ADD INFO ON OTHER VERSIONS OF POSTGRESQL ]] -
- Commands to restart PostgreSQL service - - $ su - root - $ /etc/init.d/postgresql-8.3 restart - -
-
-
- Configure and Compile Evergreen Sources - As the opensrf user, configure and compile the software from the prerequisites that were set up in previous steps: -
- Commands to configure and compile Evergreen - - $ su - opensrf - $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 - $ ./configure --prefix=/openils --sysconfdir=/openils/conf - $ make - -
-
-
- Link and Install Evergreen - As the root user, link and install the compiled code. In the commands below, remember to set the variable STAFF_CLIENT_BUILD_ID to match the version of the Staff Client you will use to connect to the Evergreen server. Finally, create a symbolic link named server in /openils/var/web/xul to the /server subdirectory of your Staff Client build: -
- Commands to link and install Evergreen - - $ su - root - $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 - $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_6 install - $ cd /openils/var/web/xul - $ ln -sf rel_1_6_0_7/server server - -
-
-
- Copy the OpenSRF Configuration Files - As the root user, copy the example OpenSRF configuration files into place. This will replace the OpenSRF configuration files that you set up while installing and testing OpenSRF. You should also create backup copies of the old files for troubleshooting purposes. Finally, change the ownership on the installed files to the user opensrf: -
- Commands to copy OpenSRF configuration files - - $ su - root - $ cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml - $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml - $ cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml - $ chown -R opensrf:opensrf /openils/ - -
-
-
- Create and configure PostgreSQL Database - As the postgres user on your PostgreSQL server, create the Evergreen database. - Remember to adjust the path for the contrib repository to match your PostgreSQL server layout. For example, if you built PostgreSQL from source following the cheat sheet, the contrib directory will be located here: /usr/local/share/contrib . If you installed the PostgreSQL 8.3 server packages on Ubuntu 8.04, the directory will be located here: /usr/share/postgresql/8.3/contrib/ . - - - - Create and configure the database - - As the postgres user on the PostgreSQL system create the PostgreSQL database, then set some internal paths: -
- Commands to create database and adjust the path - - # create the database - $ su - postgres - $ createdb -E UNICODE evergreen - $ createlang plperl evergreen - $ createlang plperlu evergreen - $ createlang plpgsql evergreen - - # adjust the paths - $ psql -f /usr/share/postgresql/8.3/contrib/tablefunc.sql evergreen - $ psql -f /usr/share/postgresql/8.3/contrib/tsearch2.sql evergreen - $ psql -f /usr/share/postgresql/8.3/contrib/pgxml.sql evergreen - -
-
- - Create new Evergreen superuser - As the postgres user on the PostgreSQL system, create the new user evergreen : -
- Commands to create the 'evergreen' user - - # create superuser 'evergreen' and set the password - $ su - postgres - $ createuser -P -s evergreen - Enter password for new role: mynewpassword - Enter it again: mynewpassword - -
-
-
-
-
- Create Database Schema - As the root user, create the database schema and configure your system with the corresponding database authentication details for the database user 'evergreen' that you created in the previous step. - Enter the commands and replace [HOSTNAME], [PORT], [USER], [PASSWORD] and [DATABASENAME] with appropriate values. - On most systems [HOSTNAME] will be localhost, and [PORT] will be 5432. -
- Commands to create Evergreen database schema - - $ su - root - $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 - $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \ - --service all --create-schema --create-bootstrap --create-offline \ - --hostname [HOSTNAME] --port [PORT] \ - --user [USER] --password [PASSWORD] --database [DATABASENAME] - -
+
+ Installing OpenSRF On Ubuntu or Debian + 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, on Ubuntu or Debian systems. Evergreen software is integrated with and depends on the OpenSRF software system. + 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. - - If you are entering the above command on a single line, do not include the \ (backslash) characters. If you are using the bash 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. - + The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) platforms. OpenSRF 1.2.0 has been tested on Debian Etch (4.0), Debian Lenny, Ubuntu Hardy Heron (8.04), and Ubuntu Intrepid Ibex (8.10). + In the following instructions, you are asked to perform certain steps as either the root user, the opensrf user, or the postgres user. + + Debian To become the root user, issue the command su - and enter the password of the root user. + Ubuntu To become the root user, issue the command sudo su - and enter the password of your current user. + + To switch from the root user to a different user, issue the command su - USERNAME. For example, to switch from the root user to the opensrf user, issue the command su - opensrf. Once you have become a non-root user, to become the root user again, simply issue the command exit. -
-
- Configure the Apache Server - As the root user, configure the Apache server and copy several new configuration files to the Apache server directories: -
- Commands to configure the Apache server - - # configure the Apache server - $ su - root - $ a2enmod ssl # enable mod_ssl - $ a2enmod rewrite # enable mod_rewrite - $ a2enmod expires # enable mod_expires - $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 - - # copy files - $ cp Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/ - $ cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/ - $ cp Open-ILS/examples/apache/startup.pl /etc/apache2/ - -
-
-
- Create a Security Certificate (SSL Key) - Use the command openssl to create a new SSL key for your Apache server. For a public production server you should configure or purchase a signed SSL certificate, but for now you can just use a self-signed certificate and accept the warnings in the Staff Client and browser during testing and development: -
- Commands to create an SSL key - - $ mkdir /etc/apache2/ssl - $ cd /etc/apache2/ssl - $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key - -
- - - This is only a temporary measure to expedite testing. You must get a proper SSL certificate for a public production system. See this section for further comments on setting up a properly signed SSL certificate: - - - [[ ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE ]] -
-
- Modify the Apache Configuration File - As the root user, edit the Apache configuration file /etc/apache2/sites-available/eg.conf and make the following changes: - - - Comment out the line Allow from 10.0.0.0/8, then uncomment the line Allow from all. +
+ Add the OpenSRF User + As the root user, add the opensrf user to the system. The default shell for the new user is automatically set to /bin/bash to inherit a reasonable environment: +
+ Add the user "opensrf" + + $ su - opensrf + $ useradd -m -s /bin/bash opensrf + $ passwd opensrf + +
+
+
+ Download and Unpack Latest OpenSRF Version + As the opensrf user, download and extract the latest version of OpenSRF. The latest version can be found here: + [[ VERIFY LOCATION OF LATEST VERSION OF OPENSRF ]] +
+ Commands to download/extract OpenSRF + + $ su - opensrf + $ wget http://evergreen-ils.org/downloads/OpenSRF-1.2.2.tar.gz + $ tar zxf OpenSRF-1.2.2.tar.gz + +
+ The new directory /home/opensrf/OpenSRF-1.2.2 will be created. +
+
+ Install Prerequisites to Build OpenSRF + In this step you will install and configure a set of prerequisites used to build OpenSRF. In a following step you will actually build the software using the make utility. + As the root user, enter the commands show below in Figure 1.5 to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace [distribution] in the example with the keyword corresponding to the actual Linux distribution listed here: + [[ ADD INFO FOR OTHER LINUX DISTRIBUTIONS ]] +
+ Keywords used with "make" + + + + + + + Keyword + Description + + + + + debian-lenny + for Debian Lenny (5.0), the most recent version + + + + + debian-etch + for Debian Etch (4.0) + + + + + ubuntu-intrepid + for Ubuntu Jaunty (9.04) + + + + + ubuntu-intrepid + for Ubuntu Intrepid (8.10) + + + + + ubuntu-hardy + for Ubuntu Hardy (8.04) + + + + +
+
+ Commands to install prerequisites for OpenSRF + + $ su - root + $ cd /home/opensrf/OpenSRF-1.2.2 + $ make -f src/extras/Makefile.install [distribution] + +
+ This will install a number of packages required by OpenSRF on your system, including some Perl modules from CPAN. You can say "no" 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 "yes". +
+
+ Configure OpenSRF + As the opensrf user, configure OpenSRF by preparing a "make" file to be used in the next step to compile and link OpenSRF. You can include the --enable-python and --enable-java configure options if you want to include support for Python and Java, respectively: +
+ Commands to prepare make file for OpenSRF + + $ su - opensrf + $ cd /home/opensrf/OpenSRF-1.2.2 + $ ./configure --prefix=/openils --sysconfdir=/openils/conf + $ make + +
+
+
+ Compile and link OpenSRF + As the root user, return to your OpenSRF build directory and compile, link and install OpenSRF: +
+ Commands to build OpenSRF + + $ su - opensrf + $ cd /home/opensrf/OpenSRF-1.2.2 + $ make install + +
+
+
+ Update the system dynamic library path + As the root user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating a new file named /etc/ld.so.conf.d/eg.conf containing two new library paths, then run the command ldconfig to automatically read the file and modify the dynamic library path: +
+ Commands to modify system dynamic library path + + $ su - root + $ cat > /etc/ld.so.conf.d/eg.conf << ENDOFFILE + /usr/local/lib + /usr/local/lib/dbd + ENDOFFILE + $ ldconfig + +
+
+
+ Define public and private OpenSRF domains + 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 public.localhost for the public domain and private.localhost for the private domain. On a single-server system, the easiest way to define public and private domains is to define separate hostnames by adding entries to the file /etc/hosts. Here are the entries to add to a stock file /etc/hosts for our example domains: +
+ Entries to add to /etc/hosts + + 127.0.1.3 private.localhost private + +
+
+
+ Change file ownerships + As the root user, change the ownership of the installed files to the opensrf user: +
+ Entries to add to /etc/hosts + + chown -R opensrf:opensrf /openils + +
+
+
+ Stop the "ejabberd" service + As the root user, stop the "ejabberd" service: +
+ Stop the "ejabberd" service + + $ /etc/init.d/ejabberd stop + +
+ If "ejabberd" 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 beam and epmd processes, then edit the ejabberd configuration file to hardcode a domain: +
+ Stop the "ejabberd" service + + $ su - root + $ epmd -kill + $ killall beam; killall beam.smp + $ rm /var/lib/ejabberd/* + $ echo 'ERLANG_NODE=ejabberd@localhost' >> /etc/default/ejabberd + +
+
+
+ Edit the "ejabberd" configuration + As the root user, edit /etc/ejabberd/ejabberd.cfg : + + Change {hosts, ["localhost"]}. to {hosts, ["localhost", "private.localhost", "public.localhost"]}. + Change {max_user_sessions, 10}. to {max_user_sessions, 10000}. If you see something like this instead: {access, max_user_sessions, [{10, all}]}., then change it to {access, max_user_sessions, [{10000, all}]}. + Change all three occurrences of max_stanza_size to 2000000. + Change both occurrences of maxrate to 500000. + Comment out the {mod_offline line by placing two % signs in front. + +
+
+ Restart the "ejabberd" service + As the root user, restart the ejabberd service to test the configuration changes and to register your users: +
+ Restarting the "ejabberd" service + + $ /etc/init.d/ejabberd start + +
+
+
+ Register "router" and "ejabberd" users + On each domain, you need two "ejabberd" users to manage the OpenSRF communications: + + a "router" user, to whom all requests to connect to an OpenSRF service will be routed; this "ejabberd" user must be named "router" + an "opensrf" user, which clients use to connect to OpenSRF services; this user can be named anything you like, but we will use "opensrf" in our examples + + As the root user, register your ejabber users router and opensrf for the OpenSRF router service on each domain. The users should have different passwords on each domain. These users will correspond to your configuration in opensrf_core.xml: +
+ Register "router" and "ejabberd" users + + # Syntax for registering a user with ejabberdctl: + # ejabberdctl register <user> <domain> <password> + # + $ ejabberdctl register router private.localhost <password> + $ ejabberdctl register opensrf private.localhost <password> + $ ejabberdctl register router public.localhost <password> + $ ejabberdctl register opensrf public.localhost <password> + +
+
+
+ Create configuration files + As the opensrf user, create the configuration files /openils/conf/opensrf_core.xml and /openils/conf/opensrf.xml from the example templates: +
+ Commands to copy OpenSRF configuration files + + $ su - root + $ cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml + $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml + +
+
+
+ Edit opensrf_core.xml + Edit the file /openils/conf/opensrf_core.xml to change the "ejabberd" usernames and passwords as follows. + - This change allows access to your configuration CGI scripts from any workstation on any network. This is only a temporary change to expedite testing and should be removed after you have finished and successfully tested the Evergreen installation. + The following example uses common XPath syntax on the left-hand side to indicate the aproximage position needing changes within the XML file. - - - You must remove these changes after testing is completed. See the section "Post-Installation Chores" for further details on removing this change after the Evergreen installation is complete. - - - - - Comment out the line Listen 443 as it conflicts with the same declaration in the configuration file: /etc/apache2/ports.conf . Debian etch users should not do this. - [[ ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS ]] - - - The following updates are needed to allow the logs to function properly, but it may break other Apache applications on your server. We hope to make this unnecessary soon. - [[ ADD INFO ON WHETHER THIS IS STILL NECESSARY ]] - - - For the Linux distributions Ubuntu Hardy or Debian Etch, as the root user, edit the Apache configuration file /etc/apache2/apache2.conf and change the user: - www-data - to the user: - opensrf - - - For the Linux distributions Ubuntu Karmic or Ubuntu Lucid or Debian Lenny, as the root user, edit the Apache configuration file /etc/apache2/envvars and change the phrase: - export APACHE_RUN_USER=www-data - to the phrase: - export APACHE_RUN_USER=opensrf - - - - - As the root user, edit the Apache configuration file /etc/apache2/apache2.conf and add the line KeepAliveTimeout 1, or modify an existing line if it already exists. - - -
-
- (OPTIONAL) Performance Modifications for Apache - Some further configuration changes to Apache may be necessary for busy systems. These changes increase the number of Apache server processes that can be started to support additional browser connections, and are made to the prefork configuration section of the Apache configuration file. - - As the root user, edit the Apache configuration file /etc/apache2/apache2.conf and add the line MaxKeepAliveRequests 100, or modify an existing line if it already exists. - - As the root user, edit the Apache configuration file /etc/apache2/apache2.conf, locate and modify the section related to prefork configuration to suit the load on your system. -
- (OPTIONAL) Updates to Apache configuration - - <IfModule mpm_prefork_module> - StartServers 20 - MinSpareServers 5 - MaxSpareServers 15 - MaxClients 150 - MaxRequestsPerChild 10000 - </IfModule> - - MaxKeepAliveRequests 100 - -
-
-
-
-
- Enable the Evergreen Site - You must run additional Apache configuration commands to enable the Evergreen web site. As the root user, run these commands: -
- Apache Commands to Enable the Evergreen Web Site - - $ su - root + +
+ Updates needed to the file "/openils/conf/opensrf_core.xml" + + /config/opensrf/username = opensrf - # disables the default site (i.e., the "It Works" page). - $ a2dissite default + /config/opensrf/passwd = password for "private.localhost" opensrf user - # enables the Evergreen web site - $ a2ensite eg.conf - -
-
-
- Modify the OpenSRF Configuration File - As the opensrf user, edit the OpenSRF configuration file /openils/conf/opensrf_core.xml to update various usernames and passwords, and to specify the domains from which we will accept and to which we will make connections. - If you are installing Evergreen on a single server and using the private.localhost / public.localhost domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values. - - - The following example uses common XPath syntax on the left-hand side to indicate the aproximage position needing changes within the XML file. - - - [[ ADD A BETTER DIAGRAM HERE ]] -
- Updates needed to the file "/openils/conf/opensrf_core.xml" - - /config/opensrf/username = opensrf + /config/gateway/username = opensrf - /config/opensrf/passwd = password for "private.localhost" opensrf user + /config/gateway/passwd = password for "public.localhost" opensrf user - /config/gateway/username = opensrf + # first entry, where "transport/server" == "public.localhost" : + /config/routers/router/transport + username = router + password = password for "public.localhost" router user - /config/gateway/passwd = password for "public.localhost" opensrf user - - # first entry, where "transport/server" == "public.localhost" : - /config/routers/router/transport - username = router - password = password for "public.localhost" router user - # second entry, where "transport/server" == "private.localhost" : - /config/routers/router/transport - username = router - password = password for "private.localhost" router user - -
-
-
- Create Configuration Files for Users Needing srfsh - The software installation will automatically create a utility named srfsh (surf shell). This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See the section "Testing the Installation" for further information. - In this step you will set up a special configuration file for each user who will need to run the utility. Copy the short sample configuration file /openils/conf/srfsh.xml.example to the file .srfsh.xml (note the leading dot!) in the home directory of each user who will use srfsh. Finally, edit each file .srfsh.xml and make the following changes: - - Modify domain to be the router hostname (following our domain examples, private.localhost will give the utility srfsh access to all OpenSRF services, while public.localhost will only allow access to those OpenSRF services that are publicly exposed). - Modify username and password to match the opensrf Jabber user for the chosen domain - Modify logfile to be the full path for a log file to which the user has write access - Modify loglevel as needed for testing - -
- Sample of configuration file /openils/conf/srfsh.xml.example - - <?xml version="1.0"?> - <!-- This file follows the standard bootstrap config file layout --> - <!-- found in opensrf_core.xml --> - <srfsh> - <router_name>router</router_name> - <domain>private.localhost</domain> - <username>opensrf</username> - <passwd>evergreen</passwd> - <port>5222</port> - <logfile>/tmp/srfsh.log</logfile> - <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) --> - <loglevel>4</loglevel> - </srfsh> - -
-
-
- Modify the OpenSRF Environment - As the opensrf user, change the file permissions of the directory /openils/var/cgi-bin to executable, then modify the shell configuration file ~/.bashrc of that user by adding a Perl environmental variable. Finally, execute the shell configuration file to load the new variables into your current environment. - - - In a multi-server environment, you must add any modifications to ~/.bashrc to the top of the file before the line [ -z "$PS1" ] && return. This will allow headless (scripted) logins to load the correct environment. - - -
- Modify the OpenSRF environment - - # change permissions - $ su - opensrf - $ chmod 755 /openils/var/cgi-bin/*.cgi - - # add environmental variable - $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc - - # inherit the new environment - $ . ~/.bashrc - -
-
-
- (OPTIONAL) Configuration for Other Languages - This section describes how translations such as Armenian (hy-AM), Canadian French (fr-CA) and others are loaded into the database to complete the translations (default English) available in the OPAC and Staff Client. - [[ ADD SECTION ON LANGUAGE LOCALIZATION ]] -
-
- Starting Evergreen - - - As the root user, start the memcached and ejabberd services (if they aren't already running): -
- Start some services - - $ su - root - $ /etc/init.d/ejabberd start - $ /etc/init.d/memcached start - -
-
- - As the opensrf user, start Evergreen. - Use the flag -l to force Evergreen to use localhost (your current system) as the hostname. -
- Start Evergreen - - $ su - opensrf - - # ensure you have the needed path - $ export PATH=$PATH:/openils/bin + # second entry, where "transport/server" == "private.localhost" : + /config/routers/router/transport + username = router + password = password for "private.localhost" router user + +
+ You also need to specify the domains from which Evergreen will accept and to which Evergreen will make connections. If you are installing OpenSRF on a single server and using the "private.localhost" / "public.localhost" domains, these will already be set to the correct values. Otherwise, search and replace to match your values. +
+
+ Edit opensrf.xml + Edit the file /openils/conf/opensrf.xml to set the location of the persistent database in the <dbfile> element near the end of the file: +
+ example of file "opensrf.xml" + + <!-- Example of an app-specific setting override --> + <opensrf.persist> + <app_settings> + <dbfile>/tmp/persist.db</dbfile> + </app_settings> + </opensrf.persist> + +
+
+
+ Copy srfsh.xml.example + In this step you will set up a special configuration file for each user who will need to run the utility. Copy the short sample configuration file /openils/conf/srfsh.xml.example to the file .srfsh.xml (note the leading dot!) in the home directory of each user who will use srfsh. Finally, edit each file .srfsh.xml and make the following changes: + + Modify domain to be the router hostname (following our domain examples, private.localhost will give srfsh access to all OpenSRF services, while public.localhost will only allow access to those OpenSRF services that are publicly exposed). + Modify username and password to match the opensrf Jabber user for the chosen domain + Modify logfile to be the full path for a log file to which the user has write access + Modify loglevel as needed for testing + +
+ Sample of configuration file /openils/conf/srfsh.xml.example + + <?xml version="1.0"?> + <!-- This file follows the standard bootstrap config file layout --> + <!-- found in opensrf_core.xml --> + <srfsh> + <router_name>router</router_name> + <domain>private.localhost</domain> + <username>opensrf</username> + <passwd>privsrf</passwd> + <port>5222</port> + <logfile>/tmp/srfsh.log</logfile> + <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) --> + <loglevel>4</loglevel> + </srfsh> + +
+
+
+ Modify environmental variable PATH for "opensrf" user + As the opensrf user, modify the environmental variable PATH by adding a new file path to the opensrf user's shell configuration file .bashrc: +
+ Add path to ".bashrc" configuration file + + $ echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc + $ exit + +
+
+
+ Start OpenSRF + Before starting OpenSRF, ensure that the "ejabberd" and "memcached" daemons are running. + As the root user, start the "ejabberd" and "memcached" services: +
+ Start some services + + $ su - root + $ /etc/init.d/ejabberd start + $ /etc/init.d/memcached start + +
+ As the root user, OpenSRF: +
+ Start OpenSRF + + $ su - opensrf - # start the server; - # use "-l" to force hostname to be "localhost" - $ osrf_ctl.sh -l -a start_all - -
- - - You can also start Evergreen without the -l flag, but the utility osrf_ctl.sh must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file opensrf.xml, which you configured in a previous step. - - - [[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]] - Execute the following command to determine the fully qualified domain name of your system: -
- (OPTIONAL) Determine the fully qualified domain name - - $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"' - -
- - When you attempt to start Evergreen, if you receive an error message similar to osrf_ctl.sh: command not found, then your environment variable PATH does not include the directory /openils/bin. As the opensrf user, edit the configuration file /home/opensrf/.bashrc and add the following line: export PATH=$PATH:/openils/bin - When you attempt to start Evergreen, if you receive an error message similar to Can't locate OpenSRF/System.pm in @INC ... BEGIN failed--compilation aborted, then your environment variable PERL5LIB does not include the directory /openils/lib/perl5. As the opensrf user, edit the configuration file /home/opensrf/.bashrc and add the following line: export PERL5LIB=$PERL5LIB:/openils/lib/perl5 - - - - As the opensrf user, generate the Web files needed by the Staff Client and catalogue, and calculate the proximity of locations in the Organizational Unit tree (which allows Holds to work properly). - You must do this the first time you start Evergreen, and after any time you change the library hierarchy in the configuration file config.cgi. -
- Generate web files - - $ su - opensrf - $ cd /openils/bin - $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u - Updating Evergreen organization tree and IDL using '/openils/conf/opensrf_core.xml' + # ensure you have the needed path + $ export PATH=$PATH:/openils/bin - Updating fieldmapper - Exception: OpenSRF::EX::Session 2010-04-16T06:31:38 OpenSRF::Utils::SettingsClient /usr/local/share/perl/5.10.0/OpenSRF/Utils/SettingsClient.pm:103 Session Error: router@private.localhost/opensrf.settings IS NOT CONNECTED TO THE NETWORK!!! - - [[ ADD RESULTS OF TESTS FROM "autogen.sh" ]] -
-
- - As the root user, restart the Apache Web server: -
- Generate web files - - $ su - root - $ /etc/init.d/apache2 restart - -
- If the Apache Web server was running when you started the OpenSRF services, you might not be able to successfully log in to the OPAC or Staff Client until the Apache Web server is restarted. -
- -
-
- Testing the Installation - This section describes several simple tests you can perform to verify that the Evergreen server-side software has been installed and configured properly and is running as expected. -
- Testing Connections to Evergreen - Once you have installed and started Evergreen, test your connection to Evergreen. As the opensrf user start the utility srfsh and try logging onto the Evergreen server using the default administrator username and password. Following is sample output generated by executing that script after a successful Evergreen installation: + # start the OpenSRF service: + # use "-l" to force hostname to be "localhost" + $ osrf_ctl.sh -l -a start_all + + + + + You can also start Evergreen without the -l flag, but osrf_ctl.sh must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file opensrf.xml, which you configured in a previous step. + + +
+
+ Testing connections to OpenSRF + As the root user, test your connection to OpenSRF by executing the utility srfsh and trying to call the add method on the OpenSRF "math" service:
- Running the srfsh utility + Testing OpenSRF with the "math" method $ su - opensrf $ /openils/bin/srfsh - srfsh% login admin open-ils - Received Data: "250bf1518c7527a03249858687714376" - ------------------------------------ - Request Completed Successfully - Request Time in seconds: 0.045286 - ------------------------------------ - Received Data: { - "ilsevent":0, - "textcode":"SUCCESS", - "desc":" ", - "pid":21616, - "stacktrace":"oils_auth.c:304", - "payload":{ - "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a", - "authtime":420 - } - } + srfsh# request opensrf.math add 2 2 + Received Data: 4 ------------------------------------ Request Completed Successfully - Request Time in seconds: 1.336568 + Request Time in seconds: 0.007519 ------------------------------------ + srfsh# + +
+ For other srfsh commands, type 'help' in at the prompt. +
+
+ Stopping OpenSRF + As the root user, stop OpenSRF: +
+ Testing OpenSRF with the "math" method + + $ su - opensrf + $ osrf_ctl.sh -l -a stop_all
- If this does not work, try other simple troubleshooting steps: +
+
+
+ Installing Evergreen On Ubuntu or Debian + This section outlines the installation process for the latest stable version of Evergreen (1.6.0.7). + 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. + + The following steps have been tested on the x86 (32-bit) and x86-64 (64-bit) architectures. There may be differences between the Desktop and Server editions of Ubuntu. These instructions assume the Server edition. + In the following instructions, you are asked to perform certain steps as either the root user, the opensrf user, or the postgres user. + Debian To become the root user, issue the command su - and enter the password of the root user. + Ubuntu To become the root user, issue the command sudo su - and enter the password of your current user. + + To switch from the root user to a different user, issue the command su - USERNAME. For example, to switch from the root user to the opensrf user, issue the command su - opensrf. Once you have become a non-root user, to become the root user again, simply issue the command exit. + +
+ Installing OpenSRF + Evergreen software is integrated with and depends on the Open Service Request Framework (OpenSRF) software system. For further information on installing, configuring and testing OpenSRF, see the section "Installing OpenSRF" . + 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. +
+
+ Download and Unpack Latest Evergreen Version + As the opensrf user, download and extract the latest version of Evergreen. The latest version can be found here: + [[ VERIFY LOCATION OF LATEST VERSION OF EVERGREEN ]] +
+ Commands to download/extract Evergreen + + $ su - opensrf + $ wget http://evergreen-ils.org/downloads/Evergreen-ILS-1.6.0.7.tar.gz + $ tar zxf Evergreen-ILS-1.6.0.7.tar.gz + +
+ The new directory /home/opensrf/Evergreen-ILS-1.6.0.1 will be created. +
+
+ Install Prerequisites to Build Evergreen + In this step you will install and configure a set of prerequisites used to build Evergreen. In a following step you will actually build the software using the make utility. + As the root user, enter the commands show below in Figure 1.3 to build the prerequisites from the software distribution that you just downloaded and unpacked. Remember to replace [distribution] in the example with the keyword corresponding to the actual Linux distribution listed here: + [[ ADD INFO FOR OTHER LINUX DISTRIBUTIONS ]] +
+ Keywords used with "make" + + + + + + + Keyword + Description + + + + + debian-lenny + for Debian Lenny (5.0), the most recent version + + + + + debian-etch + for Debian Etch (4.0) + + + + + ubuntu-karmic + for Ubuntu Lucid (10.04) [same as for Karmic] + + + + + ubuntu-karmic + for Ubuntu Karmic (9.10) + + + + + ubuntu-intrepid + for Ubuntu Intrepid (8.10) + + + + + ubuntu-hardy + for Ubuntu Hardy (8.04) + + + + + ubuntu-gutsy + for Ubuntu Gutsy (7.10) + + + + + gentoo + generic for Gentoo versions + + + + + centos + generic for Centos versions + + + + +
+
+ Commands to install prerequisites for Evergreen + + $ su - root + $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 + $ make -f Open-ILS/src/extras/Makefile.install [distribution] + +
+
+
+ (OPTIONAL) Install the PostgreSQL Server + Since the PostgreSQL server is usually a standalone server in multi-server production systems, the prerequisite installer Makefile in the previous step does not automatically install PostgreSQL. If your PostgreSQL server is on a different system, just skip this step. + For further information on installing PostgreSQL, see the section "Installing PostgreSQL" . + If your PostgreSQL server will be on the same system as your Evergreen software, then as the root user install the required PostgreSQL server packages: +
+ Commands to install the PostgreSQL server + + $ su - root + + # Debian Lenny and Ubuntu Hardy (8.04) + $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_83 + + # Ubuntu Karmic (9.10) and Ubuntu Lucid (10.04) + $ make -f Open-ILS/src/extras/Makefile.install install_pgsql_server_debs_84 + +
+ + + PostgreSQL 8.1 is deprecated and will become unsupported in a future release, though existing installations upgrading from Evergreen 1.4 or before will work fine. However, consider upgrading your Postgres soon! + + + [[ VERIFY: IS THIS STILL TRUE? ]] + [[ ADD INFO ON HOW TO DETERMINE WHICH VERSION OF POSTGRESQL YOU HAVE ]] +
+
+ (OPTIONAL) Install Perl Modules on PostgreSQL Server + If PostgreSQL is running on the same system as your Evergreen software, then the Perl modules will automatically be available. Just skip this step. + Otherwise, if your PostgreSQL server is running on another system, then as the root user install the following Perl modules on that system: +
+ Commands to install Perl modules + + # ensure the gcc compiler is installed + $ su - root + $ aptitude install gcc + + # install the Perl modules + $ perl -MCPAN -e shell + cpan> install JSON::XS + cpan> install MARC::Record + cpan> install MARC::File::XML + +
+ [[ ADD INFO ON HOW TO INSTALL THE PERL MODULES ]] + [[ ADD INFO ON HOW TO VERIFY THAT THE PERL MODULES ARE INSTALLED ]] +
+
+ Update the system dynamic library path + As the root user, you must update the system dynamic library path to make your system recognize the newly installed libraries. Do this by creating a new file named /etc/ld.so.conf.d/eg.conf containing two new library paths, then run the command ldconfig to automatically read the file and modify the dynamic library path: +
+ Commands to modify system dynamic library path + + $ su - root + $ cat > /etc/ld.so.conf.d/eg.conf << ENDOFFILE + /usr/local/lib + /usr/local/lib/dbd + ENDOFFILE + $ ldconfig + +
+
+
+ (OPTIONAL) Restart the PostgreSQL Service + If PostgreSQL is running on the same system as the rest of Evergreen, as the root user you must restart the PostgreSQL service to avoid a problem where the library plperl.so cannot be found. If your PostgreSQL server is running on another system, just skip this step. + [[ ADD INFO ON OTHER VERSIONS OF POSTGRESQL ]] +
+ Commands to restart PostgreSQL service + + $ su - root + $ /etc/init.d/postgresql-8.3 restart + +
+
+
+ Configure and Compile Evergreen Sources + As the opensrf user, configure and compile the software from the prerequisites that were set up in previous steps: +
+ Commands to configure and compile Evergreen + + $ su - opensrf + $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 + $ ./configure --prefix=/openils --sysconfdir=/openils/conf + $ make + +
+
+
+ Link and Install Evergreen + As the root user, link and install the compiled code. In the commands below, remember to set the variable STAFF_CLIENT_BUILD_ID to match the version of the Staff Client you will use to connect to the Evergreen server. Finally, create a symbolic link named server in /openils/var/web/xul to the /server subdirectory of your Staff Client build: +
+ Commands to link and install Evergreen + + $ su - root + $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 + $ make STAFF_CLIENT_BUILD_ID=rel_1_6_0_6 install + $ cd /openils/var/web/xul + $ ln -sf rel_1_6_0_7/server server + +
+
+
+ Copy the OpenSRF Configuration Files + As the root user, copy the example OpenSRF configuration files into place. This will replace the OpenSRF configuration files that you set up while installing and testing OpenSRF. You should also create backup copies of the old files for troubleshooting purposes. Finally, change the ownership on the installed files to the user opensrf: +
+ Commands to copy OpenSRF configuration files + + $ su - root + $ cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml + $ cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml + $ cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml + $ chown -R opensrf:opensrf /openils/ + +
+
+
+ Create and configure PostgreSQL Database + As the postgres user on your PostgreSQL server, create the Evergreen database. + Remember to adjust the path for the contrib repository to match your PostgreSQL server layout. For example, if you built PostgreSQL from source following the cheat sheet, the contrib directory will be located here: /usr/local/share/contrib . If you installed the PostgreSQL 8.3 server packages on Ubuntu 8.04, the directory will be located here: /usr/share/postgresql/8.3/contrib/ . + - As the opensrf user, run the script settings-tester.pl to see if it finds any system configuration problems. Following is sample output generated by executing that script after a successful Evergreen installation: - [[ MAY NEED TO REWORK THIS DIAGRAM TO USE SAME IMAGE STANDARDS AS OTHER CHAPTERS ]] + + Create and configure the database + + As the postgres user on the PostgreSQL system create the PostgreSQL database, then set some internal paths: +
+ Commands to create database and adjust the path + + # create the database + $ su - postgres + $ createdb -E UNICODE evergreen + $ createlang plperl evergreen + $ createlang plperlu evergreen + $ createlang plpgsql evergreen + + # adjust the paths + $ psql -f /usr/share/postgresql/8.3/contrib/tablefunc.sql evergreen + $ psql -f /usr/share/postgresql/8.3/contrib/tsearch2.sql evergreen + $ psql -f /usr/share/postgresql/8.3/contrib/pgxml.sql evergreen + +
+
+ + Create new Evergreen superuser + As the postgres user on the PostgreSQL system, create the new user evergreen :
- Executing the script <emphasis> settings-test.pl</emphasis> - - - - - - - - - - + Commands to create the 'evergreen' user + + # create superuser 'evergreen' and set the password + $ su - postgres + $ createuser -P -s evergreen + Enter password for new role: mynewpassword + Enter it again: mynewpassword +
- If the output from the script does not help you find the problem, please do not make any further significant changes to your configuration. Follow the steps in the troubleshooting guide, "Troubleshooting" .
- If you have followed the entire set of installation steps listed here closely, you are probably extremely close to a working system. Gather your configuration files and log files and contact the [[ http://open-ils.org/listserv.php|Evergreen development mailing list ]] for assistance before making any drastic changes to your system configuration. +
+
+
+ Create Database Schema + As the root user, create the database schema and configure your system with the corresponding database authentication details for the database user 'evergreen' that you created in the previous step. + Enter the commands and replace [HOSTNAME], [PORT], [USER], [PASSWORD] and [DATABASENAME] with appropriate values. + On most systems [HOSTNAME] will be localhost, and [PORT] will be 5432. +
+ Commands to create Evergreen database schema + + $ su - root + $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 + $ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \ + --service all --create-schema --create-bootstrap --create-offline \ + --hostname [HOSTNAME] --port [PORT] \ + --user [USER] --password [PASSWORD] --database [DATABASENAME] + +
+ + + If you are entering the above command on a single line, do not include the \ (backslash) characters. If you are using the bash 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. + + +
+
+ Configure the Apache Server + As the root user, configure the Apache server and copy several new configuration files to the Apache server directories: +
+ Commands to configure the Apache server + + # configure the Apache server + $ su - root + $ a2enmod ssl # enable mod_ssl + $ a2enmod rewrite # enable mod_rewrite + $ a2enmod expires # enable mod_expires + $ cd /home/opensrf/Evergreen-ILS-1.6.0.7 + + # copy files + $ cp Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/ + $ cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/ + $ cp Open-ILS/examples/apache/startup.pl /etc/apache2/ + +
+
+
+ Create a Security Certificate (SSL Key) + Use the command openssl to create a new SSL key for your Apache server. For a public production server you should configure or purchase a signed SSL certificate, but for now you can just use a self-signed certificate and accept the warnings in the Staff Client and browser during testing and development: +
+ Commands to create an SSL key + + $ mkdir /etc/apache2/ssl + $ cd /etc/apache2/ssl + $ openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key + +
+ + + This is only a temporary measure to expedite testing. You must get a proper SSL certificate for a public production system. See this section for further comments on setting up a properly signed SSL certificate: + + + [[ ADD INFO ON HOW TO GET A SIGNED SSL CERTIFICATE ]] +
+
+ Modify the Apache Configuration File + As the root user, edit the Apache configuration file /etc/apache2/sites-available/eg.conf and make the following changes: + + + Comment out the line Allow from 10.0.0.0/8, then uncomment the line Allow from all. + + This change allows access to your configuration CGI scripts from any workstation on any network. This is only a temporary change to expedite testing and should be removed after you have finished and successfully tested the Evergreen installation. + + + + You must remove these changes after testing is completed. See the section "Post-Installation Chores" for further details on removing this change after the Evergreen installation is complete. + + + + + Comment out the line Listen 443 as it conflicts with the same declaration in the configuration file: /etc/apache2/ports.conf . Debian etch users should not do this. + [[ ADD INFO ON WHY DEBIAN ETCH USERS SHOULD NOT DO THIS ]] + + + The following updates are needed to allow the logs to function properly, but it may break other Apache applications on your server. We hope to make this unnecessary soon. + [[ ADD INFO ON WHETHER THIS IS STILL NECESSARY ]] + + + For the Linux distributions Ubuntu Hardy or Debian Etch, as the root user, edit the Apache configuration file /etc/apache2/apache2.conf and change the user: + www-data + to the user: + opensrf + + + For the Linux distributions Ubuntu Karmic or Ubuntu Lucid or Debian Lenny, as the root user, edit the Apache configuration file /etc/apache2/envvars and change the phrase: + export APACHE_RUN_USER=www-data + to the phrase: + export APACHE_RUN_USER=opensrf + + + + + As the root user, edit the Apache configuration file /etc/apache2/apache2.conf and add the line KeepAliveTimeout 1, or modify an existing line if it already exists. +
-
- Testing the Catalog - By default, the OPAC will live at the URL http://my.domain.com/opac/. - Navigate to this URL and the front page of the OPAC should load. There is a basic text entry field with some extra search options. If you have any problems loading this page, check the Apache error logs. If the page loads but does not function correctly, then check for possible javascript errors. We hightly reccommend testing with the Firefox browser because of the helpful javascript debugging tools. - Assuming that the OPAC is functioning and there is data in your database, you can now perform other simple functional tests (e.g., searching the catalog). - [[ ADD OTHER SIMPLE FUNCTIONAL TESTS ]] +
+ (OPTIONAL) Performance Modifications for Apache + Some further configuration changes to Apache may be necessary for busy systems. These changes increase the number of Apache server processes that can be started to support additional browser connections, and are made to the prefork configuration section of the Apache configuration file. + + As the root user, edit the Apache configuration file /etc/apache2/apache2.conf and add the line MaxKeepAliveRequests 100, or modify an existing line if it already exists. + + As the root user, edit the Apache configuration file /etc/apache2/apache2.conf, locate and modify the section related to prefork configuration to suit the load on your system. +
+ (OPTIONAL) Updates to Apache configuration + + <IfModule mpm_prefork_module> + StartServers 20 + MinSpareServers 5 + MaxSpareServers 15 + MaxClients 150 + MaxRequestsPerChild 10000 + </IfModule> + + MaxKeepAliveRequests 100 + +
+
+
-
- Other Tests with srfsh - There is also a srfsh command called math_bench that sends queries to the math servers. Note that opensrf.math and opensrf.dbmath must be running for this command to work: - - srfsh# math_bench 10 - |.........|.........|.........|.........|.........|.........|.........|.........|.........|......... - ++++++++++++++++++++++++++++++++++++++++ - Average round trip time: 0.033425 - srfsh# - - The first argument is how many sets of 4 queries (+ - * /) are sent to opensrf.math. When the response is successful, you will see the string of "+" symbols. If the system is not running correctly, you will either get an exception or no result at all. - For other srfsh commands, type 'help' in at the prompt. +
+ Enable the Evergreen Site + You must run additional Apache configuration commands to enable the Evergreen web site. As the root user, run these commands: +
+ Apache Commands to Enable the Evergreen Web Site + + $ su - root + + # disables the default site (i.e., the "It Works" page). + $ a2dissite default + + # enables the Evergreen web site + $ a2ensite eg.conf + +
-
-
- Post-Installation Chores - - - As the root user, edit the Apache configuration file /etc/apache2/sites-available/eg.conf again and make the following change: - Uncomment the line Allow from 10.0.0.0/8, then comment out the line Allow from all. You modified this file in an earlier step as a temporary measure to expedite testing (see the section "Modify the Apache Configuration File" for further information). Those changes must now be reversed in order to deny unwanted access to your CGI scripts from users on other public networks. You must secure this for a public production system. - - - - This is only a temporary measure to expedite testing. You must get a proper SSL certificate for a public production system. See this section for further comments on setting up a properly signed SSL certificate: "Getting a Signed SSL Security Certificate" . +
+ Modify the OpenSRF Configuration File + As the opensrf user, edit the OpenSRF configuration file /openils/conf/opensrf_core.xml to update various usernames and passwords, and to specify the domains from which we will accept and to which we will make connections. + If you are installing Evergreen on a single server and using the private.localhost / public.localhost domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values. + + + The following example uses common XPath syntax on the left-hand side to indicate the aproximage position needing changes within the XML file. + + + [[ ADD A BETTER DIAGRAM HERE ]] +
+ Updates needed to the file "/openils/conf/opensrf_core.xml" + + /config/opensrf/username = opensrf + + /config/opensrf/passwd = password for "private.localhost" opensrf user + + /config/gateway/username = opensrf + + /config/gateway/passwd = password for "public.localhost" opensrf user + + # first entry, where "transport/server" == "public.localhost" : + /config/routers/router/transport + username = router + password = password for "public.localhost" router user - Getting a Signed SSL Security Certificate - - - + # second entry, where "transport/server" == "private.localhost" : + /config/routers/router/transport + username = router + password = password for "private.localhost" router user + +
+
+
+ Create Configuration Files for Users Needing srfsh + The software installation will automatically create a utility named srfsh (surf shell). This is a command line diagnostic tool for testing and interacting with the OpenSRF network software. It will be used in a future step to complete and test the Evergreen installation. See the section "Testing the Installation" for further information. + In this step you will set up a special configuration file for each user who will need to run the utility. Copy the short sample configuration file /openils/conf/srfsh.xml.example to the file .srfsh.xml (note the leading dot!) in the home directory of each user who will use srfsh. Finally, edit each file .srfsh.xml and make the following changes: + + Modify domain to be the router hostname (following our domain examples, private.localhost will give srfsh access to all OpenSRF services, while public.localhost will only allow access to those OpenSRF services that are publicly exposed). + Modify username and password to match the opensrf Jabber user for the chosen domain + Modify logfile to be the full path for a log file to which the user has write access + Modify loglevel as needed for testing + +
+ Sample of configuration file /openils/conf/srfsh.xml.example + + <?xml version="1.0"?> + <!-- This file follows the standard bootstrap config file layout --> + <!-- found in opensrf_core.xml --> + <srfsh> + <router_name>router</router_name> + <domain>private.localhost</domain> + <username>opensrf</username> + <passwd>evergreen</passwd> + <port>5222</port> + <logfile>/tmp/srfsh.log</logfile> + <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) --> + <loglevel>4</loglevel> + </srfsh> + +
+
+
+ Modify the OpenSRF Environment + As the opensrf user, change the file permissions of the directory /openils/var/cgi-bin to executable, then modify the shell configuration file ~/.bashrc of that user by adding a Perl environmental variable. Finally, execute the shell configuration file to load the new variables into your current environment. + + + In a multi-server environment, you must add any modifications to ~/.bashrc to the top of the file before the line [ -z "$PS1" ] && return. This will allow headless (scripted) logins to load the correct environment. + + +
+ Modify the OpenSRF environment + + # change permissions + $ su - opensrf + $ chmod 755 /openils/var/cgi-bin/*.cgi + + # add environmental variable + $ echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc + + # inherit the new environment + $ . ~/.bashrc + +
+
+
+ (OPTIONAL) Configuration for Other Languages + This section describes how translations such as Armenian (hy-AM), Canadian French (fr-CA) and others are loaded into the database to complete the translations (default English) available in the OPAC and Staff Client. + [[ ADD SECTION ON LANGUAGE LOCALIZATION ]] +
-
- Running the Staff Client on Linux - Run the Evergreen Staff Client on a Linux system by using the application XULRunner (installed automatically and by default with Firefox version 3.0 and later on Ubuntu and Debian distributions). - For example, if the source files for the Evergreen installation are in the directory /home/opensrf/Evergreen-ILS-1.6.0.7/, start the Staff Client as shown in the following command example: +
+
+ Testing the Installation + This section describes several simple tests you can perform to verify that the Evergreen server-side software has been installed and configured properly and is running as expected. +
+ Testing Connections to Evergreen + Once you have installed and started Evergreen, test your connection to Evergreen. As the opensrf user start the utility srfsh and try logging onto the Evergreen server using the default administrator username and password. Following is sample output generated by executing that script after a successful Evergreen installation:
- Running the Linux Staff Client + Running the srfsh utility $ su - opensrf - $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini + $ /openils/bin/srfsh + srfsh% login admin open-ils + Received Data: "250bf1518c7527a03249858687714376" + ------------------------------------ + Request Completed Successfully + Request Time in seconds: 0.045286 + ------------------------------------ + Received Data: { + "ilsevent":0, + "textcode":"SUCCESS", + "desc":" ", + "pid":21616, + "stacktrace":"oils_auth.c:304", + "payload":{ + "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a", + "authtime":420 + } + } + ------------------------------------ + Request Completed Successfully + Request Time in seconds: 1.336568 + ------------------------------------
+ If this does not work, try other simple troubleshooting steps: + + + As the opensrf user, run the script settings-tester.pl to see if it finds any system configuration problems. Following is sample output generated by executing that script after a successful Evergreen installation: + [[ MAY NEED TO REWORK THIS DIAGRAM TO USE SAME IMAGE STANDARDS AS OTHER CHAPTERS ]] +
+ Executing the script <emphasis> settings-test.pl</emphasis> + + + + + + + + + + +
+ If the output from the script does not help you find the problem, please do not make any further significant changes to your configuration. Follow the steps in the troubleshooting guide, "Troubleshooting" . +
+ If you have followed the entire set of installation steps listed here closely, you are probably extremely close to a working system. Gather your configuration files and log files and contact the [[ http://open-ils.org/listserv.php|Evergreen development mailing list ]] for assistance before making any drastic changes to your system configuration. +
+
+
+ Testing the Catalog + By default, the OPAC will live at the URL http://my.domain.com/opac/. + Navigate to this URL and the front page of the OPAC should load. There is a basic text entry field with some extra search options. If you have any problems loading this page, check the Apache error logs. If the page loads but does not function correctly, then check for possible javascript errors. We hightly reccommend testing with the Firefox browser because of the helpful javascript debugging tools. + Assuming that the OPAC is functioning and there is data in your database, you can now perform other simple functional tests (e.g., searching the catalog). + [[ ADD OTHER SIMPLE FUNCTIONAL TESTS ]] +
+
+ Other Tests with srfsh + There is also a srfsh command called math_bench that sends queries to the math servers. Note that opensrf.math and opensrf.dbmath must be running for this command to work: + + srfsh# math_bench 10 + |.........|.........|.........|.........|.........|.........|.........|.........|.........|......... + ++++++++++++++++++++++++++++++++++++++++ + Average round trip time: 0.033425 + srfsh# + + The first argument is how many sets of 4 queries (+ - * /) are sent to opensrf.math. When the response is successful, you will see the string of "+" symbols. If the system is not running correctly, you will either get an exception or no result at all. + For other srfsh commands, type 'help' in at the prompt.
- Starting the Apache Web Server + Testing the Apache Web Server Once you have started Evergreen and confirmed that a basic login attempt works, you can test and start the Apache web server. As the root user, execute the following commands. Note the use of restart to force the new Evergreen modules to be reloaded even if the Apache server is already running. Any problems found with your configuration files should be displayed:
- Start the Apache Web Server + Test the Apache Web Server $ su - root $ apache2ctl configtest && /etc/init.d/apache2 restart
-
- Stopping the Evergreen Services - As the opensrf user, stop all Evergreen services by using the following command: -
- Stop all Evergreen services - - $ su - opensrf +
+
+ Starting Evergreen + + + As the root user, start the "ejabberd" and "memcached" services (if they aren't already running): +
+ Start some services + + $ su - root + $ /etc/init.d/ejabberd start + $ /etc/init.d/memcached start + +
+
+ + As the opensrf user, start Evergreen. + Use the flag -l to force Evergreen to use localhost (your current system) as the hostname. Using the start_all option will start the OpenSRF router, Perl services, and C services: +
+ Start Evergreen + + $ su - opensrf - # stop the server: - # use "-l" to force hostname to be "localhost" - $ osrf_ctl.sh -l -a stop_all - -
- - - You can also stop Evergreen services without the -l flag, but the utility osrf_ctl.sh must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file opensrf.xml, which you configured in a previous step. - - - [[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]] -
-
- Setting Up Support For Reports - Evergreen reports are extremely powerful, but some configuration is required. See the section "Reports" for details. -
-
+ # ensure you have the needed path + $ export PATH=$PATH:/openils/bin + + # start the OpenSRF service: + # use "-l" to force hostname to be "localhost" + $ osrf_ctl.sh -l -a start_all + + + + + You can also start Evergreen without the -l flag, but the utility osrf_ctl.sh must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file opensrf.xml, which you configured in a previous step. + + + [[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]] + Execute the following command to determine the fully qualified domain name of your system: +
+ (OPTIONAL) Determine the fully qualified domain name + + $ perl -e 'use Net::Domain qw(hostfqdn); print hostfqdn()."\n"' + +
+ + When you attempt to start Evergreen, if you receive an error message similar to osrf_ctl.sh: command not found, then your environment variable PATH does not include the directory /openils/bin. As the opensrf user, edit the configuration file /home/opensrf/.bashrc and add the following line: export PATH=$PATH:/openils/bin + When you attempt to start Evergreen, if you receive an error message similar to Can't locate OpenSRF/System.pm in @INC ... BEGIN failed--compilation aborted, then your environment variable PERL5LIB does not include the directory /openils/lib/perl5. As the opensrf user, edit the configuration file /home/opensrf/.bashrc and add the following line: export PERL5LIB=$PERL5LIB:/openils/lib/perl5 + + + + As the opensrf user, generate the Web files needed by the Staff Client and catalogue, and calculate the proximity of locations in the Organizational Unit tree (which allows Holds to work properly). + You must do this the first time you start Evergreen, and after any time you change the library hierarchy in the configuration file config.cgi. +
+ Generate web files + + $ su - opensrf + $ cd /openils/bin + $ ./autogen.sh -c /openils/conf/opensrf_core.xml -u + Updating Evergreen organization tree and IDL \ + using '/openils/conf/opensrf_core.xml' + + Updating fieldmapper + Exception: OpenSRF::EX::Session 2010-04-16T06:31:38 \ + OpenSRF::Utils::SettingsClient \ + /usr/local/share/perl/5.10.0/OpenSRF/Utils/SettingsClient.pm:103 \ + Session Error: router@private.localhost/opensrf.settings \ + IS NOT CONNECTED TO THE NETWORK!!! + + [[ ADD RESULTS OF TESTS FROM "autogen.sh" ]] +
+
+ + As the root user, restart the Apache Web server: +
+ Restart the Apache web server + + $ su - root + $ /etc/init.d/apache2 restart + +
+ If the Apache Web server was running when you started the OpenSRF services, you might not be able to successfully log in to the OPAC or Staff Client until the Apache Web server is restarted. +
+ +
+
+ Stopping Evergreen + As the opensrf user, stop all Evergreen services by using the following command: +
+ Stop all Evergreen services + + $ su - opensrf + + # stop the server: + # use "-l" to force hostname to be "localhost" + $ osrf_ctl.sh -l -a stop_all + +
+ + + You can also stop Evergreen services without the -l flag, but the utility osrf_ctl.sh must know the fully qualified domain name for the system on which it will execute. That hostname may have been specified in the configuration file opensrf.xml, which you configured in a previous step. + + + [[ ADD EXPLANATION FOR CONFIGURING "opensrf.xml" ]] +
+
+ Post-Installation Chores + + + As the root user, edit the Apache configuration file /etc/apache2/sites-available/eg.conf again and make the following change: + Uncomment the line Allow from 10.0.0.0/8, then comment out the line Allow from all. You modified this file in an earlier step as a temporary measure to expedite testing (see the section "Modify the Apache Configuration File" for further information). Those changes must now be reversed in order to deny unwanted access to your CGI scripts from users on other public networks. You must secure this for a public production system. + + + + This is only a temporary measure to expedite testing. You must get a proper SSL certificate for a public production system. See this section for further comments on setting up a properly signed SSL certificate: "Getting a Signed SSL Security Certificate" . + + + +
+
+ Running the Staff Client on Linux + Run the Evergreen Staff Client on a Linux system by using the application XULRunner (installed automatically and by default with Firefox version 3.0 and later on Ubuntu and Debian distributions). + For example, if the source files for the Evergreen installation are in the directory /home/opensrf/Evergreen-ILS-1.6.0.7/, start the Staff Client as shown in the following command example: +
+ Running the Linux Staff Client + + $ su - opensrf + $ xulrunner /home/opensrf/Evergreen-ILS-1.6.0.7/Open-ILS/xul/staff_client/build/application.ini + +
+
+
+ Setting Up Support For Reports + Evergreen reports are extremely powerful, but some configuration is required. See the section "Reports" for details. +
Starting the Reporter Daemon Once the open-ils.reporter process is running and enabled on the gateway, you can start the reporter daemon. That process periodically checks for requests for new reports or scheduled reports and gets them running. As the opensrf user, start the reporter daemon using the following command: @@ -804,7 +1296,7 @@ --boostrap=filename : OpenSRF bootstrap configuration file; defaults to /openils/conf/opensrf_core.xml
-
+
Stopping the Reporter Daemon To stop the Reporter daemon, you must kill the process and remove the lockfile. The daemon may have just a single associated process, with a lockfile in the default location. @@ -855,13 +1347,9 @@
Installing OpenSRF 1.0.x - [[ ADD CONTECNT FOR INSTALLING OPENSRF 1.0.x ]] + [[ ADD CONTENT FOR INSTALLING OPENSRF 1.0.x ]]
-
- OpenSRF - [[ ADD CONTENT FOR OPENSRF ]] -
Installing the Evergreen Staff Client [[ ADD CONTENT FOR INSTALLING THE EVERGREEN STAFF CLIENT ]] @@ -872,7 +1360,13 @@
Apache - [[ ADD CONTENT FOR APACHE ]] +
+ Securing Apache (httpd) + The main consideration is to secure the directory cgi-bin . 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. + [[ ADD CONTENT ON HOW TO RESTRICT APACHE BY IP AND USERNAME/PASSWORD ]] + 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. +
+ [[ ADD MORE CONTENT FOR APACHE ]]
memcached Servers @@ -880,6 +1374,12 @@
Organization and Policy Editing + After installing Evergreen, you will want to make configuration changes to reflect the organizational hierarchy and the policies of your library or libraries. See the section "Organizational Unit Types and Organizational Units" for further information. Examples of what can be configured include: + + Adding a branch library + Changing circulation rules for an existing library + Adding a new staff position or user group + [[ ADD CONTENT FOR ORGANIZATION AND POLICY EDITING ]]
-- 2.11.0