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