[open-ils-commits] r967 - in ESI-Examples/trunk/tools: . eg_dev_squeeze_installer (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Aug 17 17:15:57 EDT 2010


Author: erickson
Date: 2010-08-17 17:15:51 -0400 (Tue, 17 Aug 2010)
New Revision: 967

Added:
   ESI-Examples/trunk/tools/eg_dev_squeeze_installer/
   ESI-Examples/trunk/tools/eg_dev_squeeze_installer/CPAN_Config.pm.EG.patch
   ESI-Examples/trunk/tools/eg_dev_squeeze_installer/README
   ESI-Examples/trunk/tools/eg_dev_squeeze_installer/eg_dev_squeeze_installer.sh
   ESI-Examples/trunk/tools/eg_dev_squeeze_installer/ejabberd.squeeze.EG.patch
   ESI-Examples/trunk/tools/eg_dev_squeeze_installer/evergreen.ld.conf
Log:
Debian Squeeze trunk installer

Changes worth noting:

* Udpated ejabberd config patch
* No longer installing syslog-ng due to conflicts with libdbi0
* No longer hard-coding datapipe as the CPAN mirror, let the OS decide
* PG install happens at top of script to avoid an unresolved template locale issue

Added: ESI-Examples/trunk/tools/eg_dev_squeeze_installer/CPAN_Config.pm.EG.patch
===================================================================
--- ESI-Examples/trunk/tools/eg_dev_squeeze_installer/CPAN_Config.pm.EG.patch	                        (rev 0)
+++ ESI-Examples/trunk/tools/eg_dev_squeeze_installer/CPAN_Config.pm.EG.patch	2010-08-17 21:15:51 UTC (rev 967)
@@ -0,0 +1,11 @@
+--- Config.pm.orig	2010-08-17 15:40:10.000000000 -0400
++++ Config.pm	2010-08-17 16:25:16.000000000 -0400
+@@ -51,7 +51,7 @@
+   'perl5lib_verbosity' => q[v],
+   'prefer_installer' => q[MB],
+   'prefs_dir' => q[/root/.cpan/prefs],
+-  'prerequisites_policy' => q[ask],
++  'prerequisites_policy' => q[follow],
+   'scan_cache' => q[atstart],
+   'shell' => q[/bin/bash],
+   'show_unparsable_versions' => q[0],

Added: ESI-Examples/trunk/tools/eg_dev_squeeze_installer/README
===================================================================
--- ESI-Examples/trunk/tools/eg_dev_squeeze_installer/README	                        (rev 0)
+++ ESI-Examples/trunk/tools/eg_dev_squeeze_installer/README	2010-08-17 21:15:51 UTC (rev 967)
@@ -0,0 +1,29 @@
+
+Mostly automated "trunk" install of OpenSRF and Evergreen on Debian Squeeze.
+
+WARNING: This is for development and evaluation purposes only.  This 
+script makes a lot of assumptions and does stuff you won't like.  
+Use at own risk.
+
+Steps:
+1. Install Debian Squeeze
+2. Put these files on the server
+3. Run this script as root and do what it says
+
+----------------------------------------------------------
+
+Author: Bill Erickson (erickson at esilibrary.com)
+Copyright: (C) 2009, 2010  Equinox Software Inc.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+ 
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+
+

Added: ESI-Examples/trunk/tools/eg_dev_squeeze_installer/eg_dev_squeeze_installer.sh
===================================================================
--- ESI-Examples/trunk/tools/eg_dev_squeeze_installer/eg_dev_squeeze_installer.sh	                        (rev 0)
+++ ESI-Examples/trunk/tools/eg_dev_squeeze_installer/eg_dev_squeeze_installer.sh	2010-08-17 21:15:51 UTC (rev 967)
@@ -0,0 +1,236 @@
+#!/bin/bash
+# -----------------------------------------------------------------------
+# Copyright (C) 2009  Equinox Software Inc.
+# Bill Erickson <erickson at esilibrary.com>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# -----------------------------------------------------------------------
+
+DOJO_VERSION='1.3.3';
+PG_VERSION='8.4';
+
+# If you change the jabber password, you will need to 
+# edit opensrf_core.xml and srfsh.xml accordingly
+JABBER_PASSWORD='password'
+
+BASE_DIR=$PWD
+
+# And they're off...
+
+
+# Make sure the system is configured to use UTF-8.  Otherwise, Postges setup will fail
+if [[ ! $LANG =~ "UTF-8" ]]; then
+    cat <<EOF
+    Your system locale is not configured to use UTF-8.  This will cause problems with the PostgreSQL installation.  
+    
+    Do these steps (replace en_US with your locale):
+
+    1. edit /etc/locale-gen and uncomment this line:
+    en_US.UTF-8 UTF-8
+
+    2. edit /etc/default/locale and set the follow variable:
+    LANG=en_US.UTF-8
+
+    3. run locale-gen
+    4. log out
+    5. log in
+    6. Re-run this script
+EOF
+    exit;
+fi;
+
+
+# Install some essential tools
+apt-get update; 
+apt-get -yq dist-upgrade;
+apt-get -yq install vim build-essential psmisc automake ntpdate subversion; 
+
+# XXX: Note syslog-ng was removed since it now requires libdbi (squeeze=0.8.2), but if this version of 
+# libdbi is installed, the later version installed for Evergreen (0.8.3) will not work.  
+# You can hack in syslog-ng with something like this, but it will not survive package updates:
+# $ apt-get install syslog-ng;
+# $ apt-get remove libdbi0; # removes both, but leave them in the cache
+# $ dpkg -i --ignore-depends=libdbi0  /var/cache/apt/archives/syslog-ng_3.1.1*.deb
+
+# XXX: For some reason, when PG is installed with Makefile.install, the initial DB cluster templates 
+# are created with Encoding SQL_ASCII, even though all locale settings (locale, $LANG, etc.) indicate UTF-8.
+# This could be a Squeeze oddity or something going on in this script.
+# Forcing the PG install manually up front avoids the problem.  Go figure.
+apt-get -yq install "postgresql-$PG_VERSION"
+echo "Created PG cluster with databases:"
+su - postgres sh -c "psql -l"
+
+ntpdate pool.ntp.org 
+cp $BASE_DIR/evergreen.ld.conf /etc/ld.so.conf.d/
+ldconfig;
+
+# Create opensrf user and set up environment
+if [ ! "$(grep ^opensrf: /etc/passwd)" ]; then
+    useradd -m -s /bin/bash opensrf
+    echo '
+    export PERL5LIB=/openils/lib/perl5:$PERL5LIB
+    export PATH=/openils/bin:$PATH
+    export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH
+    export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\]% \[\033[00m\]";
+    export EDITOR="vim";
+    alias ls="ls --color=auto"
+    ' >> /home/opensrf/.bashrc
+fi;
+
+
+# Force cpan config 
+if [ ! "$(grep datapipe /etc/perl/CPAN/Config.pm)" ]; then
+    cpan foo
+    cd /etc/perl/CPAN/;
+    patch -p0 < $BASE_DIR/CPAN_Config.pm.EG.patch
+fi;
+
+# Install pre-reqs
+mkdir -p /usr/src/evergreen; 
+cd /usr/src/evergreen;
+wget 'http://svn.open-ils.org/trac/OpenSRF/export/HEAD/trunk/src/extras/Makefile.install'      -O Makefile.install.osrf
+wget 'http://svn.open-ils.org/trac/ILS/export/HEAD/trunk/Open-ILS/src/extras/Makefile.install' -O Makefile.install.ils
+make -f Makefile.install.osrf debian-squeeze
+make -f Makefile.install.ils  debian-squeeze
+make -f Makefile.install.ils  install_pgsql_server_debs_84
+
+
+# Patch Ejabberd and register users
+if [ ! "$(grep 'public.localhost' /etc/ejabberd/ejabberd.cfg)" ]; then
+    cd /etc/ejabberd/
+    /etc/init.d/ejabberd stop;
+    killall beam epmd; # just in case
+    cp ejabberd.cfg /root/ejabberd.cfg.orig
+    patch -p0 < $BASE_DIR/ejabberd.squeeze.EG.patch
+    chown ejabberd:ejabberd ejabberd.cfg
+    /etc/init.d/ejabberd start
+    sleep 2;
+    ejabberdctl register router  private.localhost $JABBER_PASSWORD
+    ejabberdctl register opensrf private.localhost $JABBER_PASSWORD
+    ejabberdctl register router  public.localhost  $JABBER_PASSWORD
+    ejabberdctl register opensrf public.localhost  $JABBER_PASSWORD
+fi;
+
+
+
+
+# Build and install OpenSRF
+OSRF_COMMAND='
+mkdir /home/opensrf/OpenSRF;
+mkdir /home/opensrf/ILS;
+svn co svn://svn.open-ils.org/OpenSRF/trunk /home/opensrf/OpenSRF/trunk;
+svn co svn://svn.open-ils.org/ILS/trunk     /home/opensrf/ILS/trunk;
+cd /home/opensrf/OpenSRF/trunk;
+./autogen.sh;
+./configure --prefix=/openils --sysconfdir=/openils/conf;
+make;'
+
+su - opensrf sh -c "$OSRF_COMMAND"
+cd /home/opensrf/OpenSRF/trunk
+make install
+
+# Build and install the ILS
+OSRF_COMMAND='
+cd /home/opensrf/ILS/trunk;
+./autogen.sh;
+./configure --prefix=/openils --sysconfdir=/openils/conf;
+make;'
+
+su - opensrf sh -c "$OSRF_COMMAND"
+cd /home/opensrf/ILS/trunk;
+make install
+cp /openils/conf/oils_web.xml.example     /openils/conf/oils_web.xml
+cp /openils/conf/opensrf.xml.example      /openils/conf/opensrf.xml
+cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
+
+# fetch and install Dojo
+cd /tmp;
+wget "http://download.dojotoolkit.org/release-$DOJO_VERSION/dojo-release-$DOJO_VERSION.tar.gz";
+tar -zxf dojo-release-$DOJO_VERSION.tar.gz;
+cp -r dojo-release-$DOJO_VERSION/* /openils/var/web/js/dojo/;
+
+# give it all to opensrf
+chown -R opensrf:opensrf /openils
+
+# copy srfsh config into place
+cp /openils/conf/srfsh.xml.example /home/opensrf/.srfsh.xml;
+chown opensrf:opensrf /home/opensrf/.srfsh.xml;
+
+# Create the DB
+PG_COMMAND="
+createdb -E UNICODE evergreen;
+createlang plperl   evergreen;
+createlang plperlu  evergreen;
+createlang plpgsql  evergreen;
+psql -f /usr/share/postgresql/$PG_VERSION/contrib/tablefunc.sql evergreen;
+psql -f /usr/share/postgresql/$PG_VERSION/contrib/tsearch2.sql  evergreen;
+psql -f /usr/share/postgresql/$PG_VERSION/contrib/pgxml.sql     evergreen;"
+su - postgres sh -c "$PG_COMMAND"
+echo -e "\n\nPlease enter a password for the evergreen database user.  If you do not want to edit configs, use \"evergreen\"\n"
+su - postgres sh -c 'createuser -P -s evergreen;'
+
+# Apply the DB schema
+cd /home/opensrf/ILS/trunk;
+perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
+    --service all --create-schema --create-bootstrap --create-offline \
+    --user evergreen --password evergreen --hostname localhost --database evergreen
+
+# Copy apache configs into place and create SSL cert
+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/
+if [ ! -d /etc/apache2/ssl ] ; then
+    mkdir /etc/apache2/ssl
+fi
+if [ ! -f /etc/apache2/ssl/server.key ] ; then
+    echo -e "\n\nConfiguring a new temporary SSL certificate....\n";
+    openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
+else
+    echo -e "\nkeeping existing ssl/server.key file\n";
+fi
+a2enmod ssl  
+a2enmod rewrite
+a2enmod expires 
+
+
+if [ ! "$(grep 'public.localhost' /etc/hosts)" ]; then
+    cat <<EOF
+
+* Add these lines to /etc/hosts.
+
+127.0.1.2   public.localhost    public
+127.0.1.3   private.localhost   private
+
+EOF
+
+else
+    echo "INFO: /etc/hosts already has public.localhost line";
+fi
+
+cat <<EOF
+* Start services
+
+su - opensrf
+osrf_ctl.sh -l -a start_router;
+osrf_ctl.sh -l -a start_perl   && sleep 10;
+osrf_ctl.sh -l -a start_c      && sleep  3;
+/openils/bin/autogen.sh /openils/conf/opensrf_core.xml;
+
+* Test the system
+
+# as opensrf user
+echo "request open-ils.cstore open-ils.cstore.direct.actor.user.retrieve 1" | srfsh
+
+* Now finish configuring Apache
+
+EOF
+
+


Property changes on: ESI-Examples/trunk/tools/eg_dev_squeeze_installer/eg_dev_squeeze_installer.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: ESI-Examples/trunk/tools/eg_dev_squeeze_installer/ejabberd.squeeze.EG.patch
===================================================================
--- ESI-Examples/trunk/tools/eg_dev_squeeze_installer/ejabberd.squeeze.EG.patch	                        (rev 0)
+++ ESI-Examples/trunk/tools/eg_dev_squeeze_installer/ejabberd.squeeze.EG.patch	2010-08-17 21:15:51 UTC (rev 967)
@@ -0,0 +1,62 @@
+--- ejabberd.cfg	2010-08-13 16:03:40.000000000 -0400
++++ /tmp/ejabberd.cfg.orig	2010-08-13 16:07:13.000000000 -0400
+@@ -58,7 +58,7 @@
+ {acl, admin, {user, "", "localhost"}}.
+ 
+ %% Hostname
+-{hosts, ["localhost"]}.
++{hosts, ["public.localhost", "private.localhost"]}.
+ 
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ 
+@@ -115,7 +115,7 @@
+   {5222, ejabberd_c2s, [
+ 			{access, c2s},
+ 			{shaper, c2s_shaper},
+-			{max_stanza_size, 65536},
++			{max_stanza_size, 200000},
+                         %%zlib,
+ 			starttls, {certfile, "/etc/ejabberd/ejabberd.pem"}
+ 		       ]},
+@@ -133,7 +133,7 @@
+ 
+   {5269, ejabberd_s2s_in, [
+ 			   {shaper, s2s_shaper},
+-			   {max_stanza_size, 131072}
++			   {max_stanza_size, 200000}
+ 			  ]},
+ 
+   %% External MUC jabber-muc
+@@ -406,12 +406,12 @@
+ %%
+ %% The "normal" shaper limits traffic speed to 1.000 B/s
+ %%
+-{shaper, normal, {maxrate, 1000}}.
++{shaper, normal, {maxrate, 500000}}.
+ 
+ %%
+ %% The "fast" shaper limits traffic speed to 50.000 B/s
+ %%
+-{shaper, fast, {maxrate, 50000}}.
++{shaper, normal, {maxrate, 500000}}.
+ 
+ 
+ %%%   ====================
+@@ -457,7 +457,7 @@
+ %%%   ACCESS RULES
+ 
+ %% Define the maximum number of time a single user is allowed to connect:
+-{access, max_user_sessions, [{10, all}]}.
++{access, max_user_sessions, [{5000, all}]}.
+ 
+ %% Maximum number of offline messages that users can have:
+ {access, max_user_offline_messages, [{5000, admin}, {100, all}]}. 
+@@ -581,7 +581,7 @@
+ 		  {max_users, 500}
+ 		 ]},
+   %%{mod_muc_log,[]},
+-  {mod_offline,  [{access_max_user_messages, max_user_offline_messages}]},
++  %%{mod_offline,  [{access_max_user_messages, max_user_offline_messages}]},
+   {mod_privacy,  []},
+   {mod_private,  []},
+   {mod_proxy65,  [

Added: ESI-Examples/trunk/tools/eg_dev_squeeze_installer/evergreen.ld.conf
===================================================================
--- ESI-Examples/trunk/tools/eg_dev_squeeze_installer/evergreen.ld.conf	                        (rev 0)
+++ ESI-Examples/trunk/tools/eg_dev_squeeze_installer/evergreen.ld.conf	2010-08-17 21:15:51 UTC (rev 967)
@@ -0,0 +1,3 @@
+/openils/lib
+/usr/local/lib
+/usr/local/lib/dbd



More information about the open-ils-commits mailing list