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