~ubuntu-branches/debian/sid/pyro/sid

« back to all changes in this revision

Viewing changes to docs/3-install.html

  • Committer: Bazaar Package Importer
  • Author(s): Carl Chenet, Carl Chenet, Jakub Wilk
  • Date: 2010-09-14 01:04:28 UTC
  • Revision ID: james.westby@ubuntu.com-20100914010428-02r7p1rzr7jvw94z
Tags: 1:3.9.1-2
[Carl Chenet]
* revert to 3.9.1-1 package because of the development status 
  of the 4.1 package is unsuitable for stable use
  DPMT svn #8557 revision (Closes: #589172) 
* added debian/source
* added debian/source/format
* package is now 3.0 (quilt) source format
* debian/control
  - Bump Standards-Version to 3.9.1

[Jakub Wilk]
* Add ‘XS-Python-Version: >= 2.5’ to prevent bytecompilation with python2.4
  (closes: #589053).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<html>
 
3
<!-- $Id: 3-install.html,v 2.44.2.12 2009/03/26 21:27:26 irmen Exp $ -->
 
4
<head>
 
5
  <title>PYRO - Installation</title>
 
6
  <link rel="stylesheet" type="text/css" href="pyromanual_print.css" media="print">
 
7
  <link rel="stylesheet" type="text/css" href="pyromanual.css" media="screen">
 
8
</head>
 
9
 
 
10
<body>
 
11
  <div class="nav">
 
12
  <table width="100%">
 
13
    <tr>
 
14
      <td align="left"><a href="2-concepts.html">&lt;previous</a> | <a href="PyroManual.html">contents</a> | <a href=
 
15
      "4-usage.html">next&gt;</a></td>
 
16
 
 
17
      <td align="right">Pyro Manual</td>
 
18
    </tr>
 
19
  </table>
 
20
<hr></div>
 
21
 
 
22
  <h2>3. Installation and Configuration</h2>
 
23
  Please read this entire chapter before trying to install Pyro.&nbsp;
 
24
  Not that it's complex, but just that you've seen the choices you have to make.
 
25
 
 
26
  <p><strong>Installation</strong></p>
 
27
 
 
28
  <p>Pyro distributions contain a &quot;distutils&quot; <code>setup.py</code> script that will install
 
29
      Pyro for you; just enter the following command from a shell prompt: &quot; <code>python setup.py
 
30
      install</code>&quot; and
 
31
      off you go. The script will ask if you want to install the Pyro script tools, and where to put
 
32
      them. If you want to do an automated (unattended) install, edit the <code>setup.cfg</code> file,
 
33
      following the directions in that file. <em>It will not install the
 
34
  documentation and the examples, only the core Pyro library and the scripts.</em></p>
 
35
 
 
36
  <p>But I will explain what exactly is in the Pyro distribution. It has a few subdirectories:</p>
 
37
 
 
38
  <dl>
 
39
    <dt><code>Pyro/</code></dt>
 
40
 
 
41
    <dd>This is the actual Pyro package. If you do not use the supplied <code>setup.py</code> install script (see
 
42
    above) you have to install it by hand. Install this directory somewhere in your Python search path. On most systems
 
43
    (also Windows), the <code>lib/site-packages</code> directory is a nice place. The exact location might vary
 
44
    according to your specific Python installation.</dd>
 
45
 
 
46
    <dd>Alternatively, keep it where it is and manually add the Pyro root directory to your Python search path (e.g. in
 
47
    the environment variable <code>PYTHONPATH</code>).</dd>
 
48
 
 
49
    <dt><code>bin/</code></dt>
 
50
 
 
51
    <dd>This directory contains the command-line utilities. Move the contents of this directory somewhere in your shell
 
52
    search path.</dd>
 
53
 
 
54
    <dd>Alternatively, keep it where it is and manually add it to your shell search path.</dd>
 
55
 
 
56
    <dt><code>docs/</code>&nbsp;&nbsp; and&nbsp;&nbsp; <code>examples/</code></dt>
 
57
 
 
58
    <dd>Put those wherever you like. In docs you can find the Pyro manual, and in examples there are some Pyro
 
59
    examples.</dd>
 
60
  </dl>
 
61
 
 
62
  <p><strong>Configuration</strong></p>
 
63
 
 
64
  <p>The default settings will do nicely in most cases. But sooner or later you will have to change some parameters of
 
65
  Pyro. Pyro's configuration is accessed through <code>Pyro.config</code>. This object has a lot of configuration
 
66
  items, shown in the table below.<br></p>
 
67
  <p>Use <code>python -m Pyro.configuration</code> to get a printout of Pyro's active configuration settings.</p>
 
68
 
 
69
  <table>
 
70
    <tr>
 
71
      <th>Configuration item</th>
 
72
 
 
73
      <th>Type</th>
 
74
 
 
75
      <th>Description</th>
 
76
 
 
77
      <th>Default value</th>
 
78
    </tr>
 
79
 
 
80
    <tr>
 
81
      <td><code>PYRO_CONFIG_FILE</code></td>
 
82
 
 
83
      <td>string</td>
 
84
 
 
85
      <td>The Pyro configuration file that is used. See below.</td>
 
86
 
 
87
      <td>Special, see below</td>
 
88
    </tr>
 
89
 
 
90
    <tr>
 
91
      <td><code>PYRO_STORAGE</code></td>
 
92
 
 
93
      <td>string</td>
 
94
 
 
95
      <td>Location where Pyro stores data like log files. <em>Read the notice at the end!</em></td>
 
96
 
 
97
      <td><i>Current directory</i></td>
 
98
    </tr>
 
99
 
 
100
    <tr>
 
101
      <td><code>PYRO_LOGFILE</code></td>
 
102
 
 
103
      <td>string</td>
 
104
 
 
105
      <td>Name of the logfile. If it's not an absolute path, it's relative to <code>$PYRO_STORAGE</code>. It's best to
 
106
      modify this <em>before</em> importing <code>Pyro.util</code>!</td>
 
107
 
 
108
      <td><code>Pyro_log</code></td>
 
109
    </tr>
 
110
 
 
111
    <tr>
 
112
      <td><code>PYRO_USER_LOGFILE</code></td>
 
113
 
 
114
      <td>string</td>
 
115
 
 
116
      <td>Name of the user logfile. If it's not an absolute path, it's relative to <code>$PYRO_STORAGE</code>.</td>
 
117
 
 
118
      <td><code>Pyro_userlog</code></td>
 
119
    </tr>
 
120
 
 
121
    <tr>
 
122
      <td><code>PYRO_TRACELEVEL</code></td>
 
123
 
 
124
      <td>number</td>
 
125
 
 
126
      <td>The tracing level of Pyro, 0-3. 0=nothing, 1=only errors, 2=warnings too, 3=full: errors, warnings and
 
127
      notes.</td>
 
128
 
 
129
      <td>0</td>
 
130
    </tr>
 
131
 
 
132
    <tr>
 
133
      <td><code>PYRO_USER_TRACELEVEL</code></td>
 
134
 
 
135
      <td>number</td>
 
136
 
 
137
      <td>The user tracing level, 0-3. 0=nothing, 1=only errors, 2=warnings too, 3=full: errors, warnings and
 
138
      notes.</td>
 
139
 
 
140
      <td>0</td>
 
141
    </tr>
 
142
 
 
143
    <tr>
 
144
      <td><code>PYRO_DETAILED_TRACEBACK</code></td>
 
145
 
 
146
      <td>boolean</td>
 
147
 
 
148
      <td>Should Pyro dump detailed tracebacks (with dumps of local variable's values)? If set to 1 on the server, the
 
149
      clients will get detailed tracebacks from inside the server's code. You may not want this (security)...</td>
 
150
 
 
151
      <td>0</td>
 
152
    </tr>
 
153
 
 
154
    <tr>
 
155
      <td><code>PYRO_STDLOGGING</code></td>
 
156
 
 
157
      <td>boolean</td>
 
158
 
 
159
      <td>Should Pyro use new-style logging using the <code>logging</code> module (Python 2.3+)?</td>
 
160
 
 
161
      <td>0</td>
 
162
    </tr>
 
163
 
 
164
    <tr>
 
165
      <td><code>PYRO_STDLOGGING_CFGFILE</code></td>
 
166
 
 
167
      <td>string</td>
 
168
 
 
169
      <td>Name of the configuration file that is used to configure the new-style logging. If it's not an absolute path,
 
170
      it's relative to <code>$PYRO_STORAGE</code>. If this file doesn't exist, Pyro uses the default configuration that
 
171
      resembles the classic Pyro logging style.</td>
 
172
 
 
173
      <td><code>logging.cfg</code></td>
 
174
    </tr>
 
175
 
 
176
    <tr>
 
177
      <td><code>PYRO_PICKLE_FORMAT</code></td>
 
178
 
 
179
      <td>integer</td>
 
180
 
 
181
      <td>The pickle protocol format that Pyro will use for marshaling.</td>
 
182
 
 
183
      <td><code>pickle.HIGHEST_PROTOCOL</code> on Python 2.3+, else 1</td>
 
184
    </tr>
 
185
 
 
186
    <tr>
 
187
      <td><code>PYRO_XML_PICKLE</code></td>
 
188
 
 
189
      <td>string</td>
 
190
 
 
191
      <td>Whether the marshaling is done using the safe xml pickling or
 
192
          the default pickle. The xml_pickle is not vulnerable for the <a href="9-security.html#pickle">pickle
 
193
          trojan problem</a>, but
 
194
      it is an order of a magnitude slower, and requires more bandwith. 
 
195
      Set to &quot;gnosis&quot; for Gnosis XML pickler. There are no other options available at this time.
 
196
      You need to have installed <a href=
 
197
      "http://gnosis.cx/download/">Gnosis_Utils</a> (at least version 1.2.x).
 
198
      Note that you have to use the same Gnosis XML library version everywhere. You can't mix older versions with newer versions. </td>
 
199
      <td><i>empty</i> (disabled)</td>
 
200
    </tr>
 
201
 
 
202
    <tr>
 
203
      <td><code>PYRO_GNOSIS_PARANOIA</code></td>
 
204
      <td>number</td>
 
205
      <td>The 'paranoia' setting that will be used for the Gnosis XML pickler. Higher=more secure. 
 
206
        The default setting (0) prevents automatic imports of modules during unpickling. 
 
207
        Set it to -1 to enable automatic imports of user defined modules.
 
208
        When you use the mobile code feature together with Gnosis XML pickling, you need
 
209
        to set it to -1 as well.</td>
 
210
      <td>0</td>
 
211
    </tr>
 
212
 
 
213
    <tr>
 
214
      <td><code>PYRO_COMPRESSION</code></td>
 
215
 
 
216
      <td>boolean</td>
 
217
 
 
218
      <td>Whether the protocol should compress the data to save bandwidth (at the cost of CPU time). The
 
219
      <code>zlib</code> module is used for compression. If you don't have <code>zlib</code>, Pyro still works, but
 
220
      without compression.</td>
 
221
 
 
222
      <td>0</td>
 
223
    </tr>
 
224
 
 
225
    <tr>
 
226
      <td><code>PYRO_CHECKSUM</code></td>
 
227
 
 
228
      <td>boolean</td>
 
229
 
 
230
      <td>Whether the protocol should perform a checksum over the message data. This costs a little bit extra CPU time,
 
231
      but you will be quite sure that your communication is without errors. The <code>zlib.adler32</code> function is
 
232
      used for checksumming. If you don't have <code>zlib</code>, Pyro still works, but without checksumming. The
 
233
      overhead of checksumming is very small, with regular messages less than 0.1%, but increasing with big messages
 
234
      (15% for 5 Mb or so). <strong>Note:</strong> the checksum is by no means secure. If you want secure
 
235
      transmissions, you'll have to use SSL or build your own encryption/secure hashing functions on top of Pyro.</td>
 
236
 
 
237
      <td>0</td>
 
238
    </tr>
 
239
 
 
240
    <tr>
 
241
      <td><code>PYRO_SOCK_KEEPALIVE</code></td>
 
242
 
 
243
      <td>boolean</td>
 
244
 
 
245
      <td>Whether Pyro should set the SO_KEEPALIVE socket option on the network sockets. This is used
 
246
          to detect broken client connections, to let the Pyro server clean them up nicely. It is enabled
 
247
          by default, but it could cause problems in certain situations so you can turn it off if you
 
248
          want. The timeout period is system-dependent but usually around 2 hours. It depends on your
 
249
          OS how to change this value, but have a look at &quot;sysctl&quot;. (This
 
250
      feature may not be available on all OS's, if your OS doesn't support it, Pyro will automatically
 
251
          switch it off).</td>
 
252
 
 
253
      <td>1</td>
 
254
    </tr>
 
255
 
 
256
    <tr>
 
257
      <td><code>PYRO_MAXCONNECTIONS</code></td>
 
258
 
 
259
      <td>number</td>
 
260
 
 
261
      <td>The maximum number of simultaneous connections to one Pyro server. Note that a custom connection validator
 
262
      may or may not take this in account. The default validator does check for this limit.</td>
 
263
 
 
264
      <td>200</td>
 
265
    </tr>
 
266
 
 
267
    <tr>
 
268
      <td><code>PYRO_TCP_LISTEN_BACKLOG</code></td>
 
269
 
 
270
      <td>number</td>
 
271
 
 
272
      <td>The size of the TCP socket listen backlog for Pyro daemons.</td>
 
273
 
 
274
      <td>200</td>
 
275
    </tr>
 
276
 
 
277
    <tr>
 
278
        <td><code>PYRO_BROKEN_MSGWAITALL</code></td>
 
279
        <td>boolean</td>
 
280
        <td>Some systems have broken socket MSG_WAITALL support. Set this item to 1 if your system is one of these. When
 
281
        set to 1, Pyro will use a different piece of code to receive data (slower, but working on these systems as well). </td>
 
282
        <td>0</td>
 
283
    </tr>
 
284
    <tr>
 
285
      <td><code>PYRO_MULTITHREADED</code></td>
 
286
 
 
287
      <td>boolean</td>
 
288
 
 
289
      <td>Whether Pyro servers should be multithreaded or not.</td>
 
290
 
 
291
      <td>1 (if supported)</td>
 
292
    </tr>
 
293
 
 
294
    <tr>
 
295
      <td><code>PYRO_MOBILE_CODE</code></td>
 
296
 
 
297
      <td>boolean</td>
 
298
 
 
299
      <td>On the server: whether Pyro should automatically download Python code from clients if it isn't available on
 
300
      the server. On the client: whether Pyro should automatically download Python code from the server if it returns
 
301
      objects that aren't available on the client.</td>
 
302
 
 
303
      <td>0</td>
 
304
    </tr>
 
305
 
 
306
    <tr>
 
307
      <td><code>PYRO_DNS_URI</code></td>
 
308
 
 
309
      <td>boolean</td>
 
310
 
 
311
      <td>Whether symbolic DNS host names should be used in URIs instead of fixed IP addresses.</td>
 
312
 
 
313
      <td>0</td>
 
314
    </tr>
 
315
 
 
316
    <tr>
 
317
      <td><code>PYRO_BC_RETRIES</code></td>
 
318
 
 
319
      <td>number</td>
 
320
 
 
321
      <td>How often a broadcast will be retried if no answer has been received. Currently only used by the Name Server
 
322
      locator. A negative number (&lt;0) means infinitely. </td>
 
323
 
 
324
      <td>2</td>
 
325
    </tr>
 
326
 
 
327
    <tr>
 
328
      <td><code>PYRO_BC_TIMEOUT</code></td>
 
329
 
 
330
      <td>number</td>
 
331
 
 
332
      <td>How long Pyro will wait (in seconds) for an answer to a broadcast request. Currently only used by the Name
 
333
      Server locator. A negative number (&lt;0) means infinitely.</td>
 
334
 
 
335
      <td>2</td>
 
336
    </tr>
 
337
 
 
338
    <tr>
 
339
      <td><code>PYRO_PORT</code></td>
 
340
 
 
341
      <td>number</td>
 
342
 
 
343
      <td>The base socket number of the range of socket numbers that the Pyro daemon can use to listen for incoming
 
344
      requests (Pyro method calls). Set to 0 to let the operating system choose a random port.</td>
 
345
 
 
346
      <td>7766</td>
 
347
    </tr>
 
348
 
 
349
    <tr>
 
350
      <td><code>PYRO_PORT_RANGE</code></td>
 
351
 
 
352
      <td>number</td>
 
353
 
 
354
      <td>The size of the socket port range. Pyro will try to claim a socket for its Deamons in the socket port range
 
355
      PYRO_PORT to (but not including) PYRO_PORT+PYRO_PORT_RANGE. This means that if Pyro already has a Daemon listning
 
356
      on socket N, a new Deamon will claim socket N+1, and so on. You can disable this by using a special argument when
 
357
      construction a Daemon (or setting this item to 1).</td>
 
358
 
 
359
      <td>100</td>
 
360
    </tr>
 
361
 
 
362
    <tr>
 
363
      <td><code>PYRO_HOST</code></td>
 
364
 
 
365
      <td>string</td>
 
366
 
 
367
      <td>The hostname Pyro's daemon will bind on. Useful when your machine has multiple hostnames/network adapters
 
368
        on which it can listen. (Also influences NameServer.)</td>
 
369
 
 
370
      <td>'' <em>(default host)</em></td>
 
371
    </tr>
 
372
 
 
373
    <tr>
 
374
      <td><code>PYRO_PUBLISHHOST</code></td>
 
375
 
 
376
      <td>string</td>
 
377
 
 
378
      <td>the hostname that Pyro daemons will use when publishing URIs. Useful in case of a firewall/NAT setup.
 
379
        See the Features chapter for firewall info. </td>
 
380
 
 
381
      <td>None <em>(same as normal hostname)</em></td>
 
382
    </tr>
 
383
 
 
384
    <tr>
 
385
      <td><code>PYRO_NS_DEFAULTGROUP</code></td>
 
386
 
 
387
      <td>string</td>
 
388
 
 
389
      <td>The default group name in which names are located. <em>This must be an absolute name (starting with the root
 
390
      character).</em></td>
 
391
 
 
392
      <td><code>:Default</code></td>
 
393
    </tr>
 
394
 
 
395
    <tr>
 
396
      <td><code>PYRO_NS_URIFILE</code></td>
 
397
 
 
398
      <td>string</td>
 
399
 
 
400
      <td>The file where the Name Server will write its URI. If it's not an absolute path, it's relative to
 
401
      <code>$PYRO_STORAGE</code>.</td>
 
402
 
 
403
      <td><code>Pyro_NS_URI</code></td>
 
404
    </tr>
 
405
 
 
406
    <tr>
 
407
      <td><code>PYRO_NS_HOSTNAME</code></td>
 
408
 
 
409
      <td>string</td>
 
410
 
 
411
      <td>The hostname that is initially tried to find the NameServer on, or when the broadcast lookup mechanism fails.</td>
 
412
 
 
413
      <td><i>empty</i></td>
 
414
    </tr>
 
415
 
 
416
    <tr>
 
417
      <td><code>PYRO_NS_PORT</code></td>
 
418
 
 
419
      <td>number</td>
 
420
 
 
421
      <td>The socket number on which the Name Server will listen for incoming requests (Pyro method calls, in
 
422
      fact). Set to 0 to let the operating system choose a random port. Note that if you set this to 0, a client cannot use 
 
423
      this config item to directly connect to the NS. It will have to use the broadcast lookup.</td>
 
424
      <td>9090</td>
 
425
    </tr>
 
426
 
 
427
    <tr>
 
428
      <td><code>PYRO_NS_BC_ADDR</code></td>
 
429
      <td>string</td>
 
430
      <td>Overrides the default broadcast address. It is used by the nameserver to bind the broadcast
 
431
        listener on this broadcast address, and by the name server locator when it uses broadcast discovery.
 
432
        When empty, the default broadcast address is used (usually 255.255.255.255).</td>
 
433
      <td><i>empty</i></td>
 
434
    </tr>
 
435
 
 
436
    <tr>
 
437
      <td><code>PYRO_NS_BC_PORT</code></td>
 
438
      <td>number</td>
 
439
      <td>The socket number on which the Name Server will listen for broadcast requests (usually to find the
 
440
      location).</td>
 
441
      <td>9090</td>
 
442
    </tr>
 
443
 
 
444
    <tr>
 
445
      <td><code>PYRO_NS2_HOSTNAME</code></td>
 
446
 
 
447
      <td>string</td>
 
448
 
 
449
      <td>Like above, but for the second (paired) Name Server.</td>
 
450
 
 
451
      <td><i>empty</i></td>
 
452
    </tr>
 
453
 
 
454
    <tr>
 
455
      <td><code>PYRO_NS2_PORT</code></td>
 
456
 
 
457
      <td>number</td>
 
458
 
 
459
      <td>Like above, but for the second (paired) Name Server.</td>
 
460
 
 
461
      <td>9091</td>
 
462
    </tr>
 
463
 
 
464
    <tr>
 
465
      <td><code>PYRO_NS2_BC_ADDR</code></td>
 
466
      <td>string</td>
 
467
      <td>Like above, but for the second (paired) Name Server.</td>
 
468
      <td><i>empty</i></td>
 
469
    </tr>
 
470
 
 
471
    <tr>
 
472
      <td><code>PYRO_NS2_BC_PORT</code></td>
 
473
 
 
474
      <td>number</td>
 
475
 
 
476
      <td>Like above, but for the second (paired) Name Server.</td>
 
477
 
 
478
      <td>9091</td>
 
479
    </tr>
 
480
 
 
481
    <tr>
 
482
      <td><code>PYRO_ES_QUEUESIZE</code></td>
 
483
 
 
484
      <td>number</td>
 
485
 
 
486
      <td>The size of the message queues per subscriber that the Event Server allocates. Use 0 (zero) for infinite
 
487
      size.</td>
 
488
 
 
489
      <td>1000</td>
 
490
    </tr>
 
491
 
 
492
    <tr>
 
493
      <td><code>PYRO_ES_BLOCKQUEUE</code></td>
 
494
 
 
495
      <td>boolean</td>
 
496
 
 
497
      <td>If true (1), a publisher will block if an event queue on the server is full, and continue as soon as the
 
498
      queue has some space again. If false (0), the publisher won't block, but <em>the event is lost</em>
 
499
      (but only for the subscriber who has a full queue).</td>
 
500
 
 
501
      <td>1</td>
 
502
    </tr>
 
503
    
 
504
    <tr>
 
505
      <td><code>PYRO_ONEWAY_THREADED</code></td>
 
506
 
 
507
      <td>boolean</td>
 
508
 
 
509
      <td>If true (1), oneway method calls will execute in a new server thread. 
 
510
        This allows for the server to continue to process other method calls on this object in the meantime.
 
511
        If false (0), oneway method calls will execute in the main server thread and need to complete before
 
512
        the server can process other calls on that object.</td>
 
513
      <td>1</td>
 
514
    </tr>
 
515
 
 
516
    <tr>
 
517
      <td><code>PYROSSL_CERTDIR</code></td>
 
518
 
 
519
      <td>string</td>
 
520
 
 
521
      <td>The directory where openssl certificates are stored.</td>
 
522
 
 
523
      <td>'certs' in the PYRO_STORAGE location.</td>
 
524
    </tr>
 
525
 
 
526
    <tr>
 
527
      <td><code>PYROSSL_CA_CERT</code></td>
 
528
 
 
529
      <td>string</td>
 
530
 
 
531
      <td>Certificate of the Certificate Authority. Used to check if client and server certificates are valid (that
 
532
      they are signed by the given CA)</td>
 
533
 
 
534
      <td>ca.pem</td>
 
535
    </tr>
 
536
 
 
537
    <tr>
 
538
      <td><code>PYROSSL_SERVER_CERT</code></td>
 
539
 
 
540
      <td>string</td>
 
541
 
 
542
      <td>Certificate for server side</td>
 
543
 
 
544
      <td>server.pem</td>
 
545
    </tr>
 
546
 
 
547
    <tr>
 
548
      <td><code>PYROSSL_CLIENT_CERT</code></td>
 
549
 
 
550
      <td>string</td>
 
551
 
 
552
      <td>Certificate for client side</td>
 
553
 
 
554
      <td>client.pem</td>
 
555
    </tr>
 
556
    <tr>
 
557
      <td><code>PYROSSL_POSTCONNCHECK</code></td>
 
558
 
 
559
      <td>boolean</td>
 
560
 
 
561
      <td>Tells the SSL layer if it should do 'post-connection' validations on the certificate(s) for instance.
 
562
        Set it to 0 to disable these checks (not advised! But convenient to be able to use a
 
563
        certificate that hasn't got a matching commonName or stuff like that) Default is 1: 
 
564
        the SSL layer will do its checks as enabled by its own default settings.</td>
 
565
      <td>1</td>
 
566
    </tr>
 
567
 
 
568
  </table>
 
569
 
 
570
  <p>There are several ways to change the default settings:</p>
 
571
 
 
572
  <ol>
 
573
    <li>Change the settings in your code, at runtime. You can change all settings before starting Pyro, and most
 
574
    settings can be changed dynamically during execution too. <em>Note that you cannot use this to change
 
575
    <code>Pyro.config.PYRO_STORAGE</code>! See below!</em><br>
 
576
    ... <code>Pyro.config.PYRO_PORT = 7000</code><br>
 
577
    ... <code>Pyro.config.PYRO_TRACELEVEL = 3</code></li>
 
578
 
 
579
    <li>Define environment variables that override the default settings.<br>
 
580
    Every configuration item has an equivalent environment variable. If you define this, you can override the default
 
581
    setting for that item. For instance, it might be convenient to have your Pyro programs generate log files and put
 
582
    them in a designated log directory:<br>
 
583
    ...<code>$ export PYRO_LOGFILE=/var/log/PYRO/logfile</code><br>
 
584
    ...<code>$ export PYRO_TRACELEVEL=3</code><br>
 
585
    (This is for bash - syntax is different for other shells or Windows.)</li>
 
586
 
 
587
    <li>Configuration files<br>
 
588
      You can use a configuration file that can contain some small configuration changes or a fully new configuration
 
589
      for all items. Pyro checks if the environment variable <code>PYRO_CONFIG_FILE</code> is set. If it isn't set, or
 
590
      set to an empty string, Pyro checks for a <code>Pyro.conf</code> file in the current directory. If it exists,
 
591
      Pyro uses it as a configuration file. If it doesn't exist, Pyro uses the default built-in configuration.<br>
 
592
      If the environment variable is set, Pyro uses the value as the name for the configuration file. If the
 
593
      configuration file can't be read, a PyroError exception occurs.
 
594
 
 
595
      <p>The format of the configuration file is very simple. It is a text file, and each line can be empty, a comment,
 
596
      or a configuration item setting. A comment starts with '#'. A config item setting is of the format 'ITEM=VALUE'.
 
597
      If Pyro finds an unknown config item, a KeyError exception occurs.</p>
 
598
 
 
599
      <p>Note that <code>PYRO_CONFIG_FILE</code> is useless inside a configuration file. After initialization, it is
 
600
      set to the absolute path of the configuration file that was used (or the empty string, if no configuration file
 
601
      was used). Note that setting <code>PYRO_CONFIG_FILE</code> from within your code is useless too because Pyro is
 
602
      already initialized at that point.</p>
 
603
    </li>
 
604
  </ol>Environment variables override configuration file settings. Configuration file settings override the built-in
 
605
  default settings.
 
606
 
 
607
  <p><code>PYRO_STORAGE</code> is used at initialization time, that is, as soon as a part of the Pyro package is
 
608
  imported in your program. You can only change <code>PYRO_STORAGE</code> <em>beforehand</em> by either setting the
 
609
  environment variable or making an entry in the configuration file. Changing <code>Pyro.config.PYRO_STORAGE</code> in
 
610
  your program leads to unexpected results, because the initilization has already been done using the old value. So
 
611
  don't do this, and use one of the two other ways.</p>
 
612
<div class="nav">
 
613
<hr>
 
614
  <table width="100%">
 
615
    <tr>
 
616
      <td align="left"><a href="2-concepts.html">&lt;previous</a> | <a href="PyroManual.html">contents</a> | <a href=
 
617
      "4-usage.html">next&gt;</a></td>
 
618
 
 
619
      <td align="right">Pyro Manual</td>
 
620
    </tr>
 
621
  </table></div>
 
622
</body>
 
623
</html>