[OPEN-ILS-GENERAL] updated install scripts

John Schmidt jas at xmission.com
Thu Feb 21 11:33:17 EST 2008


Hi,

After much delay, I finally updated my install scripts to use the latest 
version of Evergreen 1.2.1.3 that should work on Debian Etch or Lenny.  For 
those that are unaware of what they are.  It is just one big shell script 
which automates the wiki instructions that Dan and others have assembled.  
Even if you just use the wiki to install Evergreen, you can look at the 
beginning of the evergreen.sh and get a little feel for what accounts are set 
up and why.  

There are many dependencies required to get Evergreen up and running.  One 
miscue in one place has ramifications in non-obvious places.  In my opinion, 
installing the software is not hard, it is configuring the various config 
files that are apt to trip up the person installing Evergreen for the first 
time.  My script automates the config file generation.  I have chosen default 
account names and passwords that are quite similar to what the wiki uses.

The purpose for writing these scripts was I thought I would probably be 
installing Evergreen on multiple machines in time, and wanted an automatic 
way of doing it.  In addition, I want Evergreen to be adopted and the first 
step is to make it easy to set up.  And this is my attempt.  I welcome any 
and all feedback.

I am attaching 3 files, Readme.txt, evergreen.sh, and evergreen_chroot.sh.  If 
you have any questions please don't hesitate to email me.  I will be happy to 
call you and walk through the installation if you would like.  

Thanks,

John Schmidt
jas at xmission.com



-------------- next part --------------
A non-text attachment was scrubbed...
Name: evergreen_chroot.sh
Type: application/x-shellscript
Size: 4629 bytes
Desc: not available
Url : http://list.georgialibraries.org/pipermail/open-ils-general/attachments/20080221/b9593ae7/evergreen_chroot-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: evergreen.sh
Type: application/x-shellscript
Size: 25858 bytes
Desc: not available
Url : http://list.georgialibraries.org/pipermail/open-ils-general/attachments/20080221/b9593ae7/evergreen-0001.bin
-------------- next part --------------
Installing Evergreen using the 'evergreen.sh' script.

This script was developed for computers that use the Debian
distribution of Linux.  It was designed to accomodate both the stable
(Etch) and testing (Lenny) versions of Debian.


NOTE: I use the notation of indented parenthesis ( ) to designate a
reponse you need to type, i.e.

     ( Type your reponse, or enter the following command )

Do NOT type the parenthesis in your responses.


RECOMMENDATION:

I recommend testing out the installer script in a chroot environment
to acquaint yourself with the installation procedure.  To help with
this procedure, I developed another script, 'evergreen_chroot.sh'
which sets up a chroot environment

Install the schroot package in your regular environment and edit the file,
/etc/schroot/schroot.conf so it has a section that looks like the following:

[evergreen]
description=Debian lenny(testing)
location=/evergreen
priority=3
users=jas
#groups=sbuild
#root-groups=root
aliases=testing,default


SET PATH FOR THE EVERGREEN.SH:

Edit the evergreen_chroot.sh script and set the variable:

     EVERGREEN_INSTALL_SRC= 

to the location of the evergreen.sh.  The evergreen_chroot.sh will copy the evergreen.sh script to the chroot environment.


SETTING UP A CHROOT:

Then type the following at your command line prompt:

     ( sudo ./evergreen_chroot.sh -c evergreen -v etch -i )

A chroot environment will be set up in the directory /evergreen for
the Debian distribution, Etch.



LOGIN TO CHROOT:

Login to the 'evergreen chroot':


      ( schroot -c  evergreen )



CHECK CONSISTENCY OF HOSTNAMES AND ACCOUNTS:

Check the /etc/hosts file and edit as required to ensure that your hosts 
information is set up correctly.  For example, my hosts file looks like this:


(evergreen)jas at puppy:~$ more /etc/hosts
127.0.0.1       localhost
127.0.1.1       puppy


# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


Look at lines 61-66 of evergreen.sh and change any of the account
names/password combinations shown below.  For the initial install and
testing in a chroot, I recommend just keeping the default values
during your initial tests of the installer.

OPENSRF_USER_PW="opensrf"
OPENSRF_JAB_PW="everPass"
ROUTER_JAB_PW="everPass"
PG_DB_NAME="evergreen"
PG_DB_USER="evergreen"
PG_DB_USER_PW="everPass"



Once you are satisfied with the settings in your /etc/hosts file and
the password/account names in 'evergreen.sh', then type the following:

    ( sudo ./evergreen.sh -v etch -i )


The install process will begin and I will outline the steps and the
answers you need to give at the various prompts.


SET THE HOSTNAME: 

Enter your hostname (fully qualified name) at the prompt

Enter hostname = 

      ( Type your fully qualified, in my case, I typed: puppy )



PERL MODULE INSTALL:

After downloading and installing a number of packages, you will be
prompted during the perl modules install phase.  A snippet of the text
is shown below:


cat: /etc/mailname: No such file or directory

/etc/perl/CPAN/Config.pm initialized.


CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.

If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)

Are you ready for manual configuration? [yes]   

    ( no )

Downloading and installing of perl modules and libdbi and libdbd-pgsql packages.


POSTGRESQL SETUP:

You will be prompted for a password for the database user password.
This is the same value that is stored in the variable 'PG_DB_USER_PW' on
line 66 of the evergreen.sh script.

CREATE FUNCTION
CREATE DATABASE
Enter password for new role:

      ( everPass )

Enter it again:

      ( everPass )

Enter the password twice, using the default values of 'everPass' or
whatever the value is in 'PG_DB_USER_PW'.  They must be the same.



INSTALLING OPENSRF:

Default values are set up based on the values entered for account
names and passwords defined in lines 61-66 of evergreen.sh for the
installation of the opensrf and evegreen software.  It should be
sufficient to just type Enter at each prompt.  However, do ensure that
the values that are displayed make sense.

-----------------------------------------------------------------------
Type Enter to select the default
-----------------------------------------------------------------------

Install prefix [/openils/] 

Apache2 apxs binary [/usr/bin/apxs2]

Apache2 headers directory [/usr/include/apache2]

Apache2 APR headers directory [/usr/include/apr-1.0/]

Libdbi libraries directory [/usr/lib/dbd]

Libxml2 headers directory [/usr/include/libxml2/]

OpenSRF headers directory [/openils/include/]

OpenSRF libraries directory [/openils/lib/]

Build targets [openils_all evergreen_core]

Database Driver [Pg]

Bootstrapping Database Version (80 for 8.0.x, 81 for 8.1.x, 82 for 8.2.x) [81]

Database Host [puppy]

Database Port [5432]

Database Name [evergreen]

Database User [evergreen]

Database Password [everPass]

Reporter Template Directory [/openils//var/reporter] 


         ( hit the enter key after each prompt )


WARNING!

storage-bootstrap will DESTROY all data within all of the ILS tables in your database.


The database this script will touch has a DBI DSN of
    dbi:Pg:host=puppy;dbname=evergreen;port=5432
Type control-c to avoid destroying all of the data.  Type enter to continue...

     ( Hit the enter key )

The database is set up during this process.


SETUP AN APACHE CERTIFICATE:

For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:  
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:

      ( At each prompt fill in the appropriate information )

At the end of the installation, Evergreen will be started and you will
see the following:

Configuring Evergreen . . .
Finalizing opensrf . . .
Starting OpenSRF Router
Starting OpenSRF Perl
Starting OpenSRF C (host=puppy)
Updating fieldmapper
Updating web_fieldmapper
Updating OrgTree
removing OrgTree from the cache...
Updating OrgTree HTML
Done

At the very end, you will see some instructions for testing the install:

Please execute the following: '/openils/bin/srfsh'
At the 'srfsh#' type the following: login admin open-ils
You should see a successful login.
Type 'exit' when you are done.


TESTING THE EVERGREEN INSTALL: 

At the command line, type:

   ( /openils/bin/srfsh )

You will see the 'srfsh#' returned.

   ( srfsh# login admin open-ils )

You should see something like the following:


Received Data: "5a043bb6ebc8d1a044e1323cb710ac10"

------------------------------------
Request Completed Successfully
Request Time in seconds: 0.008793
------------------------------------

Received Data: {
   "ilsevent":0,
   "textcode":"SUCCESS",
   "desc":" ",
   "pid":28385,
   "stacktrace":"oils_auth.c:305",
   "payload":{
      "authtoken":"be9fb8b2286359f13da0b5395c301578",
      "authtime":420
   }

}


------------------------------------
Request Completed Successfully
Request Time in seconds: 0.170924
------------------------------------
Login Session: be9fb8b2286359f13da0b5395c301578.  Session timeout: 420.000000

If you receive the following, then the essential elements of the
Evergreen system were installed correctly.


CLEAN-UP/REMOVAL OF THE CHROOT EVERGREEN INSTALL:

You must remove remove your chroot environment which will clean-up and
remove the various software pieces, i.e. postgres, apache, ejabber,
etc.  If you try and install Evergreen multiple times without cleaning
up, you will have problems, since the daemons will be started on
different port numbers which will confuse the installation procedure.

At the command line type the following:


   ( sudo ./evergreen.sh -v etch -u )


You will see the following:


Removing the test subset of packages . . .
Stopping OpenSRF C : 17429 17432
Stopping OpenSRF Perl : 17386 17417
Stopping OpenSRF Router : 17374
DROP DATABASE           
. . . 

Setting up sudo (1.6.8p12-4) ...
No /etc/sudoers found... creating one for you.


Exit from the chroot and then type the following:

     ( sudo ./evergreen_chroot.sh -c evergreen -v etch -r )


You can then go through the installation procedure again by setting up
the chroot and executing the evergreen.sh script.  I recommend doing
the install several times in the chroot before installing evergreen in
your regular environment.


If you have problems/suggestions/corrections to the above information,
please contact me at:

John Schmidt
jas at xmission.com





More information about the Open-ils-general mailing list