File: icadvanced.8

package info (click to toggle)
interchange-doc 4.8.3-1
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 17,396 kB
  • ctags: 4,509
  • sloc: makefile: 46
file content (1424 lines) | stat: -rw-r--r-- 50,722 bytes parent folder | download
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
.\" Automatically generated by Pod::Man version 1.02
.\" Wed Nov 28 14:07:55 2001
.\"
.\" Standard preamble:
.\" ======================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R

.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used
.\" to do unbreakable dashes and therefore won't be available.  \*(C` and
.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` `
.    ds C' '
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr
.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
.\" index entries marked with X<> in POD.  Of course, you'll have to process
.\" the output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
.    .
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it
.\" makes way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.bd B 3
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ======================================================================
.\"
.IX Title "icadvanced 8"
.TH icadvanced 8 "Interchange 4.8.3" "2001-11-28" "Interchange"
.UC
.SH "NAME"
icadvanced \- Advanced Interchange Topics
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
.SH "Advanced Interchange Topics"
.IX Header "Advanced Interchange Topics"
.Ip "\(bu" 4
Maintaining production Interchange servers
.Ip "\(bu" 4
Interchange Administration Tool Development
.Ip "\(bu" 4
Making catalog skeletons for use with makecat
.Ip "\(bu" 4
Building custom link programs
.SH "Maintaining Interchange"
.IX Header "Maintaining Interchange"
Some utilities are supplied in the VendRoot/bin directory:
.PP
.Vb 6
\& compile_link Compiles an Interchange vlink or tlink CGI link
\& configdump   Dumps the configuration directives for a particular catalog
\& dump         Dumps the session file for a particular catalog
\& expire       Expires sessions for a particular catalog
\& expireall    Expires all catalogs
\& makecat      Make catalog
.Ve
Some example scripts for other functions are in the eg/ directory
of the software distribution.
.PP
Some thought should be given to where the databases, error logs, and
session files should be located, especially on an \s-1ISP\s0 that might have
multiple users sharing an Interchange server. In particular, put all
of the session files and logs in a directory that is not writable by
the user. This eliminates the possibility that the catalog may crash
if the directory or file is corrupted.
.PP
To test the format of user catalog configuration files before
restarting the server, set (from VendRoot):
.PP
.Vb 1
\&   bin/interchange -test
.Ve
This will check all configuration files for syntax errors, which might
otherwise prevent a catalog from booting. Once a catalog configures
properly, user reconfiguration will not crash it. It will just cause
an error. But, it must come up when the server is started.
.Sh "Starting, Stopping, and Re-starting the Servers"
.IX Subsection "Starting, Stopping, and Re-starting the Servers"
The following commands need to have \s-1VENDROOT\s0 changed to the main
directory where Interchange is installed. If the Interchange base
directory is /home/interchange/, the start command would be
/home/interchange/bin/interchange.
.PP
Do a perldoc VENDROOT/bin/interchange for full documentation.
.PP
To start the server with default settings:
.PP
.Vb 1
\&   VENDROOT/bin/interchange
.Ve
Assuming the server starts correctly, the names of catalogs as they
are configured will be displayed, along with a message stating the
process \s-1ID\s0 it is running under.
.PP
It is usually best to issue a restart instead. It doesn't hurt to do a
restart if you're actually starting the first time. And, if a server
is already running (from this \s-1VENDROOT\s0), a new start attempt will
fail. To restart the server:
.PP
.Vb 1
\&   VENDROOT/bin/interchange -restart
.Ve
The \-r option is the same as \-restart.
.PP
This is typically done to force Interchange to re-read its
configuration. A message will be displayed stating that a \s-1TERM\s0 signal
has been sent to the process \s-1ID\s0 the servers are running under. This
information is also sent to VENDROOT/error.log. Check the error.log
file for confirmation that the server has restarted properly.
.PP
To stop the server:
.PP
.Vb 1
\&   VENDROOT/bin/interchange -stop
.Ve
A message will be displayed stating that a \s-1TERM\s0 signal has been sent
to the process \s-1ID\s0 the server is running under. This information is
also sent to VENDROOT/error.log.
.PP
Because processes waiting for selection on some operating systems
block signals, they may have to wait for HouseKeeping seconds to stop.
The default is 60.
.PP
To terminate the Interchange server with prejudice, in the event it
will not stop:
.PP
.Vb 1
\&   VENDROOT/bin/interchange -kill
.Ve
.Sh "\s-1UNIX\s0 and \s-1INET\s0 modes"
.IX Subsection "UNIX and INET modes"
Both UNIX-domain and INET-domain sockets can be used for
communication. \s-1INET\s0 domain sockets are useful when more than one web
server, connected via a local-area network (\s-1LAN\s0), is used for
accessing an Interchange server.
.PP
\&\fBImportant note:\fR When sending sensitive information like credit card
numbers over a network, always ensure that the data is secured by a
firewall, or that the Interchange server runs on the same machine as
any SSL-based server used for encryption.
.PP
Use the \-i and \-u flags if you only want to use one
communication method:
.PP
.Vb 2
\&   # Start only in UNIX mode
\&   VENDROOT/bin/interchange -r -u
.Ve
.Vb 2
\&   # Start only in INET mode
\&   VENDROOT/bin/interchange -r -i
.Ve
.Sh "User Reconfiguration"
.IX Subsection "User Reconfiguration"
The individual catalogs can be reconfigured by the user by running the
[reconfig] support tag. This should be protected by one of the several
forms of Interchange authentication, preferably by \s-1HTTP\s0 basic
authorization. See RemoteUser.
.PP
The command line can be reconfigured (as the Interchange user) with:
.PP
.Vb 1
\&   VENDROOT/bin/interchange -reconfig <catalog>
.Ve
It is easy for the administrator to manually reconfigure a catalog.
Interchange simply looks for a file etc/reconfig (based in the
Interchange software directory) at HouseKeeping time. If it finds a
script name that matches one of the catalogs, it will reconfigure that
catalog.
.Sh "Expiring Sessions"
.IX Subsection "Expiring Sessions"
If Interchange is using \s-1DBM\s0 capability to store the sessions,
periodically expire old sessions to keep the session database file
from growing too large.
.PP
.Vb 1
\&   expire -c catalog
.Ve
There is also an expireall script which reads all catalog entries
in interchange.cfg and runs expire on them. The expire script
accepts a \-r option which tells it to recover lost disk space.
.PP
On a \s-1UNIX\s0 server, add a crontab entry such as the following:
.PP
.Vb 2
\&   # once a day at 4:40 am
\&   40 4 * * *    perl /home/interchange/bin/expireall -r
.Ve
Interchange will wait until the current transaction is finished before
expiring, so this can be done at any time without disabling web
access. Any search paging files for the affected session (kept in
ScratchDir) will be removed as well.
.PP
If not running \s-1DBM\s0 sessions, use a Perl script to delete all files not
modified in the last one or two days. The following will work if given
an argument of a session directory or session files:
.PP
.Vb 2
\&   #!perl
\&   # expire_sessions.pl -- delete files 2 days old or older
.Ve
.Vb 5
\&   my @files;
\&   my $dir;
\&   foreach $dir (@ARGV) {
\&       # just push files on the list
\&       if (-f $dir) { push @files, $_; next; }
.Ve
.Vb 1
\&       next unless -d $dir;
.Ve
.Vb 4
\&       # get all the file names in the directory
\&       opendir DIR, $dir or die "opendir $dir: $!\en";
\&       push @files, ( map { "$dir/$_" } grep(! /^\e.\e.?$/, readdir DIR) ) ;
\&   }
.Ve
.Vb 8
\&   for (@files) {
\&       unless (-f $_) {
\&           warn "skipping $_, not a file.\en";
\&           next;
\&       }
\&       next unless -M $_ >= 2;
\&       unlink $_ or die "unlink $_: $!\en";
\&   }
.Ve
It would be run with a command invocation like:
.PP
.Vb 1
\&   perl expire_sessions.pl /home/you/catalogs/simple/session
.Ve
Multiple directory names are acceptable, if there is more than one
catalog.
.PP
This script can be adjusted as necessary. Refinements might include
reading the file to \*(L"eval\*(R" the session reference and expire only
customers who are not members.
.Sh "My session files change to owner root every day!"
.IX Subsection "My session files change to owner root every day!"
You have the expireall \-r entry in the root crontab, and it should
either be in the Interchange user crontab or run as:
.PP
.Vb 1
\& 44 4 * * * su -c "/INTERCHANGE_ROOT/bin/expireall -r" INTERCHANGE_USERNAME
.Ve
.SH "Interchange Components"
.IX Header "Interchange Components"
Interchange components are merely portions of \s-1HTML/ITL\s0 that are
included into pages within the site depending on options set in the
Admin \s-1UI\s0. The default component set includes the following:
.PP
.Vb 14
\& best_horizontal
\&best_vertical
\&cart
\&cart_display
\&cart_tiny
\&category_vertical
\&cross_horizontal
\&cross_vertical
\&promo_horizontal
\&promo_vertical
\&random_horizontal
\&random_vertical
\&upsell_horizontal
\&upsell_vertical
.Ve
.Sh "Content \-> Page Edit"
.IX Subsection "Content -> Page Edit"
The Interchange Admin \s-1UI\s0 offers a page editor function that allows
component definitions and options to be modified for each page within
the catalog.
.PP
Template
.PP
The choices for the Template drop-down are read from template
definition files located in the CATROOT/template directory. These
files store the name and description of the template, as well as
components and options for the particular template.
.PP
To create a new template for use in the admin, it is best to copy an
existing template definition to a new file name and edit it's contents
to suit. Once the catalog is reconfigured, the new choice will be
visible within the Content Page Editor admin function.
.PP
Each template option is looped through and a scratch is set using its
same name and value.
.PP
\&\s-1ITL\s0 is used near the bottom of this file to set each option to default
values before the page is displayed.
.PP
.Vb 6
\& [set page_title][set]
\&[set page_banner][set]
\&[set members_only][set]
\&[set component_before][set]
\&[set component_after][set]
\&[set bgcolor]#FFFFFF[/set]
.Ve
Page Title
.PP
Sets the title of the page which is synonymous with the html
<title></title> code.
.PP
The following code within the template definition file is used to
display this option within in the content editor:
.PP
page_title: description: Page title
.PP
This code dynamically adds the title to the page:
.PP
<title>[scratch page_title]</title>
.PP
Page Banner
.PP
Sets a textual title for each page which is called by [either][scratch
page_banner][or][scratch page_title][/either] This results in the Page
Banner being displayed if defined. Otherwise, the Page Title is used.
.PP
Members Only
.PP
The members only function is handled by the following code within each
template file:
.PP
.Vb 7
\& [if scratch members_only]
\&    [set members_only][/set]
\&    [if !session logged_in]
\&    [set mv_successpage]@@MV_PAGE@@[/set]
\&    [bounce page=login]
\&    [/if]
\&[/if]
.Ve
This code says if members only is set to yes and the visitor is logged
in, display the page. Otherwise, redirect the visitor to the login
page.
.PP
Break 1
.PP
This code causes a separation in the Content Editor between the next
set of options. (A blue line)
.PP
Horizontal Before Component
.PP
This allows the inclusion of a defined component to be displayed
before, or above, the page's content. It is called with the following
code within the \s-1LEFTRIGHT_TOP\s0 template:
.PP
.Vb 4
\& [if scratch component_before]
\&[include file="templates/components/[scratch component_before]"]
\&[set component_before][/set]
\&[/if]
.Ve
Horizontal After Component
.PP
This function allows the inclusion of a defined component to be
displayed after or below the pages's content. It's called with the
following code within the \s-1LEFTRIGHT_BOTTOM\s0 template:
.PP
.Vb 4
\& [if scratch component_after]
\&[include file="templates/components/[scratch component_after]"]
\&[set component_after][/set]
\&[/if]
.Ve
Horizontal Item Width
.PP
This setting allows you to choose how many items the horizontal
components display. For example, the horizontal best sellers component
uses this setting to randomly select the best sellers. Notice the
default to 2 if nothing is defined.
.PP
.Vb 1
\& random="[either][scratch component_hsize][or]2[/either]"
.Ve
Special Tag
.PP
This setting is only viable when a promotion is used for a horizontal
component. It tells the promotional component which rows to evaluate
in the merchandising table for display within the component. This
setting normally corelates to the featured column of the merchandising
table as follows:
.PP
.Vb 6
\&        [query arrayref=main
\&                   sql="
\&                        SELECT sku,timed_promotion,start_date,finish_date
\&                        FROM merchandising
\&                        WHERE featured = '[scratch hpromo_type]'
\&                        "][/query]
.Ve
Before/After Banner
.PP
Allows a title for the horizontal components to be defined to
displayed in a header above the component's items. It is called with
the [scratch hbanner] tag.
.PP
Break 2
.PP
This code causes a separation in the Content Editor between the next
set of options. (A blue line)
.PP
Vertical Component
.PP
Defines a component to be displayed along the right side of the
\&\s-1LEFTRIGHT_BOTTOM\s0 template. It is called from the template with the
following code:
.PP
.Vb 1
\& [include file="templates/components/[scratch component_right]"]
.Ve
Vertical Items Height
.PP
Sets the number of items to display within the vertical component.
Called with the following code:
.PP
.Vb 1
\& random="[either][scratch component_vsize][or]3[/either]"
.Ve
Right Banner
.PP
Allows a title to be set for a vertical component which is displayed
as a header above the items in the vertical component. It's called
with the [scratch vbanner] tag.
.PP
Special Tag
.PP
Essentially the same as the Special Tag setting described in item
number 9 above.
.PP
Background Color
.PP
Allows the background color of the page to be selected. The choices
are stored within the page or template definition as in:
.PP
.Vb 4
\& bgcolor:
\&        options: #FFFFFF=White,pink=Pink
\&        widget: select
\&        description: Background color
.Ve
Content
.PP
Allows the page code to be downloaded, uploaded and viewed/edited.
Only the code between <!\-\- \s-1BEGIN\s0 \s-1CONTENT\s0 \-\-> and <!\-\- \s-1END\s0 \s-1CONTENT\s0 \-\->
is displayed or can be edited here.
.PP
Preview, Save, and Cancel buttons
.PP
Allows the changes to the edited page to be previewed in a pop-up
browser window, or saved. Cancel returns you to the page editor
selection page.
.PP
Save template in page
.PP
Template settings are stored in the template definitions by default.
This allows a common set of choices for template settings for all
pages. If specific setting options are desired for a page, the
template can be saved within the page so that it may have individual
options.
.PP
The in-page template definition must be surrounded by [comment] 
[/comment].
.Sh "Custom Admin \s-1UI\s0 Options"
.IX Subsection "Custom Admin UI Options"
Other options may be added to the template by defining them in the
default definition file, or using in-page definitions.
.PP
When the following lines are added to the template definition, the new
option is added to the Admin \s-1UI\s0.
.PP
.Vb 5
\& option_name:
\&options: 1,2*,3
\&widget: select
\&description: Option Description
\&help: Other Details
.Ve
Each time the template is used, an option_name scratch variable is
created. (Called with: [scratch option_name].) This scratch value will
be equal to what's selected here in the admin tool.
.PP
The possible widgets include:
.PP
.Vb 4
\& break - produces the blue line separator.
\&radio - produces radio button type selections.
\&select - standard drop-down selector.
\&move_combo - select drop down with options and text input for new option.
.Ve
.SH "Administrative Pages"
.IX Header "Administrative Pages"
With Interchange's GlobalSub capability, very complex add-on
schemes can be implemented with Perl subroutines. And with the new
writable database, pages that modify the catalog data can be made. See
MasterHost, RemoteUser, and Password.
.PP
In addition, any Interchange page subdirectory can be protected from
access by anyone except the administrator if a file called '.access'
is present and non-zero in size.
.Sh "Controlling Access to Certain Pages"
.IX Subsection "Controlling Access to Certain Pages"
If the directory containing the page has a file .access and that
file's size is zero bytes, access can be gated in one of several ways.
.Ip "1." 4
If the file .access_gate is present, it will be read and scanned
for page-based access. The file has the form:
.Sp
.Vb 1
\&  page: condition
.Ve
.Ip "" 4
The page is the file name of the file to be controlled (the .html
extension is optional). The condition is either a literal Yes/No
or Interchange tags which would produce a Yes or No (1/0 work
just fine, as do true/false).
.Sp
The entry for * sets the default action if the page name is not
found. If pages will be allowed by default, set it to 1 or Yes.
If pages are to be denied by default in this directory, leave blank or
set to No. Here is an example, for the directory controlled,
having the following files:
.Sp
.Vb 1
\& -rw-rw-r--   1 mike     mike            0 Jan  8 14:19 .access
.Ve
.Ip "" 4
The contents of .access_gate:
.Sp
.Vb 1
\&   foo.html: [if session username eq 'flycat']
.Ve
.Ip "" 4
The page controlled/foo is only allowed for the logged-in user
\&\fBflycat\fR.
.Sp
The page controlled/bar is allowed for the logged-in user
\&\fBflycat\fR, or if the scratch variable allow_bar is set to a
non-blank, non-zero value.
.Sp
The page controlled/baz is always allowed for display.
.Sp
The page controlled/any (or any other page in the directory not
named in .access_gate) will be allowed for any user logged in via
\&\fIUserDB\fR. \s-1NOTE:\s0 The .access_gate scheme is available for database
access checking if the database is defined as an AdminDatabase. The
\&.access_gate file is located in ProductDir.
.Ip "2." 4
If the Variable \s-1MV_USERDB_REMOTE_USER\s0 is set (non-zero and
non-blank), any user logged in via the UserDB feature will receive
access to all pages in the directory. \s-1NOTE:\s0 If there is a
\&.access_gate file, it overrides this.
.Ip "3." 4
If the variables \s-1MV_USERDB_ACL_TABLE\s0 is set to a valid database
identifier, the UserDB module can control access with simple \s-1ACL\s0
logic. See \s-1USER\s0 \s-1DATABASE\s0. \s-1NOTE:\s0 If there is a .access_gate file, it
overrides this. Also, if \s-1MV_USERDB_REMOTE_USER\s0 is set, this
capability is not available.
.Sh "display tag and mv_metadata"
.IX Subsection "display tag and mv_metadata"
Interchange can store meta information for selected columns of tables
in a site's database. This meta information is used when the user
interacts with the database. For example, the meta informaton for a
Hide Item field might specify that a checkbox be displayed when the
user edits that field, since the only reasonable values are on and
off. Or, the meta information might specify a filter on data
entered for a Filename field which makes sure that the characters
entered are safe for use in a filename.
.PP
Widget type specifies the \s-1HTML\s0 \s-1INPUT\s0 tag type to use when
displaying the field in, say, the item editor.
.PP
Width and Height only apply to some of the Widget type
options, for instance the Textarea widget.
.PP
Label is displayed instead of the internal column name. For
example, the category column of the products table might have a
label of Product Category.
.PP
Help is displayed below the column label, and helps describe the
purpose of the field to the user.
.PP
Help url can be used to link to a page giving more information on
the field.
.PP
Lookup can be used when a field is acting like a foreign key into
another table. In that case, use some sort of select box as the widget
type, and if referencing multiple rows in the destination table, use a
multi select box, with colons_to_null as the pre_filter, and
:: as the lookup_exclude.
.PP
Filter and pre_filter can be used to filter data destined for
that field or data read from that field, respectively.
.PP
Repeat?: The Interchange back office \s-1UI\s0 uses the mv_metadata table to
discover formatting information for field, table, and view display.
The information is kept in fields in the mv_metadata table, and is
used to select the display, the \s-1HTML\s0 input type, the size (height and
width where appropriate), label, help text, additional help \s-1URL\s0, and
default value display.
.PP
It works in conjunction with the [display ...] usertag defined in the
Interchange \s-1UI\s0 as well as in specific pages in the \s-1UI\s0. The [display]
tag has this syntax:
.PP
[display table=tablename column=fieldname key=key arbitrary=tag
filter=op ...]
.PP
In the simplest use, the formatting information for a table form field
is called with:
.Ip "" 4
[display table=products column=category key=\*(L"os28007\*(R"]
.PP
The mv_metadata table is scanned for the following keys:
.Ip "" 4
products::category::os28007
.Sp
products::category
.PP
If a row is found with one of those keys, then the information in the
row is used to set the display widget. If no row is found, an \s-1INPUT\s0
TYPE=TEXT widget is displayed. If the data is all digits, a size of 8
is used, otherwise the size is 60.
.PP
If the following row were found (not all fields shown, would be
tab-separated in the actual data):
.PP
.Vb 2
\&  code                type   width height label     options
\&  products::category  text   20           Category
.Ve
Then this would be output:
.PP
.Vb 1
\& <INPUT TYPE=text SIZE=20 VALUE="*category*">
.Ve
If the following row were found:
.PP
.Vb 2
\&  code                type   width height label     options
\&  products::category  select              Category  =none, product=Hardware
.Ve
Then the following would be output:
.PP
.Vb 4
\&        <SELECT NAME=category>
\&        <OPTION VALUE="">none
\&        <OPTION VALUE="product">Hardware
\&        </SELECT>
.Ve
The standard widget types are:
.Ip "text" 4
.IX Item "text"
The default. Uses the fields:
.Sp
.Vb 1
\&    width   size of input box
.Ve
.Ip "textarea" 4
.IX Item "textarea"
Format a <\s-1TEXTAREA\s0> </TEXTAREA> pair. Uses the fields:
.Sp
.Vb 1
\&        width   COLS for textarea
.Ve
.Ip "select" 4
.IX Item "select"
Format a <\s-1SELECT\s0> </SELECT> pair with appropriate options. Uses the
fields:
.Sp
.Vb 1
\&  height          SIZE for select
.Ve
.SH "Usertag Reference"
.IX Header "Usertag Reference"
Admin Tool-specific usertags.
.SH "Admin Tool Database Tables"
.IX Header "Admin Tool Database Tables"
.Sh "icmenu.txt"
.IX Subsection "icmenu.txt"
Used for back-office administration \s-1UI\s0 menus and wizards.
.PP
.Vb 23
\&    code
\&                Arbitrary primary key
\&    mgroup
\&                Menu group (for grouping searches)
\&    msort
\&                Sort order within the group
\&    next_line
\&                Set to 1 if submenu
\&    indicator
\&    exclude_on
\&    depends_on
\&    page
\&    form
\&    name
\&    super
\&    inactive
\&    special
\&    help_name
\&        img_dn
\&        img_up
\&        img_sel
\&        img_icon
\&        url
.Ve
.Sh "mv_metadata.asc"
.IX Subsection "mv_metadata.asc"
.Vb 66
\&    code
\&        Table::Column to be operated on.
\&        Database table
\&    type
\&        Widget type (Select the basic display type for the field)
\&            textarea = Textarea
\&            text = Text Entry (default)
\&            select = Select Box
\&            yesno = Yes/No (Yes=1)
\&            noyes = No/Yes (No=1)
\&            multiple = Multiple Select
\&            combo = Combo Select
\&            reverse_combo = Reverse Combo
\&            move_combo = Combo move
\&            display = Text of option
\&            hidden_text = Hidden(show text)
\&            radio = Radio box
\&            radio_nbsp = Radio (nbsp)
\&            checkbox = Checkbox
\&            check_nbsp = Checkbox (nbsp)
\&            imagedir = Image listing
\&            imagehelper = Image upload
\&            date = Date selector
\&            value = Value
\&            option_format = Option formatter
\&            show = Show all options
\&    width
\&        Width (SIZE for TEXT, COLS for TEXTAREA, Label limit for SELECT)
\&    height
\&        Height (SIZE for SELECT, ROWS for TEXTAREA)
\&    field
\&        Field for lookup (can be two comma separated fields, in which case
\&        second is used as the label text.  Both must be in the same table.)
\&    db
\&    name
\&        Variable name (normally left empty, changes variable name to send in
\&        form)
\&    outboard
\&        Select directory for image listing widget
\&    options
\&        options in the format <blockquote>value=label*</blockquote>
\&    attribute
\&        Column name (Do not set this.)
\&    label
\&    help
\&        Help (displays at top of page)
\&    lookup
\&        Lookup select (Whether lookup is performed to get options for a select
\&        type.  If nothing is in the field, then used as the name of the field
\&        to lookup in.  Use lookup table if you want to look up in a different
\&        table.
\&    filter
\&        Filters (Filters which can transform or constrain your data.  Some
\&        widgets require filters.)
\&    help_url
\&        Help URL (links below help text)
\&        A URL which will provide more help
\&    pre_filter
\&    lookup_exclude
\&        ADVANCED: regular expression that excludes certain keys from the lookup
\&    prepend
\&    append
\&        Append HTML (HTML to be appended to the widget.  Will substitute in the
\&        macros _UI_TABLE_, _UI_COLUMN_, _UI_KEY_, and _UI_VALUE_, and will
\&        resolve relative links with absolute links.)
\&    display_filter
.Ve
.SH "makecat \- Set Up a Catalog from a Template"
.IX Header "makecat - Set Up a Catalog from a Template"
After Interchange is installed, you need to set up at least one
catalog. Interchange will not function properly until a catalog is
created.
.PP
The supplied makecat script, which is in the Interchange program
directory bin, is designed to set up a catalog based on the user's
server configuration. It interrogates the user for parameters like
which directories to use, a \s-1URL\s0 to base the catalog in, \s-1HTTP\s0 server
definitions, and file ownership. It gives relevant examples of the
entries it expects to receive.
.PP
\&\fBNote: \fRA catalog can only be created once. All further configuration
is done by editing the files within the catalog directory.
.PP
The makecat script requires a catalog skeleton to work from. The
Foundation demo is distributed with Interchange. See the icfoundation
document for information on building the Foundation demo store. Other
demo catalogs are available at http://interchange.redhat.com/.
.PP
It is not normally necessary for you to understand how to build
catalog skeletons for use with makecat, but the following information
will help you if you should ever need to.
.Sh "Catalog Skeletons"
.IX Subsection "Catalog Skeletons"
A catalog skeleton contains an image of a configured catalog. The best
way to see what the makecat program does is to configure the simple
demo and then run a recursive diff on the template and configured
catalog directories:
.PP
.Vb 2
\&        cd /usr/local/interchange
\&        diff -r construct catalogs/construct
.Ve
The files are mostly identical, except that certain macro strings have
been replaced with the answers given to the script. For example, if
www.mydomain.com was answered at the prompt for a server name, this
difference would appear in the catalog.cfg file:
.PP
.Vb 2
\&       # template
\&       Variable SERVER_NAME  __MVC_SERVERNAME__
.Ve
.Vb 2
\&       # configured catalog
\&       Variable SERVER_NAME  www.mydomain.com
.Ve
The macro string _\|_MVC_SERVERNAME_\|_ was substituted with the answer to
the question about server name. In the same way, other variables are
substituted, and include:
.PP
.Vb 9
\& MVC_BASEDIR      MVC_IMAGEDIR
\&MVC_CATROOT      MVC_IMAGEURL
\&MVC_CATUSER      MVC_MAILORDERTO
\&MVC_CGIBASE      MVC_MINIVENDGROUP
\&MVC_CGIDIR       MVC_MINIVENDUSER
\&MVC_CGIURL       MVC_SAMPLEHTML
\&MVC_DEMOTYPE     MVC_SAMPLEURL
\&MVC_DOCUMENTROOT MVC_VENDROOT
\&MVC_ENCRYPTOR
.Ve
\&\fBNote: \fRNot all of these variables are present in the \*(L"construct\*(R"
template, and more may be defined. In fact, any environment variable
that is set and begins with \s-1MVC_\s0 will be substituted for by the
makecat script. For example, to set up a configurable parameter to
customize the \s-1COMPANY\s0 variable in catalog.cfg, run a pre-qualifying
script that set the environment variable \s-1MVC_COMPANY\s0 and then place in
the catalog.cfg file:
.PP
Variable   \s-1COMPANY\s0   _\|_MVC_COMPANY_\|_
.PP
All files within a template directory are substituted for macros, not
just the catalog.cfg file. There are two special directories named
html and images. These will be recursively copied to the
directories defined as SampleHTML and ImageDir.
.PP
\&\fBNote: \fRThe template directory is located in the Interchange software
directory, i.e., where interchange.cfg resides. Avoid editing files
in the template directory. To create a new template, it is recommended
that it should be named something besides 'construct' and a copy of
the construct demo directory be used as a starting point. Templates
are normally placed in the Interchange base directory, but can be
located anywhere. The script will prompt for the location if it cannot
find a template.
.PP
In addition to the standard parameters prompted for by Interchange,
and the standard catalog creation procedure, four other files in the
config directory of the template may be defined:
.PP
.Vb 4
\& additional_fields -- file with more parameters for macro substitution
\&additional_help   -- extended description for the additional_fields
\&precopy_commands  -- commands passed to the system prior to catalog copy
\&postcopy_commands -- commands passed to the system after catalog copy
.Ve
All files are paragraph-based. In other words, a blank line (with no
spaces) terminates the individual setting.
.PP
The additional_fields file contains:
.PP
.Vb 3
\& PARAM
\&The prompt. Set PARAM to?
\&The default value of PARAM
.Ve
This would cause a question during makecat:
.PP
.Vb 1
\& The prompt. Set PARAM to?.....[The default value of PARAM]
.Ve
If the additional_help file is present, additional instructions for
\&\s-1PARAM\s0 may be provided.
.PP
.Vb 1
\& PARAM
.Ve
These are additional instructions for \s-1PARAM\s0, and they
may span multiple lines up to the first blank line.
.PP
The prompt would now be:
.PP
.Vb 2
\& These are additional instructions for PARAM, and they
\&may span multiple lines up to the first blank line.
.Ve
The prompt. Set \s-1PARAM\s0 to?.....[The default value of \s-1PARAM\s0]
.PP
If the file config/precopy_commands exists, it will be read as a
command followed by the prompt/help value.
.PP
.Vb 3
\& mysqladmin create __MVC_CATALOGNAME__
\&We need to create an SQL database for your Interchange
\&database tables.
.Ve
This will cause the prompt:
.PP
.Vb 2
\& We need to create an SQL database for your Interchange
\&database tables.
.Ve
Run command \*(L"mysqladmin create simple\*(R"?
.PP
If the response is \*(L"y\*(R" or \*(L"yes,\*(R" the command will be run by passing it
through the Perl \fIsystem()\fR function. As with any of the additional
configuration files, \s-1MVC_PARAM\s0 macro substitution is performed on the
command and help. Proper permissions for the command are required.
.PP
The file config/postcopy_commands is exactly the same as
<precopy_commands>, except the prompt occurs after the catalog files
are copied and macro substitution is performed on all files.
.PP
There may also be SubCatalog directives:
.PP
.Vb 1
\& SubCatalog easy simple /home/catalogs/simple /cgi-bin/easy
.Ve
easy
.Ip "" 4
The name of the subcatalog, which also controls the name of the
subcatalog configuration file. In this case, it is easy.cfg.
.PP
simple
.Ip "" 4
The name of the base configuration that will be the basis for the
catalog. Parameters in the easy.cfg file that are different will
override those in the catalog.cfg file for the base configuration.
.PP
The remaining parameters are similar to the Catalog directive.
.PP
Additional interchange.cfg parameters set up administrative parameters
that are catalog wide. See the server configuration file for details
on each of these.
.PP
Each catalog can be completely independent with different databases,
or catalogs can share pages, databases, and session files. This means
that several catalogs can share the same information, allowing
\&\*(L"virtual malls.\*(R"
.Sh "Manual Installation of Catalogs"
.IX Subsection "Manual Installation of Catalogs"
An Interchange installation is complex, and requires quite a few
distinct steps. Normally you will want to use the interactive catalog
builder, makecat, described above. It makes the process much
easier. Please see the iccattut document for a full tutorial on
building a catalog by hand.
.SH "Link Programs"
.IX Header "Link Programs"
Interchange requires a web server that is already installed on a
system. It does have an internal server which can be used for
administration, testing, and maintenance, but this will not be useful
or desireable in a production environment.
.PP
As detailed previously, Interchange is always running in the
background as a daemon, or resident program. It monitors either a
UNIX-domain file-based socket or a series of INET-domain sockets. The
small \s-1CGI\s0 link program, called in the demo simple, is run to
connect to one of those sockets and provide the link to a browser.
.PP
\&\fBNote: \fRSince Apache is the most popular web server, these
instructions will focus on it. If using another type of web server,
some translation of terms may be necessary.
.PP
A ScriptAlias or other \s-1CGI\s0 execution capability is needed to use
the link program. (The default ScriptAlias for many web servers is
/cgi-bin.) If ExecCGI is set for all directories, then any
program ending in a particular file suffix (usually .cgi) will be
seen as a \s-1CGI\s0 program.
.PP
Interchange, by convention, names the link program the same name as
the catalog \s-1ID\s0, though this is not required. In the distribution demo,
this would yield a program name or \s-1SCRIPT_PATH\s0 of /cgi-bin/simple
or /simple.cgi. This \s-1SCRIPT_PATH\s0 can be used to determine which
Interchange catalog will be used when the link program is accessed.
.Sh "UNIX-Domain Sockets"
.IX Subsection "UNIX-Domain Sockets"
This is a socket which is not reachable from the Internet directly,
but which must come from a request on the server. The link program
vlink is the provided facility for such communication with
Interchange. This is the most secure way to run a catalog, for there
is no way for systems on the Internet to interact with Interchange
except through its link program.
.PP
The most important issue with UNIX-domain sockets on Interchange is
the permissions with which the \s-1CGI\s0 program and the Interchange server
run. To improve security, Interchange normally runs with the socket
file having 0600 permissions (rw\-\-\-\-\-\-\-), which mandates that the \s-1CGI\s0
program and the server run as the same user \s-1ID\s0. This means that the
vlink program must be \s-1SUID\s0 to the same user \s-1ID\s0 as the server
executes under. (Or that \s-1CGIWRAP\s0 is used on a single catalog system).
.PP
With Interchange's multiple catalog capability, the permissions
situation gets a bit tricky. Interchange comes with a program,
makecat, which configures catalogs for a multiple catalog system.
It should properly set up ownership and permissions for multiple users
if run as the superuser.
.Sh "INET-Domain Sockets"
.IX Subsection "INET-Domain Sockets"
These are sockets which are reachable from the Internet directly. The
link program tlink is the provided facility for such communication
with Interchange. Other browsers can talk to the socket directly if
mapped to a catalog with the global TcpMap directive. To improve
security, Interchange usually checks that the request comes from one
of a limited number of systems, defined in the global TcpHost
directive. (This check is not made for the internal \s-1HTTP\s0 server.)
.Sh "Internal \s-1HTTP\s0 Server"
.IX Subsection "Internal HTTP Server"
If the socket is contacted directly (only for INET-domain sockets),
Interchange will perform the \s-1HTTP\s0 server function itself, talking
directly to the browser. It can monitor any number of ports and map
them to a particular catalog. By default, it only maps the special
catalog mv_admin, which performs administrative functions. The default
port is 7786, which is the default compiled into the distribution
tlink program. This port can be changed via the TcpMap directive.
.PP
To prevent catalogs that do not wish access to be made in this way
from being served from the internal server, Interchange has a fixed
\&\s-1SCRIPT_PATH\s0 of /catalogname (/simple for the distribution demo)
which needs to be placed as an alias in the Catalog directive to
enable access. See TcpMap for more details.
.Sh "Setting Up \s-1VLINK\s0 and \s-1TLINK\s0"
.IX Subsection "Setting Up VLINK and TLINK"
The vlink and tlink programs, compiled from vlink.c and
tlink.c, are small C programs which contact and interface to a
running Interchange daemon. The \s-1VLINK\s0 executable is normally made
setuid to the user account which runs Interchange, so that the
UNIX-domain socket file can be set to secure permissions (user
read-write only). It is normally not necessary for the user to do
anything. They will be compiled by the configuration program. If the
Interchange daemon is not running, either of the programs will display
a message indicating that the server is not available. The following
defines in the produced config.h should be set:
.Ip "\s-1LINK_FILE\s0" 4
.IX Item "LINK_FILE"
Set this to the name of the socket file that will be used for
configuration, usually \*(L"/usr/local/lib/interchange/etc/socket\*(R" or the
\&\*(L"etc/socket\*(R" under the directory chosen for the VendRoot.
.Ip "\s-1LINK_HOST\s0" 4
.IX Item "LINK_HOST"
Set this to the \s-1IP\s0 number of the host which should be contacted. The
default of 127.0.0.1 (the local machine) is probably best for many
installations.
.Ip "\s-1LINK_PORT\s0" 4
.IX Item "LINK_PORT"
Set this to the \s-1TCP\s0 port number that the Interchange server will
monitor. The default is 7786 (the decimal \s-1ASCII\s0 codes for 'M' and 'V')
and does not normally need to be changed.
.Ip "\s-1LINK_TIMEOUT\s0" 4
.IX Item "LINK_TIMEOUT"
Set this to the number of seconds vlink or tlink should wait
before announcing that the Interchange server is not running. The
default of 45 is probably a reasonable value.
.Sh "Compiling \s-1VLINK\s0 and \s-1TLINK\s0"
.IX Subsection "Compiling VLINK and TLINK"
There is a compile_link program which will assist with this. Do:
.PP
.Vb 1
\&   perldoc VENDROOT/bin/compile_link
.Ve
for its documentation.
.Sh "Manually Compiling \s-1VLINK\s0 and \s-1TLINK\s0"
.IX Subsection "Manually Compiling VLINK and TLINK"
Change directories to the src directory, then run the \s-1GNU\s0 configure
script:
.PP
.Vb 2
\&   cd src
\&   ./configure
.Ve
There will be some output displayed as the configure script checks the
system. Then, compile the programs:
.PP
.Vb 1
\&   perl compile.pl
.Ve
To compile manually:
.PP
.Vb 2
\&   cc vlink.c -o vlink
\&   cc tlink.c -o tlink
.Ve
On manual compiles, ensure that the C compiler will be invoked
properly with this little ditty:
.PP
.Vb 2
\&   perl -e 'do "syscfg"; system("$CC $LIBS $CFLAGS $DEFS -o tlink tlink.c");'
\&   perl -e 'do "syscfg"; system("$CC $LIBS $CFLAGS $DEFS -o vlink vlink.c");'
.Ve
On some systems, the executable can be made smaller with the strip
program, if available. It is not required.
.PP
.Vb 2
\&   strip vlink
\&   strip tlink
.Ve
If Interchange is to run under a different user account than the
individual configuring the program, make that user the owner of
vlink. Do not make vlink owned by root, because making vlink
\&\s-1SETUID\s0 root is an huge and unnecessary security risk. It should also
not normally run as the default Web user (often nobody or
http)).
.PP
.Vb 1
\&   chown interchange vlink
.Ve
Move the vlink executable to the cgi-bin directory:
.PP
.Vb 1
\&   mv vlink /the/cgi-bin/directory
.Ve
Make vlink \s-1SETUID:\s0
.PP
.Vb 1
\&   chmod u+s /the/cgi-bin/directory/vlink
.Ve
Most systems unset the \s-1SUID\s0 bit when moving the file, so change it
after moving.
.PP
The \s-1SCRIPT_NAME\s0, as produced by the \s-1HTTP\s0 server, must match the name
of the program. (As usual, let the makecat program do the work.)
.Sh "\s-1VLINK\s0 or \s-1TLINK\s0 Compile Problems"
.IX Subsection "VLINK or TLINK Compile Problems"
The latest version of vlink.c and tlink.c have been compiled on
the following systems:
.PP
.Vb 12
\&   AIX 4.1
\&   BSD2.0 (Pentium/x86)
\&   Debian GNU/Linux
\&   Digital Unix (OSF/Alpha)
\&   FreeBSD 2.x, 3.x, 4.x
\&   IRIX 5.3, IRIX 6.1
\&   OpenBSD 2.7
\&   Red Hat Linux 6.2, 7.0, 7.1
\&   SCO OpenServer 5.x
\&   Solaris 2.x (Sun compiler and GCC)
\&   Solaris 7 (Sun compiler and GCC)
\&   SunOS 4.1.4
.Ve
Some problems may occur. In general, ignore warnings about pointers.
.PP
Make sure that you have run the configure program in the src
directory. If you use Interchange's makecat program, it will try to
compile an appropriate link at that time, and will substitute tlink.pl
if that doesn't work.
.PP
You can compile manually with the proper settings with this series of
commands:
.PP
.Vb 4
\&   cd src
\&   ./configure
\&   perl -e 'do "syscfg"; system ("$CC $CFLAGS $DEFS $LIBS -o tlink tlink.c")'
\&   perl -e 'do "syscfg"; system ("$CC $CFLAGS $DEFS $LIBS -o vlink vlink.c")'
.Ve
There is also a compile_link program which has docmentation
embedded and which will compile an approprate link. If you cannot
compile, try using the tlink.pl script, written in Perl instead of
C, which should work on most any system. Since vlink needs to have
values set before compilation, a pre-compiled version will not work
unless it has the exact values you need on your system. If you can use
the defaults of 'localhost' and port 7786, you may be in luck.
.SH "Installing Perl Modules without Root Access"
.IX Header "Installing Perl Modules without Root Access"
Installing Interchange without root access is no problem. However,
installing Perl modules without root access is a little trickier.
.PP
You must build your makefile to work in your home dir. Something like:
.PP
.Vb 7
\& PREFIX=~/usr/local \e
\&INSTALLPRIVLIB=~/usr/local/lib/perl5 \e
\&INSTALLSCRIPT=~/usr/local/bin \e
\&INSTALLSITELIB=~/usr/local/lib/perl5/site_perl \e
\&INSTALLBIN=~/usr/local/bin \e
\&INSTALLMAN1DIR=~/usr/local/lib/perl5/man \e
\&INSTALLMAN3DIR=~/usr/local/lib/perl5/man/man3
.Ve
Put this in a file, say 'installopts', and use it for the Makefile.PL.
.PP
.Vb 1
\& perl Makefile.PL `cat installopts`
.Ve
Then, forget ./config. Just do:
.PP
.Vb 3
\& make
\&make test
\&make install
.Ve
Some of the tests may fail, but that's probably ok.
.PP
Also make sure to install Bundle::Interchange, which will need the
same config data as you put into 'installopts'.
.SH "Installation Troubleshooting"
.IX Header "Installation Troubleshooting"
Interchange uses the services of other complex programs, such as Perl,
Web servers, and relational databases, to work. Therefore, when there
is a problem, check these programs before checking Interchange. Many
more basic installation problems have to do with those than with
Interchange itself.
.PP
If an error message is received about not being able to find
libraries, or a core dump has occurred, or a segment fault message, it
is always an improperly built or configured Perl. Contact the system
administrator or install a new Perl.
.PP
The makecat program is intended to be used to create the starting
point for the catalog. If the demo does not work the first time, keep
trying. If it still does not work, try running in \s-1INET\s0 mode.
.PP
Check the two error log files: error.log in the Interchange home
directory (where interchange.cfg resides) and error.log in the
catalog directory (where catalog.cfg resides; there can be many of
these). Many problems can be diagnosed quickly if these error logs are
consulted.
.PP
Check the \s-1README\s0 file, the \s-1FAQ\s0, and mail list archive at the official
Interchange web site for information:
.PP
.Vb 1
\&       http://interchange.redhat.com/
.Ve
Double check the following items:
.Ip "1." 4
Using \s-1UNIX\s0 sockets?
.RS 4
.Ip "\(bu" 8
Check that the vlink program is \s-1SUID\s0, or the appropriate changes
have been made in the SocketPerms directive. Unless the files are
world-writable, the vlink program and the Interchange server must run
as the same user \s-1ID\s0! If running \s-1CGI-WRAP\s0 or \s-1SUEXEC\s0, the vlink
program must not be \s-1SUID\s0.
.Ip "\(bu" 8
If having trouble with the vlink program (named construct in the
demo configuration), try re-running makecat and using \s-1INET\s0 mode
instead. (Or copy the tlink \s-1INET\s0 mode link program over vlink).
This should work unchanged for many systems.
.Ip "\(bu" 8
If using an \s-1ISP\s0 or have a non-standard network configuration, some
changes to interchange.cfg are necessary. For tlink to work, the
proper host \fIname\fR\|(s) must be configured into the TcpHost directive in
interchange.cfg. The program selects port 7786 by default (the \s-1ASCII\s0
codes for \*(L"M\*(R" and \*(L"V\*(R"). If another port is used, it must be set to the
same number in both the tlink program (by running compile_link) and
the minivend.cfg file. The tlink program does not need to be
\&\s-1SUID\s0.
.RE
.RS 4
.RE
.Ip "2." 4
Proper file permissions?
.RS 4
.Ip "\(bu" 8
The Interchange server should not run as the user nobody! The
program files can be owned by anyone, but any databases, \s-1ASCII\s0
database source files, error logs, and the directory that holds them
must be writable by the proper user \s-1ID\s0, that is the one that is
executing the MiniVend program.
.Ip "\(bu" 8
The best way to operate in multi-user, multiple catalog setups is to
create a special interch user, then put that user in the group that
contains each catalog user. If a group is defined for each individual
user, this provides the best security. All associated files can be in
660 or 770 mode. There should be no problems with permissions and no
problems with security.
.RE
.RS 4
.RE
.Ip "3." 4
Is the vlink program being executed on a machine that has the
socket file etc/socket on a directly attached disk?
.RS 4
.Ip "\(bu" 8
UNIX-domain sockets will not work on NFS-mounted file systems! This
means that the server minivend and the \s-1CGI\s0 program vlink must be
executing on the same machine.
.Ip "\(bu" 8
The tlink program does not have this problem, but it must have the
proper host \fIname\fR\|(s) and \s-1TCP\s0 ports set in the TcpHost and TcpPort
directives in interchange.cfg. Also, be careful of security if
sensitive information, like customer credit card numbers, is being
placed on a network wire.
.RE
.RS 4
.RE
.PP
.Vb 1
\& ________________________________________
.Ve
Copyright 2001 Red Hat, Inc. Freely redistributable under terms of the
\&\s-1GNU\s0 General Public License.