]> git.evergreen-ils.org Git - OpenSRF.git/blob - README
a118ebc8cdca0c0b1c3ba6e0d479da73fd111df2
[OpenSRF.git] / README
1 README for OpenSRF 1.0 RC
2
3 Installing prerequisites:
4 ========================
5
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.
10
11 Issue the following commands as the root user to install prerequisites
12 using the Makefile.install prerequisite installer, substituting your
13 operating system identifier for <osname> below:
14
15 aptitude install make
16 make -f src/extras/Makefile.install <osname>
17
18 Well-tested values for <osname> include:
19   * "debian-etch" for Debian 4.0
20   * "debian-lenny" for Debian 5.0
21   * "ubuntu-gutsy" for Ubuntu 7.10
22   * "ubuntu-hardy" for Ubuntu 8.04
23   * "ubuntu-intrepid" for Ubuntu 8.10
24
25 Less-tested values for <osname> include:
26   * "centos" for CentOS 5 and Red Hat Enterprise Linux 5
27   * "gentoo" for Gentoo
28
29 Patches and suggestions for improvement from users of these distributions,
30 or others, are welcome!
31
32 When the prerequisite installer reaches the Perl module stage, you may 
33 be prompted for configuration of Comprehensive Perl Archive Network (CPAN)
34 on your mserver. You can just press <return> for all of the prompts, except
35 for the country configuration.
36
37 Note: If you are installing this using a copy of the source code that was
38 checked out directly from the OpenSRF Subversion repository rather
39 than from a downloaded release of the source code, there are a few
40 additional prerequisite tools and steps that you will need to follow.
41 See "Developer instructions" at the bottom of the file.
42
43 Configuration and compilation instructions:
44 ==========================================
45
46 For the time being, we are still installing everything in the /openils/
47 directory (with the exception of the Perl modules, which are installed
48 into system directories). Issue the following commands to configure and
49 build OpenSRF:
50
51 ./configure --prefix=/openils --sysconfdir=/openils/conf
52 make
53
54 By default, OpenSRF includes C, Perl, and JavaScript support.
55 You can add the "--enable-python" option to the configure command
56 to build Python support, and "--enable-java" for Java support.
57
58 Installation instructions:
59 =========================
60
61 Once you have configured and compiled OpenSRF, issue the following
62 command as the root user to install OpenSRF:
63
64 make install
65
66 This will install OpenSRF, including example configuration files in
67 /openils/conf/ that you can use as templates for your own configuration files.
68
69 Create and set up the opensrf Unix user environment:
70 ===================================================
71
72 This user is used to start and stop all OpenSRF processes, and must own all
73 files contained in the PREFIX directory hierarchy. Issue the following
74 commands as root to create the "opensrf" user and set up its environment,
75 substituting <PREFIX> with the value you passed to --prefix in your
76 configure command:
77
78 $ useradd -m -s /bin/bash opensrf
79 $ echo "export PERL5LIB=\$PERL5LIB:/<PREFIX>/lib" > /home/opensrf/.bashrc
80 $ echo "export PATH=\$PATH:/<PREFIX>/bin" > /home/opensrf/.bashrc
81 $ passwd opensrf
82
83 Adjust the system dynamic library path:
84 ======================================
85
86 Add /openils/lib/ to the system's dynamic library path, and then run "ldconfig"
87 as root.
88
89 On Debian and Ubuntu systems, run the following commands as root:
90
91 $ echo /openils/lib > /etc/ld.so.conf.d/opensrf.conf
92 $ ldconfig
93
94 On most other systems, you can add these entries to a /etc/ld.so.conf, or create
95 a file within the /etc/ld.so.conf.d/ directory, and then run "ldconfig" as root.
96
97 Configure the ejabberd server:
98 =============================
99
100 OpenSRF requires an XMPP (Jabber) server. For performance reasons, ejabberd is
101 the Jabber server of choice for the OpenSRF project. In most cases, you only
102 have to make a few changes to the default ejabberd.cfg file to make ejabberd
103 work for OpenSRF. Open /etc/ejabberd/ejabberd.cfg and make the following
104 changes:
105
106 1. Comment out the "mod_offline" directive
107 2. Increase the "max_user_sessions" value to 1000
108 3. Change all "max_stanza_size" values to 200000
109 4. Change all "maxrate values" to 500000 
110
111 Restart the ejabberd server to make the changes take effect.
112
113 Create the OpenSRF Jabber users:
114 ===============================
115
116 You need two Jabber users to manage the OpenSRF communications:
117
118   * a "router" user, to whom all requests to connect to an OpenSRF service
119     will be routed; this Jabber user must be named "router"
120   * an "opensrf" user, which clients use to connect to OpenSRF services; this
121     user can be named anything you like
122
123 Create the Jabber users by issuing the following commands as root. Substitute
124 <password> for your chosen passwords for each user respectively:
125
126 $ ejabberdctl register router localhost <password>
127 $ ejabberdctl register opensrf localhost <password>
128
129 Update the OpenSRF configuration files:
130 ======================================
131
132 There are two critical files that you must update to make OpenSRF work.
133 "SYSCONFDIR" will be /openils/conf/ if you followed the configuration
134 suggestion above:
135
136   * SYSCONFDIR/opensrf.xml - this file lists the services that this
137     OpenSRF installation supports; if you create a new OpenSRF service,
138     you need to add it to this file.
139       * The <hosts> element at the bottom of the file lists the services
140         that should be started for each hostname. You can force the system
141         to use "localhost", so in most cases you will leave this section
142         as-is.
143       * You must alter the <dbfile> element value for the "opensrf.persist"
144         service to point to a directory to which the opensrf user can write.
145         Note that the override in the <hosts> section takes precedence over
146         the general service definition value.
147     
148   * SYSCONFDIR/opensrf_core.xml - this file lists the Jabber connection
149     information that will be used for the system, as well as determining
150     logging verbosity and defining which services will be exposed on the
151     HTTP gateway. There are three username/password pairs to update in this
152     file:
153       1. <config><opensrf> = use the Jabber "opensrf" user
154       2. <config><gateway> = use the Jabber "opensrf" user
155       3. <config><routers><router> = use the Jabber "router" user
156
157 You should also create a .srfsh.xml file in the home directory of each user
158 that you want to enable to use the srfsh to communicate with OpenSRF services.
159
160 Copy /openils/conf/srfsh.xml to ~/.srfsh.xml and update the username and
161 password values with the Jabber "opensrf" user credentials.
162
163 Starting and stopping OpenSRF services:
164 ======================================
165
166 To start all OpenSRF services with a hostname of "localhost", issue the
167 following command as the opensrf user:
168
169 $ osrf_ctl.sh -l -a start_all
170
171 To stop all OpenSRF services with a hostname of "localhost", issue the
172 following command as the opensrf user:
173
174 $ osrf_ctl.sh -l -a stop_all
175
176 Testing the default OpenSRF services:
177 ====================================
178
179 By default, OpenSRF ships with an opensrf.math service that performs basic
180 calculations involving two integers. Once you have started the OpenSRF
181 services, start srfsh and issue the following request:
182
183 srfsh# request opensrf.math add 2,2
184
185 You should receive the value "4".
186
187 Troubleshooting note for Python users:
188 =====================================
189
190 If you are running a Python client and trying to connect to OpenSRF running on
191 localhost rather than a hostname that can be resolved via DNS, you will
192 probably receive exceptions about "dns.resolver.NXDOMAIN". If this happens,
193 you need to install the dnsmasq package, configure it to serve up a DNS
194 entry for localhost, and point your local DNS resolver to dnsmasq. For example,
195 on Ubuntu you can issue the following commands as root:
196
197 $ aptitude install dnsmasq
198 $ echo "webserver=/localhost/127.0.0.1/" >> /etc/dnsmasq.conf
199 $ /etc/init.d/dnsmasq restart
200
201 Then edit /etc/resolv.conf and ensure that "nameserver 127.0.0.1" is the first
202 entry in the file.
203
204 Developer instructions:
205 ======================
206
207 Developers working directly with the source code from the Subversion
208 repository will also need to install some extra packages and perform
209 one more step before they can proceed with the "./configure" step.
210
211 Install the following packages:
212   * autoconf
213   * automake
214   * libtool
215
216 Run the following command in the source directory to generate the configure
217 script and Makefiles:
218
219 $ ./autogen.sh 
220
221 Getting help:
222 ============
223
224 Need help installing or using OpenSRF? Join the mailing lists at
225 http://evergreen-ils.org/listserv.php or contact us on the Freenode
226 IRC network on the #evergreen channel.