-
Notifications
You must be signed in to change notification settings - Fork 0
/
icconfig.sdf
2884 lines (1949 loc) · 104 KB
/
icconfig.sdf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
!init OPT_LOOK="icdevgroup"; OPT_STYLE="manual"
# $Id: icconfig.sdf,v 1.82 2004-05-05 15:22:30 jon Exp $
!define DOC_NAME "Configuration Reference"
!define DOC_TYPE ""
!define DOC_CODE "icconfig"
!define DOC_VERSION substr('$Revision: 1.82 $',11, -2)
!define DOC_STATUS "Draft"
!define DOC_PROJECT "Interchange"
!define DOC_URL "http://www.icdevgroup.org/doc/icconfig.html"
!build_title
H1: Interchange Configuration Files
This is an alphabetical reference to the configuration directives used in Interchange global and catalog configuration files.
Interchange has multiple catalog capability, and therefore splits its configuration into two pieces. One is global, C<interchange.cfg>, and affects every catalog running under it. The other, C<catalog.cfg> is specific to an individual catalog, and has no effect on other catalogs.
H2: Directive syntax
Configuration directives are normally specified with the directive as the first word on the line, with its value or values following. Capitalization of the directive name is not significant. Leading and trailing whitespace is stripped from the line.
LI1: Including files in directives
Additional files may be called with an include file notation like this:
!block example;
DirectiveName <includefile
!endblock
Files included from interchange.cfg are relative to the Interchange software directory. Files included from catalog.cfg are relative to the catalog directory.
LI1: Here documents
A "here document" can be used to spread directive values over several lines, with the usual Perl <<MARKER syntax. No semicolon is used to terminate the marker. The closing marker must be the only thing on the line. No leading or trailing characters are allowed, not even whitespace. Here is a hypothetical directive using a here document:
!block example; listitem=2
DirectiveName <<EOD
setting1
setting2
setting3
EOD
!endblock
That is equivalent to:
!block example; listitem=2
DirectiveName setting1 setting2 setting3
!endblock
LI1: Include single setting from file
.Value can be pulled from a file with <file:
!block example; listitem=2
Variable MYSTUFF <file
!endblock
.This works well for includes that must be of the highest possible performance. They can be simply placed in a page with __VARIABLE__.
LI1: include
.Other configuration files can be included in the current one. For example, common settings can be set in one file:
!block example; listitem=2
include common.cfg
!endblock
.Or all files in one directory:
!block example; listitem=2
include usertag/*
!endblock
LI1: ifdef and ifndef
.ifdef/endif and ifndef/endif pairs can be used:
!block example; listitem=2
Variable ORDERS_TO email_address
ifdef ORDERS_TO
ParseVariables Yes
MailOrderTo __ORDERS_TO__
ParseVariables No
endif
ifdef ORDERS_TO =~ /foo.com/
# Send all orders at foo.com to one place now
# Set ORDERS_TO to stop default setting
Variable ORDERS_TO 1
MailOrderTo [email protected]
endif
ifdef ORDERS_TO eq '[email protected]'
# Better change to something else, set ORDERS_TO to stop default
Variable ORDERS_TO 1
MailOrderTo [email protected]
endif
ifndef ORDERS_TO
#Needs to go somewhere....
MailOrderTo webmaster@localhost
endif
!endblock
H1: interchange.cfg
The VendRoot directory, specified in the main program C<interchange>, is the default location of all of the Interchange program, configuration, special, and library files. Unless changed in the call to C<interchange>, the main Interchange server configuration file will be C<interchange.cfg> in the VendRoot directory.
The directives defined in C<interchange.cfg> affect the entire Interchange server and all catalogs running under it. Multiple Interchange servers may be run on the same machine with totally independent operation.
Following is an alphabetical listing of all global configuration directives.
H2: AcceptRedirect *global*
Enables processing of HTTP server redirects, i.e. when handling ErrorDocument
for Apache. For instance, if you have in Apache httpd.conf:
!block example
## Setting in httpd.conf
ErrorDocument 404 /cgi-bin/foundation
!endblock
At that point, a request for /somedir/index.html that is not found will be
equivalent to /cgi-bin/foundation/somedir/index.html and will be
indistinguishable from the Apache-served page by the client.
!block example
AcceptRedirect Yes
!endblock
A Yes/No directive, default C<No>.
Caution should be taken not to enable the ErrorDocument to redirect to
Interchange globally -- it would render you subject to a
denial-of-service attack at random URLs, i.e. a flood of MS Windows
"Code Red" attacks. It is recommended that you enable it only for
specific directories, as Apache or another HTTP server will stand up
much better under such a flood.
H2: ActionMap *global*
Allows setting of Interchange form actions, usually with a Perl subroutine.
Actions are page names like:
!block example
process Perform a processing function
order Order items
scan Search based on path info
search Search based on submitted form variables
!endblock
The global version of ActionMap applies to all catalogs. If the same
action is specified in C<catalog.cfg>, it will pertain. See C<ActionMap>
in that section.
H2: AddDirective *global*
Adds a configuration directive that will be parsed for every C<catalog.cfg> file. Accepts three parameters: the name of the directive, the name of the parser (if any), and the default value (if any). The following definition would add a directive "Foo," with parser "parse_bar," and a default value of "Hello, world!":
!block example
AddDirective Foo bar "Hello, world!"
!endblock
If the parser is not defined, the directive value will be scalar and the same as what the user passes in the config file. If defined, the parser must be extant before it can be referenced, is always resident in Vend::Config, and begins with the string C<parse_>.
H2: AllowGlobal *global*
Specifies catalog identifiers that may define subroutines and UserTag entries
that can operate with the full permissions of the server. {{B:Don't use this
unless the catalog user is trusted implicitly.}} Default is blank.
!block example
AllowGlobal simple
!endblock
Using AllowGlobal is never necessary, and is always dangerous in a multi-user
environment. Its use is not recommended.
H2: AutoVariable *global*
Specifies directives which should be translated to Variable settings. For
scalars, the directive name becomes the Variable name and yields its value,
i.e. C<ErrorFile> becomes C<__>C<ErrorFile__>, which would by
default be C<error.log>. Array variables have a C<_N> added, where C<_N> is
the ordinal index, i.e. C<SafeUntrap> becomes C<__>C<SafeUntrap_0__>,
C<__>C<SafeUntrap_1__>, etc. Hash variables have a _KEY added, i.e.
C<SysLog> becomes C<__>C<SysLog_command__>,
C<__>C<SysLog_facility__>, etc. Doesn't handle hash keys that have non-word
characters or whitespace. Only single-level arrays and hashes are translated
properly.
See C<AutoVariable> in C<catalog.cfg>.
H2: Capability *global*
Just like Require or Suggest, but can never cause a warning or message. This
allows a module to be loaded if available and for a program to check for
that capability later and adapt itself to the configuration.
!block example
Capability module Archive::Zip
!endblock
H2: Catalog *global*
Specifies a catalog that can run using this Interchange server. This directive
is usually inserted into C<interchange.cfg> by the makecat program when you
build a new catalog.
There are three required parameters, as shown in this example:
!block example
Catalog simple /home/interchange/simple /cgi-bin/simple
!endblock
The first is the name of the catalog. It will be referred to by that name in error, warning, and informational messages. It must contain only alphanumeric characters, hyphens, and underscores. It is highly recommended that it be all lower case.
The second is the base directory of the catalog. If the directory does not contain a C<catalog.cfg> file, the server will report an error and refuse to start.
The third is the C<SCRIPT_NAME> of the link program that runs the catalog. This is how the catalog is selected for operation. Any number of alias script names may be specified as additional parameters. This allows the calling path to be different while still calling the same catalog:
!block example
Catalog simple /home/interchange/simple /cgi-bin/simple /simple
!endblock
This is useful when calling an SSL server or a members-only alias that requires a username/password via HTTP Basic authorization. All branched links will be called using the aliased URL.
The script names must be unique among CGI program paths that run on this server; the same name cannot be used for more than one catalog unless the C<FullURL> directive is specified. In this case, the parameter may be specified as:
!block example; listitem=2
www.yourcompany.com/cgi-bin/simple
www.theirs.com/cgi-bin/simple
!endblock
Each of those 'simple' catalogs would then call a different catalog.
Optionally, individual C<Catalog> directives that specify each of the different parameters may be used. The equivalent of our original example directive above is:
!block example
Catalog simple directory /home/interchange/simple
Catalog simple script /cgi-bin/simple
Catalog simple alias /simple
!endblock
Global directives may be specified that will change for that catalog only. This is mostly useful for C<ErrorFile> and C<DisplayErrors>:
!block example
Catalog simple directive ErrorFile /var/log/interchange/simple_error.log
!endblock
H2: CheckHTML *global*
Set to the name of an external program that will check the user's HTML when they set C<[flag checkhtml]> or C<[tag flag checkhtml][/tag]> in their page.
!block example
CheckHTML /usr/local/bin/weblint
!endblock
H2: CodeDef *global*
A generic subroutine mapper that allows mapping of a subroutine as a
{{CMD[jump="icconfig.html#ActionMap *global*"]ActionMap}},
CoreTag,
{{CMD[jump="icconfig.html#Filter"]Filter}},
{{CMD[jump="icconfig.html#FormAction *global*"]FormAction}},
{{CMD[jump="icconfig.html#GlobalSub *global*"]GlobalSub}},
{{CMD[jump="icconfig.html#ItemAction"]ItemAction}},
LocaleChange,
OrderCheck,
{{CMD[jump="icconfig.html#UserTag *global*"]UserTag}},
Widget.
H2: ConfigAllAfter *global*
The name of a file (or files) which should be read as a part of every catalog's configuration, after any other configuration files are read. Default is C<catalog_after.cfg>.
!block example
ConfigAllAfter check_actions.cfg check_variables.cfg
!endblock
H2: ConfigAllBefore *global*
The name of a file (or files) which should be read as a part of every catalog's configuration, before any other configuration files are read. Default is C<catalog_before.cfg>.
!block example
ConfigAllBefore set_actions.cfg set_variables.cfg
!endblock
H2: ConfigParseComments *global*
Set to No if you want old-style '#include', '#ifdef', or '#ifndef' to be treated as the comments they appear to be. The default is Yes, which means both '#include' and 'include' do the same thing. (Use a space after the '#' if you really want to comment out the command.)
Interchange prior to version 4.7 used a different syntax for meta-directives 'include', 'ifdef', and 'ifndef' in configuration files. The commands were borrowed from the C preprocessor, and true to their C heritage, they started with '#': '#include', '#ifdef', '#ifndef'. Interchange configuration files, unlike C, uses '#' to begin one-line comments, which meant that a newcomer at first glance might assume that:
!block example
#Variable DEBUG 1
#include more.cfg
!endblock
were both comments, when in fact the second was a live #include command.
To begin to make things more consistent, Interchange 4.7 and up now recognize those meta-directives without the leading '#', and the included demo catalog sets this directive to No so that lines beginning with '#' really are skipped as comments, regardless of what comes after.
H2: Database *global*
Defines a database which is global and available to all catalogs. Writing can
be controlled by catalog. See C<Database>.
H2: DataTrace *global*
Set DBI to trace at the level specified. Valid values are:
0 - Trace disabled.
1 - Trace DBI method calls returning with results or errors.
2 - Trace method entry with parameters and returning with results.
3 - As above, adding some high-level information from the driver
and some internal information from the DBI.
4 - As above, adding more detailed information from the driver.
Also includes DBI mutex information when using threaded Perl.
5 and above - As above but with more and more obscure information.
Trace level 1 is best for most Interchange debug situations. Trace will only be enabled when C<DebugFile> is specified, as that file is the target for the trace. Example:
E: DataTrace 1
Default is 0. Directive added in 4.7.0.
H2: DebugFile *global*
Names a file, relative to the Interchange root directory, which should store
the output of C<logDebug> statements, and warnings if warnings are enabled.
!block example
DebugFile /tmp/icdebug
!endblock
H2: DeleteDirective *global*
Deletes a configuration directive from the list is parsed for every
C<catalog.cfg> file. Can save memory for installations with large numbers
of catalogs.
!block example
DeleteDirective DescriptionField OfflineDir
!endblock
The directive is not case-sensitive. Has no effect on global directives.
H2: DisplayErrors *global*
While all errors are reported in the error log file, errors can also be displayed by the browser. This is convenient while testing a configuration. Unless this is set, the C<DisplayErrors> setting in the user catalogs will have no effect. Default is No.
!block example
DisplayErrors Yes
!endblock
Note: This changes the value of $SIG{__DIE__} and may have other effects
on program operation. This should NEVER be used for normal operation.
H2: DomainTail *global*
Implements the domain/IP session qualifiers so that only the major domain is used to qualify the session ID. This is a compromise on security, but it allows non-cookie-accepting browsers to use multiple proxy servers in the same domain. Default is Yes.
!block example
DomainTail No
!endblock
If encrypting credit cards with PGP or GPG, or are using a payment service like CyberCash, look at the C<WideOpen> directive, which enables more browser compatibility at the cost of some security.
H2: DumpStructure *global*
Tells Interchange to dump the structure of catalogs and the Interchange server
to a file with the catalog name and the extension C<.structure>. Use this to see how directives have been set.
H2: EncryptProgram *global*
Specifies the default encryption program that should be used to encrypt
credit card numbers and other sensitive information. Default is C<gpg>
if found on the system; then C<pgpe>, if found; then C<pgp>, and finally
C<none>, disabling encryption.
This is used to set the default in C<catalog.cfg>, which has its own independent
setting of C<EncryptProgram>.
H2: Environment *global*
Environment variables to inherit from the calling CGI link program. An example might be PGPPATH, used to set the directory which PGP will use to find its key ring.
!block example
Environment MOD_PERL REMOTE_USER PGPPATH
!endblock
H2: ErrorFile *global*
Sets the name of the global error log. The default is C<error.log> in the
Interchange software directory.
!block example
ErrorFile /var/log/interchange/log
!endblock
Of course, the user ID running the Interchange server must have permission to
write that file.
Optionally, syslog error logging can be set up as well. See C<SysLog>.
H2: FormAction *global*
Allows a form action (like the standard ones C<return, submit, refresh,> etc.) to be set up. It requires a Perl subroutine as a target:
!block example
FormAction foo <<EOR
sub {
$CGI->{mv_nextpage} = 'bar';
}
EOR
!endblock
If it returns a true (non-zero, non-empty) value, Interchange will display
the page defined in $CGI->{mv_nextpage}. Otherwise, Interchange will
not display any page. The default Interchange actions can be overridden,
if desired. There is also a catalog-specific version of this directive,
which overrides any action of the same name.
The global version affects all catalogs -- there is also a
catalog-specific version of FormAction which is protected by Safe.
H2: FullUrl *global*
Normally Interchange determines which catalog to call by determining the
SCRIPT_NAME from the CGI call. This means that different (and maybe virtual)
hosts cannot use the same SCRIPT_NAME to call different catalogs. Set
C<FullUrl> to Yes to differentiate based on the calling host. Then, set the
server name in the Catalog directive accordingly, such as
C<yourdomain.com/cgi-bin/simple>. A yes/no directive, the default is No.
!block example
FullUrl Yes
!endblock
If it is set in this fashion, C<all> catalogs must be defined in this fashion. NOTE: The individual catalog setting will not work, as this is used before the catalog name is known.
H2: GlobalSub *global*
Defines a C<global> subroutine for use by the C<[perl sub] subname arg /perl]>
construct. Use the "here document" capability of Interchange configuration
files to make it easy to define:
!block example
GlobalSub <<EOF
sub count_orders {
my $counter = new File::CounterFile "/tmp/count_orders", '1';
my $number = $counter->inc();
return "There have been $number orders placed.\n";
}
EOF
!endblock
As with Perl "here documents," the EOF (or other end marker) must be the ONLY thing on the line, with no leading or trailing white space. Do not append a semicolon to the marker. (The above marker appears indented. It should not be that way in the file!)
IMPORTANT NOTE: These global subroutines are not subject to security checks. They can do most anything! For most purposes, scratch subroutines or catalog subroutines (also Sub) are better.
C<GlobalSub> routines are subject to full Perl use strict checking, so errors are possible if lexical variables or complete package qualifications are not used for the variables.
H2: HammerLock *global*
The number of seconds after which a locked session could be considered to be
lost due to malfunction. This will kill the lock on the session. Only here for
monitoring of session hand-off. If this error shows up in the error log, the
system setup should be examined. Default is 30.
!block example
HammerLock 60
!endblock
This mostly doesn't apply to Interchange when using the default file-based
sessions.
H2: HitCount *global*
Increments a counter in C<ConfDir> for every access to the catalog. The
file is named C<hits.catalogname>, where C<catalogname> is the short
catalog identifier. A Yes/No directive, default is C<No>.
!block example
HitCount Yes
!endblock
H2: HouseKeeping *global*
How often, in seconds, the Interchange server will "wake up" and look for user
reconfiguration requests and hung search processes. On some systems, this
wakeup is the only time the server will terminate in response to a stop
command. Default is 60.
!block example
HouseKeeping 5
!endblock
H2: Inet_Mode *global*
Determines whether INET-domain sockets will be monitored on startup.
Overridden by the command-line parameter C<-i>. Default is C<Yes>.
H2: IpHead *global*
Implements the domain/IP session qualifiers so that only the first C<IpQuad>
dot-quads of the IP address are used to qualify the session ID. The default is
1. This is a slight compromise on security, but it allows non-cookie-accepting
browsers, like AOL's V2.0, to use multiple proxy servers.
C<DomainTail> is preferable unless one of your HTTP servers does not do host
name lookups. Default is C<No>, and DomainTail must be set to C<No> for it to
operate.
!block example
IpHead Yes
!endblock
H2: IpQuad *global*
The number of dot-quads that IpHead will look at. Default is 1.
!block example
IpQuad 2
!endblock
H2: Locale *global*
Sets the global C<Locale> for use in error messages. Normally set from a
file's contents, as in the example before:
!block example
Locale <locale.error
!endblock
H2: LockoutCommand *global*
The name of a command (as it would be entered from the shell) that will lock out the host IP of an offending system. The IP address will be substituted for the first occurrence of the string %s. This will be executed with the user ID that Interchange runs under, so any commands that require root access will have to be wrapped with an SUID program.
On Linux, a host may be locked out with:
!block example
ipfwadm -I -i deny -S %s
!endblock
This would require root permissions, however, under normal circumstances. Use C<sudo> or another method to wrap and allow the command.
A script can be written which modifies an appropriate access control file, such as .htaccess for your CGI directory, to do another level of lockout. A simple command line containing C<perl -0777 -npi -e 's/deny/deny from %s\ndeny/' /home/me/cgi-bin/.htaccess> would work as well (remember, the %s will become the IP address of the offending user).
!block example
LockoutCommand lockout %s
!endblock
H2: LockType *global*
Allows selection of file locking method used throughout Interchange. Options are 'flock', 'fcntl', and 'none'. Added in 4.7.0. Please note that due to a bug this directive only works in Interchange 4.8.6 and above.
Default is flock. See the flock(2) manpage for details.
The fcntl setting is needed for NFS filesystems; for NFS-based locking to work, the NFS lock daemon (lockd) must be enabled and running on both the NFS client and server. Locking with fcntl works on Linux and should work on Solaris, but is not guaranteed to work on all OSes.
The none setting turns off file locking entirely, but that is never recommended. It might be useful to check if locking is causing hangs on the system.
If you are only accessing sessions on an NFS-mounted directory but the rest of Interchange is on the local filesystem, you can instead set the SessionType catalog directive to 'NFS', which enables fcntl locking for sessions only on a per-catalog basis.
H2: Mall *global*
Set to C<Yes> to issue cookies only for the current catalog's script. By
default, when Interchange issues a cookie it does so for the base
domain. This will allow multiple catalogs to operate on the same domain
without interfering with each others session ID.
A yes/no directive.
!block example
Mall Yes
!endblock
H2: MaxRequestsPerChild *global*
The maximum number of requests a page server will handle before it commits
suicide and asks for a replacement server. This prevents runaway memory leaks.
!block example
MaxRequestsPerChild 100
!endblock
Default is 50. Only applies in {{CMD[jump="icconfig.html#PreFork *global*"]PreFork}} mode.
H2: MaxServers *global*
The maximum number of servers that will be spawned to handle page
requests. If more than MaxServers requests are pending, they will be
queued (within the defined capability of the operating system, usually
five pending requests) until the number of active servers goes below
that value.
!block example
MaxServers 4
!endblock
Default is 10.
H2: NoAbsolute *global*
Whether Interchange C<[file ...]> and other tags can read any file
on the system (that is readable by the user id running the Interchange
daemon). The default is No, which allows any file to be read. This should
be changed in a multi-user environment to minimize security problems.
!block example
NoAbsolute Yes
!endblock
Note that this does not apply to tests for whether a file exists, as
with C<[if file ...]>. Such operations are allowed regardless of the
C<NoAbsolute> setting.
H2: PIDcheck *global*
If non-zero, enables a check of running Interchange processes during
the housekeeping routine. If a process has been running (or is hung)
for longer than PIDcheck seconds then a kill -9 will be issued and the
server count decremented. During the housekeeping routine, the number
of servers checked by C<MaxServers> will be recounted based on PID files.
Default is 0, disabling the check.
!block example
PIDcheck 300
!endblock
If you have long-running database builds, this needs to be disabled. Set it
to a high value (perhaps 600, for 10 minutes), or use the offline script.
H2: PIDfile *global*
The file which will contain the Interchange server process ID so that
it can be read to determine which process should be sent a signal for
stopping or reconfiguring the server.
!block example
PIDfile /var/run/interchange/interchange.pid
!endblock
This file must be writable by the Interchange server user ID.
H2: PreFork *global*
Causes Interchange to run in pre-forking server mode, where a number of
Interchange server daemons (defined in
{{CMD[jump="icconfig.html#StartServers *global*"]StartServers}}) will be
pre-spawned to handle page requests. Each server will handle the number
of requests defined in
{{CMD[jump="icconfig.html#MaxRequestsPerChild *global*"]MaxRequestsPerChild}}
before committing suicide and causing another server to pre-fork to replace it.
!block example
PreFork Yes
!endblock
This reduces system overhead due to forking and is the fastest and
best way to run a busy Interchange server.
settings that will apply for all catalogs.
A yes/no directive, default is C<No>.
H2: Profiles *global*
Names a file (or files) which contain C<OrderProfile> and C<SearchProfile>
settings that will apply for all catalogs.
!block example
Profiles etc/profiles.common
!endblock
H2: RobotIP *global*
The RobotIP directive defines a list of IP numbers which will be classed as
crawler robots (search engines) and causes Interchange to alter its
behavior to improve the chance of Interchange-served content being crawled
and listed.
The directive accepts a wildcard list - * represents any number of
characters, ? represents a single character. The elements of the list are
separated by a comma.
See {{CMD[jump="icconfig.html#RobotUA *global*"]RobotUA}} for a full description of the behavioural changes.
\Example:
!block example
RobotIP 209.135.65, 64.172.5
!endblock
H2: RobotUA *global*
The RobotUA directive defines a list of User Agents which will be classed as
crawler robots (search engines) and causes Interchange to alter its
behavior to improve the chance of Interchange-served content being crawled
and listed.
The directive accepts a wildcard list - * represents any number of
characters, ? represents a single character. The elements of the list are
separated by a comma.
If a User Agent is recognised as a robot, the following will be performed by Interchange:
=over 4
* C<mv_tmp_session> scratch variable is set to 1, causing sessions to be
disabled and therefore avoiding the writing of session data to disk.
* C<mv_no_session_id> scratch variable is set to 1, causing Interchange to
generate URLs without a session id (eg. C<mv_session_id=KvWna2PT>).
* C<mv_no_count> scratch variable is set to 1, causing Interchange to
generate URLs without an incremental number, normally used to prevent
proxy caching (eg. C<mv_pc=4>).
=back
It should be noted that once you have identified you are serving a page to a
robot, you should not use this to massively alter your page content in an
attempt to improve your ranking. If you do this, you stand the chance of
being blacklisted. You have been warned!
\Example:
!block example
RobotUA Inktomi, Scooter, *Robot*, *robot*, *Spider*, *spider*
!endblock
See also {{CMD[jump="icconfig.html#RobotIP *global*"]RobotIP}}.
H2: SafeUntrap *global*
Sets the codes that will be untrapped in the C<Safe.pm> module and used
for embedded Perl and conditional operations. View the Safe.pm
documentation by typing C<perldoc Safe> at the command prompt. The
default is C<ftfile sort>, which untraps the file existence test
operator and the sort operator. Define it as blank to prevent any
operators but the default restrictive ones.
!block example
SafeUntrap ftfile sort ftewrite rand
!endblock
H2: SendMailProgram *global*
Specifies the program used to send email. Defaults to '/usr/lib/sendmail'. If it is not found at startup, Interchange will return an error message and refuse to start.
!block example
SendMailProgram /bin/mailer
!endblock
A value of 'none' will disable the sending of emailed orders. Orders must be read from a tracking file, log, or by other means.
H2: SOAP *global*
If set to Yes, allows handling of SOAP rpc requests.
H2: SOAP_Host *global*
The list of hosts that are allowed to connect to for SOAP rpc requests. Default
is C<localhost 127.0.0.1>.
H2: SOAP_MaxRequests *global*
The maximum number of requests a SOAP rpc server will handle before it commits
suicide and asks for a replacement server. This prevents runaway memory leaks.
H2: SOAP_Perms *global*
The permissions that should be set on a SOAP UNIX-domain socket. Default is
C<0660>, which allows only programs running as the same UID as Interchange
to access the socket.
H2: SOAP_Socket *global*
A list of sockets which should be monitored for SOAP requests. If they
fit the form NNN.NNN.NNN.NNN:PPPP, they are IP addresses and ports for
monitoring INET-domain sockets, any other pattern is assumed to be a file
name for monitoring in the UNIX domain.
!block example
SOAP_Socket 12.23.13.31:7770 1.2.3.4:7770 /var/run/interchange/soap
!endblock
H2: SOAP_StartServers *global*
The number of SOAP servers which should be started to handle SOAP
requests. Default is 1.
!block example
SOAP_StartServers 10
!endblock
H2: SocketFile *global*
The name of the file which is used for UNIX-domain socket communications. Must
be in a directory where the Interchange user has write permission.
!block example
SocketFile /var/run/interchange/interchange.socket
!endblock
Default is C<etc/socket> or the value of the environment variable MINIVEND_SOCKET. If set, it will override the environment. It can be set on the command line as well:
!block example
bin/interchange -r SocketFile=/tmp/interchange.socket
!endblock
H2: SocketPerms *global*
The permissions (prepend a 0 to use octal notation) that should be used for the UNIX-domain socket. Temporarily set this to 666 on the command line to debug a permission problem on C<vlink>.
!block example
bin/interchange -r SocketPerms=0666
!endblock
H2: StartServers *global*
The number of Interchange page servers which should be started to handle
page requests when in {{CMD[jump="icconfig.html#PreFork *global*"]PreFork}} mode.
Default is 1.
!block example
StartServers 8
!endblock
H2: SubCatalog *global*
Allows definition of a catalog which shares most of the characteristics of
another catalog. Only the directives that are changed from the base catalog
are added. The parameters are: 1) the catalog ID, 2) the base catalog ID, 3) the directory to use (typically the same as the base catalog), and 4) the SCRIPT_NAME that will trigger the catalog. Any additional parameters are aliases for the SCRIPT_NAME.
The main reason that this would be used would be to conserve memory in a series of stores that share most of the same pages or databases.
!block example
SubCatalog sample2 sample /usr/catalogs/sample /cgi-bin/sample2
!endblock
H2: SysLog *global*
Set up syslog(8) error logging for Interchange.
!block example
SysLog command /usr/bin/logger
SysLog tag int1
SysLog alert local3.warn
SysLog warn local3.info
SysLog info local3.info
SysLog debug local3.debug
!endblock
This would cause global errors to be logged with the command:
!block example
/usr/bin/logger -t int1 -p local3.alert
!endblock
and cause system log entries something like:
!block example
Oct 26 17:30:11 bill int1: Config 'co' at server startup
Oct 26 17:30:11 bill int1: Config 'homefn' at server startup
Oct 26 17:30:11 bill int1: Config 'simple' at server startup
Oct 26 17:30:11 bill int1: Config 'test' at server startup
Oct 26 17:30:13 bill int1: START server (2345) (INET and UNIX)
!endblock
This would work in conjunction with a UNIX syslogd.conf entry of:
!block example
# Log local3 stuff to Interchange log
local3.* /var/log/interchange.log
!endblock
A custom wrapper can be created around it to get it to behave as desired. For instance, if you didn't want to use syslog but instead wanted to log to a database (via DBI), you could create a Perl script named "logdatabase" to log things:
!block example
#!/usr/bin/perl
my $script_name = "logdatabase";
use DBI;
use Getopt::Std;
getopts('d:p:T:k:')
or die "$script_name options: $@\n";
use vars qw/$opt_d $opt_p $opt_T $opt_k/;
my $dsn = $opt_d || $ENV{DBI_DSN};
my $template = $opt_T
|| "insert into log values ('~~KEY~~', '~~LEVEL~~', '~~MSG~~')";
my $dbh = DBI->connect($dsn)
or die "$script_name cannot connect to DBI: $DBI::errstr\n";
my %data;
$data{KEY} = $opt_k || '';
local ($/);
$data{MSG} = <>;
$data{LEVEL} = $opt_p || 'interchange.info';
$template =~ s/\~\~(\w+)\~\~/$dbh->quote($data{$1})/;
my $sth = $dbh->prepare($template)
or die "$script_name error executing query: $template\n";
$sth->execute()
or die "$script_name error executing query: $template\n";
exit;
!endblock
H2: TagDir *global*
Defines the directory or directories that Interchange will scan
for tag, filter, widget, and other code declarations.
!block example
TagDir code etc/other_code
!endblock
Relative to the Interchange software root. Default is C<code>.
H2: TagGroup *global*
Defines a group of tags for possible inclusion or exclusion in the set
of ITL tags Interchange will compile and use.
!block example
TagGroup :file "counter file include log value_extended"
EOF
!endblock
Default is defined in lib/Vend/Config.pm, and is too lengthy
to show here. Above is the default :file group.
H2: TagInclude *global*
Includes or excludes a set of IC tags for compilation and
use. The {{CMD[jump="#CodeDir"]TagDir}} is scanned for files,
and when found they are checked against tag names and the groups
defined in .{{CMD[jump="icconfig.html#TagGroup"]TagGroup}}.
!block example
TagInclude ALL !:crufty !get_url
!endblock
The above will include all tags by default, but not the group C<:crufty>
nor the tag C<get_url>.
Default is ALL.
H2: TcpHost *global*
When running in INET mode, using C<tlink>, specifies the hosts that are
allowed to send/receive transactions from any catalog on this Interchange
server. Can be either an name or IP number, and multiple hosts can be
specified in a space-separated list. Default is localhost.
!block example
TcpHost localhost secure.domain.com
!endblock
H2: TcpMap *global*
When running in INET mode, using C<tlink> or the internal HTTP server, specifies the port(s) which will be monitored by the Interchange server. Default is 7786.
To use the internal HTTP server (perhaps only for password-protected queries), a catalog may be mapped to a port. If three catalogs were running on the server C<www.akopia.com>, named C<simple>, C<sample>, and C<search>, the directive might look like this:
!block example
TcpMap 7786 - 7787 simple 7788 sample 7789 search
!endblock
Note: To map large numbers of ports, use the <<MARKER here document notation in interchange.cfg. With this in effect, the internal HTTP server would map the following addresses:
!block example
*:7786 mv_admin
*:7787 simple
*:7788 sample
*:7789 search
!endblock