The following steps have been tested on Redhat x86 (32-bit) and x86-64 (64-bit) platforms.
In the following instructions, you are asked to perform certain steps as either the root user or the opensrf user.
su - command and enter the password of the root user.
To switch from the root user to a different user, issue the su - <username> command; for example, su - opensrf. Once you have become a non-root user, to become the root user again simply issue the exit command.
rhnreg_ks --username=<user> --password=<pass> --profilename=<name> vi /etc/sysconfig/selinux # change from enforcing to disabled reboot
/etc/init.d/iptables stop chkconfig --del iptables
/bin/bash to inherit a reasonable environment:yum install -y subversion useradd -m -s /bin/bash opensrf passwd opensrf # only necessary if you want to log in to this user directly
cd && svn checkout svn://svn.open-ils.org/OpenSRF/trunk OpenSRF-trunk
cd /home/opensrf/OpenSRF-trunk make -f src/extras/Makefile.install rhel
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”.
–enable-python and –enable-java configure options if you want to include support for Python and Java, respectively:cd /home/opensrf/OpenSRF-trunk cat /usr/share/aclocal/libtool.m4 >> aclocal.m4 mkdir m4 && ./autogen.sh export memcached_LIBS=/usr/local/lib/libmemcached export memcached_CFLAGS=-lmemcached ./configure --prefix=/openils --sysconfdir=/openils/conf --with-apxs=/usr/sbin/apxs make
cd /home/opensrf/OpenSRF-trunk make install
/openils/lib to the system dynamic library path and make your system recognize the newly installed libraries./etc/ld.so.conf.d/osrf.conf containing the following line:/openils/lib
ldconfig
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 /etc/hosts file. Here are the entries to add as root to a stock /etc/hosts file for our example domains: 127.0.1.2 public.localhost public 127.0.1.3 private.localhost private
chown -R opensrf:opensrf /openils
/opt/ejabberd/bin/ejabberdctl stop
beam and epmd processes:/opt/ejabberd/bin/epmd -kill
/opt/ejabberd/conf/ejabberd.cfg:{hosts, ["localhost"]}.
to
{hosts, ["localhost", "private.localhost", "public.localhost"]}.
{max_user_sessions, 10}. to {max_user_sessions, 10000}. max_stanza_size to 2000000.maxrate to 500000.{mod_offline line by placing two % signs in front./opt/ejabberd/bin/ejabberdctl start
opensrf_core.xml:# Syntax for registering a user with ejabberdctl # ejabberdctl register <user> <domain> <password> /opt/ejabberd/bin/ejabberdctl register router private.localhost <password> /opt/ejabberd/bin/ejabberdctl register opensrf private.localhost <password> /opt/ejabberd/bin/ejabberdctl register router public.localhost <password> /opt/ejabberd/bin/ejabberdctl register opensrf public.localhost <password>
/openils/conf/opensrf_core.xml and /openils/conf/opensrf.xml configuration files from the example templates:cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
/openils/conf/opensrf_core.xml to change the Jabber usernames and passwords as follows. I'm using XPath syntax on the left-hand side to indicate the position in the XML file:/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/config/routers/router/transport - first entry, where transport/server == public.localhost :username = routerpassword = password for public.localhost router user/config/routers/router/transport - second entry, where transport/server == private.localhost :username = routerpassword = password for private.localhost router user/openils/conf/srfsh.xml.example to .srfsh.xml in the home directory of each user you want to use to run the srfsh command line client for testing OpenSRF, and edit .srfsh.xml as follows:domain is the router hostname (following our domain examples, private.localhost will give your srfsh access to all OpenSRF services, while public.localhost will only give you access to those OpenSRF services that are publicly exposed)username and password must match your opensrf ejabber user for the chosen domainlogfile is the full path for a log file to which that user has write access<?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> <loglevel>3</loglevel> </srfsh>
.bashrc file:echo "export PATH=/openils/bin:\$PATH" >> ~/.bashrc exit
Before starting OpenSRF, ensure that your Jabber and memcached daemons are running. As the root user:
/opt/ejabberd/bin/ejabberdctl start /etc/init.d/memcached start
You might want to add these to start when the machine boots:
useradd -m -s /bin/bash ejabberd chown ejabberd:ejabberd -R /opt/ejabberd cp /opt/ejabberd/bin/ejabberd.init /etc/init.d/ejabberd vi /etc/init.d/ejabberd
Now add these lines to the top of /etc/init.d/ejabberd immediately below the #!/bin/sh:
# chkconfig: 2345 95 20 # description: ejabberd start/stop init script # Script to start and stop ejabberd # processname: ejabberd
Now finish adding these programs to autostart:
chkconfig --level 2345 ejabberd on chkconfig --level 2345 memcached on
Starting OpenSRF with the start_all option starts the OpenSRF router, Perl services, and C services. As the opensrf user, start OpenSRF (NOTE: use the -l flag only if you wish to force the hostname for the <hosts> section in opensrf.xml to be localhost):
osrf_ctl.sh -l -a start_all
/openils/bin directory; this should have been set by .bashrc when you logged in as the opensrf user, but you can manually set it using the following command:export PATH=$PATH:/openils/bin
Once you have installed and started OpenSRF, test your connection to OpenSRF via srfsh:
srfsh and try calling the add method on the OpenSRF math service:/openils/bin/srfsh srfsh# request opensrf.math add 2 2
You should see a result like:
Received Data: 4 ------------------------------------ Request Completed Successfully Request Time in seconds: 0.007519 ------------------------------------ srfsh#
If this does not work, it's time to do some troubleshooting. Please do not make any significant changes to your configuration. 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 in /openils/var/log and contact the Evergreen development mailing list for assistance before making any drastic changes to your system configuration.
osrf_ctl.sh -l -a stop_all