7157787feb0cfdfa474fd8f7a92492d20c091419
[OpenSRF.git] / examples / opensrf.xml.example
1 <?xml version="1.0"?>
2 <!-- 
3 vim:et:ts=2:sw=2:
4 -->
5 <opensrf version="0.0.3">
6 <!-- 
7
8         There is one <host> entry for each server on the network.  Settings for the
9         'default' host are used for every setting that isn't overridden within a given 
10         host's config.  
11
12         To specify which applications a host is serving, list those applications
13         within that host's config section.  If the defaults are acceptible, then
14         that's all that needs to be added/changed.
15
16         Any valid XML may be added to the <default> block and server components will have 
17         acces to it.
18
19 -->
20
21   <default>
22     <dirs>
23
24       <!-- opensrf log files go in this directory -->
25       <log>LOCALSTATEDIR/log</log>
26
27       <!-- opensrf unix domaind socket files go here -->
28       <sock>LOCALSTATEDIR/lock</sock>
29
30       <!-- opensrf pids go here -->
31       <pid>LOCALSTATEDIR/run</pid>
32
33       <!-- global config directory -->
34       <conf>SYSCONFDIR</conf>
35     </dirs>
36
37     <!-- prefork, simple. prefork is suggested -->
38     <server_type>prefork</server_type>
39
40     <!-- Default doesn't host any apps -->
41     <activeapps/>
42     <cache>
43       <global>
44         <servers>
45
46           <!-- memcached server ip:port -->
47           <server>127.0.0.1:11211</server>
48
49         </servers>
50
51         <!-- maximum time that anything may stay in the cache -->
52         <max_cache_time>86400</max_cache_time>
53
54       </global>
55     </cache>
56
57     <!--
58     These are the defaults for every served app.  Each server should 
59     duplicate the node layout for any nodes that need changing.
60     Any settings that are overridden in the server specific section 
61     will be used as the config values for that server.  Any settings that are
62     not overridden will fall back on the defaults
63     Note that overriding 'stateless' will break things
64     -->
65
66     <apps>
67       <opensrf.persist>
68
69         <!--
70         How many seconds to wait between server 
71         requests before timing out a stateful server session.
72         -->
73         <keepalive>1</keepalive>
74
75         <!--
76         if 1, then we support stateless sessions (no connect required),
77         if 0 then we don't
78         -->
79         <stateless>1</stateless>
80
81         <!--
82         Tells the servers which language this implementation is coded in 
83         In this case non "perl" servers will not be able to load the module
84         -->
85         <language>perl</language>
86
87         <!-- Module the implements this application -->
88         <implementation>OpenSRF::Application::Persist</implementation>
89
90         <!-- max stateful REQUEST requests before a session automatically disconnects a client -->
91         <max_requests>97</max_requests>
92
93         <!-- this will disable the stderr output log for this service -->
94         <!--<diable_stderr>true</disable_stderr>-->
95
96         <!-- settings for the backend application drones.  These are probably sane defaults -->
97         <unix_config>
98
99           <!-- unix socket file -->
100           <unix_sock>opensrf.persist_unix.sock</unix_sock>
101
102           <!-- pid file -->
103           <unix_pid>opensrf.persist_unix.pid</unix_pid>
104
105           <!-- max requests per process backend before a child is recycled -->
106           <max_requests>1000</max_requests>
107
108           <!-- log file for this application -->
109           <unix_log>opensrf.persist_unix.log</unix_log>
110
111           <!-- Number of children to pre-fork -->
112           <min_children>5</min_children>
113
114           <!-- maximun number of children to fork -->
115           <max_children>25</max_children>
116
117           <!-- minimun number of spare forked children -->
118           <min_spare_children>2</min_spare_children>
119
120           <!-- max number of spare forked children -->
121           <max_spare_children>5</max_spare_children>
122
123         </unix_config>
124
125         <!-- Any additional setting for a particular application go in the app_settings node -->
126         <app_settings>
127
128           <!-- sqlite database file -->
129           <dbfile>LOCALSTATEDIR/persist.db</dbfile>
130
131         </app_settings>
132       </opensrf.persist>
133
134       <opensrf.math>
135         <keepalive>3</keepalive>
136         <stateless>1</stateless>
137         <language>c</language>
138         <implementation>libosrf_math.so</implementation>
139         <unix_config>
140           <unix_sock>opensrf.math_unix.sock</unix_sock>
141           <unix_pid>opensrf.math_unix.pid</unix_pid>
142           <max_requests>1000</max_requests>
143           <unix_log>opensrf.math_unix.log</unix_log>
144           <min_children>5</min_children>
145           <max_children>15</max_children>
146           <min_spare_children>2</min_spare_children>
147           <max_spare_children>5</max_spare_children>
148         </unix_config>
149       </opensrf.math>
150
151       <opensrf.dbmath>
152         <keepalive>3</keepalive>
153         <stateless>1</stateless>
154         <language>c</language>
155         <implementation>libosrf_dbmath.so</implementation>
156         <unix_config>
157           <max_requests>1000</max_requests>
158           <unix_log>opensrf.dbmath_unix.log</unix_log>
159           <unix_sock>opensrf.dbmath_unix.sock</unix_sock>
160           <unix_pid>opensrf.dbmath_unix.pid</unix_pid>
161           <min_children>5</min_children>
162           <max_children>15</max_children>
163           <min_spare_children>2</min_spare_children>
164           <max_spare_children>5</max_spare_children>
165         </unix_config>
166       </opensrf.dbmath>
167
168       <opensrf.settings>
169         <keepalive>1</keepalive>
170         <stateless>1</stateless>
171         <language>perl</language>
172         <implementation>OpenSRF::Application::Settings</implementation>
173         <max_requests>17</max_requests>
174         <unix_config>
175           <unix_sock>opensrf.settings_unix.sock</unix_sock>
176           <unix_pid>opensrf.settings_unix.pid</unix_pid>
177           <max_requests>1000</max_requests>
178           <unix_log>opensrf.settings_unix.log</unix_log>
179           <min_children>5</min_children>
180           <max_children>15</max_children>
181           <min_spare_children>3</min_spare_children>
182           <max_spare_children>5</max_spare_children>
183         </unix_config>
184       </opensrf.settings>
185
186       <opensrf.slooooooow>
187         <keepalive>1</keepalive>
188         <stateless>1</stateless>
189         <language>perl</language>
190         <implementation>OpenSRF::Application::Slooooooow</implementation>
191         <max_requests>100</max_requests>
192         <unix_config>
193           <unix_sock>opensrf.slooooooow_unix.sock</unix_sock>
194           <unix_pid>opensrf.slooooooow_unix.pid</unix_pid>
195           <max_requests>1000</max_requests>
196           <unix_log>opensrf.slooooooow_unix.log</unix_log>
197           <min_children>2</min_children>
198           <max_children>5</max_children>
199           <min_spare_children>1</min_spare_children>
200           <max_spare_children>2</max_spare_children>
201           <max_backlog_queue>10</max_backlog_queue>
202         </unix_config>
203       </opensrf.slooooooow>
204
205       <opensrf.validator>
206         <keepalive>1</keepalive>
207         <stateless>1</stateless>
208         <language>perl</language>
209         <implementation>OpenSRF::Application::Validator</implementation>
210         <max_requests>17</max_requests>
211         <unix_config>
212           <unix_sock>opensrf.validator_unix.sock</unix_sock>
213           <unix_pid>opensrf.validator_unix.pid</unix_pid>
214           <max_requests>1000</max_requests>
215           <unix_log>opensrf.validator_unix.log</unix_log>
216           <min_children>5</min_children>
217           <max_children>15</max_children>
218           <min_spare_children>3</min_spare_children>
219           <max_spare_children>5</max_spare_children>
220         </unix_config>
221         <app_settings>
222           <validators>
223             <emailaddress>
224               <modules>
225                 <a_regex>
226                     <implementation>OpenSRF::Application::Validator::EmailAddress::Regex</implementation>
227                 </a_regex>
228                 <b_dns>
229                     <implementation>OpenSRF::Application::Validator::EmailAddress::DNS</implementation>
230                     <check_mx_a>1</check_mx_a>
231                     <!-- Change this to a 1 to check for IPV6 records as well as IPV4 -->
232                     <check_aaaa>0</check_aaaa>
233                     <!-- Uncomment this to specify a resolve.conf-like config file for DNS lookups -->
234                     <!--<config_file>/path/to/file</config_file>-->
235                     <!-- A set of IPs to ignore - Useful when your DNS provider intercepts NXDOMAIN (say, OpenDNS) -->
236                     <ignore_ips>127.0.0.1,67.215.65.132</ignore_ips>
237                 </b_dns>
238               </modules>
239             </emailaddress>
240           </validators>
241         </app_settings>
242       </opensrf.validator>
243     </apps>
244   </default>
245
246   <hosts>
247
248     <localhost>
249       <!-- ^-=- 
250         Should match the fully qualified domain name of the host.
251
252         On Linux, the output of the following command is authoritative:
253         $ perl -MNet::Domain -e 'print Net::Domain::hostfqdn() . "\n";'
254
255         To use 'localhost' instead, run osrf_control with the 'localhost' flag
256       -->
257       <!-- List all of the apps this server will be running -->
258       <activeapps>
259         <appname>opensrf.persist</appname>
260         <appname>opensrf.settings</appname>
261         <appname>opensrf.math</appname>
262         <appname>opensrf.dbmath</appname>
263         <appname>opensrf.validator</appname>
264         <appname>opensrf.slooooooow</appname>
265       </activeapps>
266
267       <apps>
268
269 <!-- Example of an app-specific setting override -->
270         <opensrf.persist>
271           <app_settings>
272             <dbfile>LOCALSTATEDIR/persist-override.db</dbfile>
273           </app_settings>
274         </opensrf.persist>
275
276       </apps>
277
278     </localhost>
279
280   </hosts>
281
282 </opensrf>