1 README for OpenSRF 1.0 RC
3 Installing prerequisites:
4 ========================
6 OpenSRF has a number of prerequisite packages that must be installed
7 before you can successfully configure, compile, and install OpenSRF.
8 On Debian and Ubuntu, the easiest way to install these prerequisites
9 is to use the Makefile.install prerequisite installer for Evergreen.
11 Issue the following commands as the root user to install prerequisites
12 using the Makefile.install prerequisite installer, substituting "debian"
13 or "ubuntu" for <osname> below:
16 make -f src/extras/Makefile.install <osname>
18 When the prerequisite installer reaches the Perl module stage, you will
19 be prompted for configuration of Comprehensive Perl Archive Network (CPAN)
20 on your mserver. You can just press <return> for all of the prompts, except
21 for the country configuration.
23 Note: You may also be able to use "centos" to install the OpenSRF
24 prerequisites for CentOS 5 and RHEL 5, or "gentoo" for Gentoo - but
25 these are less tested distributions. Your patches and suggestions for
26 improvement are welcome!
28 Configuration and compilation instructions:
29 ==========================================
31 For the time being, we are still installing everything in the /openils/
32 directory (with the exception of the Perl modules, which are installed
33 into system directories). Issue the following commands to configure and
36 ./configure --prefix=/openils --sysconfdir=/openils/conf
39 Installation instructions:
40 =========================
42 Once you have configured and compiled OpenSRF, issue the following
43 command as the root user to install OpenSRF:
47 This will install OpenSRF, including example configuration files in
48 /openils/conf/ that you can use as templates for your own configuration files.
50 Create and set up the opensrf Unix user environment:
51 ===================================================
53 This user is used to start and stop all OpenSRF processes, and must own all
54 files contained in the PREFIX directory hierarchy. Issue the following
55 commands as root to create the "opensrf" user and set up its environment,
56 substituting <PREFIX> with the value you passed to --prefix in your
59 $ useradd -m -s /bin/bash opensrf
60 $ echo "export PERL5LIB=\$PERL5LIB:/<PREFIX>/lib" > /home/opensrf/.bashrc
61 $ echo "export PATH=\$PATH:/<PREFIX>/bin" > /home/opensrf/.bashrc
64 Adjust the system dynamic library path:
65 ======================================
67 Add /openils/lib/ to the system's dynamic library path, and then run "ldconfig"
70 On Debian and Ubuntu systems, run the following commands as root:
72 $ echo /openils/lib > /etc/ld.so.conf.d/opensrf.conf
75 On most other systems, you can add these entries to a /etc/ld.so.conf, or create
76 a file within the /etc/ld.so.conf.d/ directory, and then run "ldconfig" as root.
78 Configure the ejabberd server:
79 =============================
81 OpenSRF requires an XMPP (Jabber) server. For performance reasons, ejabberd is
82 the Jabber server of choice for the OpenSRF project. In most cases, you only
83 have to make a few changes to the default ejabberd.cfg file to make ejabberd
84 work for OpenSRF. Open /etc/ejabberd/ejabberd.cfg and make the following
87 1. Comment out the "mod_offline" directive
88 2. Increase the "max_user_sessions" value to 1000
89 3. Change all "max_stanza_size" values to 200000
90 4. Change all "maxrate values" to 500000
92 Restart the ejabberd server to make the changes take effect.
94 Create the OpenSRF Jabber users:
95 ===============================
97 You need two Jabber users to manage the OpenSRF communications:
99 * a "router" user, to whom all requests to connect to an OpenSRF service
100 will be routed; this Jabber user must be named "router"
101 * an "opensrf" user, which clients use to connect to OpenSRF services; this
102 user can be named anything you like
104 Create the Jabber users by issuing the following commands as root. Substitute
105 <password> for your chosen passwords for each user respectively:
107 $ ejabberdctl register router localhost <password>
108 $ ejabberdctl register opensrf localhost <password>
110 Update the OpenSRF configuration files:
111 ======================================
113 There are two critical files that you must update to make OpenSRF work.
114 "SYSCONFDIR" will be /openils/conf/ if you followed the configuration
117 * SYSCONFDIR/opensrf.xml - this file lists the services that this
118 OpenSRF installation supports; if you create a new OpenSRF service,
119 you need to add it to this file.
120 * The <hosts> element at the bottom of the file lists the services
121 that should be started for each hostname. You can force the system
122 to use "localhost", so in most cases you will leave this section
124 * You must alter the <dbfile> element value for the "opensrf.persist"
125 service to point to a directory to which the opensrf user can write.
126 Note that the override in the <hosts> section takes precedence over
127 the general service definition value.
129 * SYSCONFDIR/opensrf_core.xml - this file lists the Jabber connection
130 information that will be used for the system, as well as determining
131 logging verbosity and defining which services will be exposed on the
132 HTTP gateway. There are three username/password pairs to update in this
134 1. <config><opensrf> = use the Jabber "opensrf" user
135 2. <config><gateway> = use the Jabber "opensrf" user
136 3. <config><routers><router> = use the Jabber "router" user
138 You should also create a .srfsh.xml file in the home directory of each user
139 that you want to enable to use the srfsh to communicate with OpenSRF services.
141 Copy /openils/conf/srfsh.xml to ~/.srfsh.xml and update the username and
142 password values with the Jabber "opensrf" user credentials.
144 Starting and stopping OpenSRF services:
145 ======================================
147 To start all OpenSRF services with a hostname of "localhost", issue the
148 following command as the opensrf user:
150 $ osrf_ctl.sh -l -a start_all
152 To stop all OpenSRF services with a hostname of "localhost", issue the
153 following command as the opensrf user:
155 $ osrf_ctl.sh -l -a stop_all
157 Testing the default OpenSRF services:
158 ====================================
160 By default, OpenSRF ships with an opensrf.math service that performs basic
161 calculations involving two integers. Once you have started the OpenSRF
162 services, start srfsh and issue the following request:
164 srfsh# request opensrf.math add 2,2
166 You should receive the value "4".
168 Troubleshooting note for Python users:
169 =====================================
171 If you are running a Python client and trying to connect to OpenSRF running on
172 localhost rather than a hostname that can be resolved via DNS, you will
173 probably receive exceptions about "dns.resolver.NXDOMAIN". If this happens,
174 you need to install the dnsmasq package, configure it to serve up a DNS
175 entry for localhost, and point your local DNS resolver to dnsmasq. For example,
176 on Ubuntu you can issue the following commands as root:
178 $ aptitude install dnsmasq
179 $ echo "webserver=/localhost/127.0.0.1/" >> /etc/dnsmasq.conf
180 $ /etc/init.d/dnsmasq restart
182 Then edit /etc/resolv.conf and ensure that "nameserver 127.0.0.1" is the first
188 Need help installing or using OpenSRF? Join the mailing lists at
189 http://evergreen-ils.org/listserv.php or contact us on the Freenode
190 IRC network on the #evergreen channel.