This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
/
minivend.html
17224 lines (11822 loc) · 507 KB
/
minivend.html
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
<!-- $Id$ -->
<HTML><HEAD>
<CENTER><TITLE>minivend</TITLE>
</HEAD>
<BODY BGCOLOR=WHITE></CENTER><p><hr>
<CENTER> <H1>
<A NAME="minivend_name_0">
MiniVend -- multi-catalog shopping cart and mall
</A>
</CENTER> </H1>
<p>
<H2>
<A NAME="minivend_version_0">
Version</A>
</H2>
This document describes MiniVend 3.09, based on Andrew Wilcox's
original Vend, Version 0.2, with portions from Vend 0.3.
<p><p><hr>
<!-- INDEX BEGIN -->
<!--
<UL>
<LI><A HREF="#Version">Version</A>
</UL>
<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
<LI><A HREF="#OVERVIEW_OF_MINIVEND">OVERVIEW OF MINIVEND</A>
<UL>
<LI><A HREF="#The_Vend_Concept">The Vend Concept</A>
<LI><A HREF="#A_typical_user_session">A typical user session</A>
<LI><A HREF="#How_MiniVend_Manages_Sessions">How MiniVend Manages Sessions</A>
<LI><A HREF="#Page_Delivery">Page Delivery</A>
</UL>
<LI><A HREF="#DISTRIBUTION_AND_SUPPORT_INFORMA">DISTRIBUTION AND SUPPORT INFORMATION</A>
<UL>
<LI><A HREF="#Where_to_Download_MiniVend">Where to Download MiniVend</A>
<LI><A HREF="#Perl">Perl</A>
<LI><A HREF="#Setup_for_HTTP_Servers">Setup for HTTP Servers</A>
</UL>
<LI><A HREF="#QUICK_START">QUICK START</A>
<UL>
<LI><A HREF="#The_Catalog">The Catalog</A>
<LI><A HREF="#makecat_set_up_a_catalog_from">makecat - set up a catalog from a template</A>
<LI><A HREF="#Setting_up_multiple_catalogs">Setting up multiple catalogs</A>
<LI><A HREF="#If_something_goes_wrong">If something goes wrong</A>
</UL>
<LI><A HREF="#SETTING_UP_YOUR_CATALOG">SETTING UP YOUR CATALOG</A>
<UL>
<LI><A HREF="#Start_with_a_database">Start with a database</A>
<LI><A HREF="#On_the_fly_pages_static_or_bot">On-the-fly pages, static, or both?</A>
<LI><A HREF="#Use_the_demo_catalogs">Use the demo catalogs</A>
<LI><A HREF="#Tree_design">Tree design</A>
<LI><A HREF="#The_Essentials">The Essentials</A>
<LI><A HREF="#Catalog_Pages_MiniVend_tags">Catalog Pages - MiniVend tags</A>
<LI><A HREF="#Cookies">Cookies</A>
<LI><A HREF="#Basic_MiniVend_Tags">Basic MiniVend Tags</A>
<LI><A HREF="#How_to_order_an_item">How to order an item</A>
<LI><A HREF="#Where_do_I_go_from_here_">Where do I go from here?</A>
</UL>
<LI><A HREF="#DATABASES">DATABASES</A>
<UL>
<LI><A HREF="#The_Product_Database">The Product Database</A>
<LI><A HREF="#Arbitrary_Databases">Arbitrary Databases</A>
<LI><A HREF="#MiniVend_built_in_database_suppo">MiniVend built-in database support</A>
<LI><A HREF="#Character_usage_restrictions">Character usage restrictions</A>
<LI><A HREF="#Import_Attributes">Import Attributes</A>
<LI><A HREF="#Dictionary_indexing_with_INDEX">Dictionary indexing with INDEX</A>
<LI><A HREF="#MEMORY_for_memory_only_databases">MEMORY for memory-only databases</A>
<LI><A HREF="#IMPORT_ONCE">IMPORT_ONCE</A>
</UL>
<LI><A HREF="#SQL_SUPPORT">SQL SUPPORT</A>
<UL>
<LI><A HREF="#Msql_support">Msql support</A>
<LI><A HREF="#SQL_support_via_DBI">SQL support via DBI</A>
<LI><A HREF="#SQL_Access_Methods">SQL Access Methods</A>
<LI><A HREF="#Importing_from_an_ASCII_file">Importing from an ASCII file</A>
<LI><A HREF="#Exporting_from_a_database">Exporting from a database</A>
</UL>
<LI><A HREF="#MINIVEND_TAG_REFERENCE">MINIVEND TAG REFERENCE</A>
<UL>
<LI><A HREF="#New_and_Old_Style_tags">New and Old Style tags</A>
<LI><A HREF="#DATA_and_FIELD">DATA and FIELD</A>
<LI><A HREF="#SET_and_SCRATCH">SET and SCRATCH</A>
<LI><A HREF="#DEFAULT_and_LOOKUP">DEFAULT and LOOKUP</A>
<LI><A HREF="#LOOP_and_TAG_EACH">LOOP and TAG EACH</A>
<LI><A HREF="#IF">IF</A>
<LI><A HREF="#TAG_the_catch_all">TAG - the catch all</A>
<LI><A HREF="#User_defined_Tags">User-defined Tags</A>
<LI><A HREF="#PRICE_DESCRIPTION_ACCESSORIES">PRICE, DESCRIPTION, ACCESSORIES</A>
<LI><A HREF="#FILE_and_INCLUDE">FILE and INCLUDE</A>
<LI><A HREF="#BODY_BUTTONBAR_RANDOM_ROTATE">BODY, BUTTONBAR, RANDOM, ROTATE</A>
<LI><A HREF="#Tags_for_summarizing_shopping_ba">Tags for summarizing shopping basket/cart</A>
<LI><A HREF="#Item_Lists">Item Lists</A>
<LI><A HREF="#Embedded_Perl_Code">Embedded Perl Code</A>
<LI><A HREF="#On_the_fly_Catalog_Pages">On-the-fly Catalog Pages</A>
<LI><A HREF="#Tags_for_controlling_old_syntax_">Tags for controlling old syntax interpolation order</A>
<LI><A HREF="#Required_Pages">Required Pages</A>
<LI><A HREF="#Checking_Page_HTML">Checking Page HTML</A>
</UL>
<LI><A HREF="#FORMS_AND_MINIVEND">FORMS AND MINIVEND</A>
<UL>
<LI><A HREF="#Special_Form_Fields">Special Form Fields</A>
<LI><A HREF="#Form_Actions">Form Actions</A>
<LI><A HREF="#One_click_Multiple_Variables">One-click Multiple Variables</A>
<LI><A HREF="#Checks_and_Selections">Checks and Selections</A>
<LI><A HREF="#Setting_Form_Security">Setting Form Security</A>
<LI><A HREF="#Stacking_Variables_on_the_Form">Stacking Variables on the Form</A>
<LI><A HREF="#Setting_SQL_tables_with_a_form">Setting SQL tables with a form</A>
</UL>
<LI><A HREF="#THE_SEARCH_ENGINE">THE SEARCH ENGINE</A>
<UL>
<LI><A HREF="#The_Search_Form">The Search Form</A>
<LI><A HREF="#Glimpse">Glimpse</A>
<LI><A HREF="#Fast_Binary_Search">Fast Binary Search</A>
<LI><A HREF="#Coordinated_searching">Coordinated searching</A>
<LI><A HREF="#Specifying_a_text_based_search_w">Specifying a text-based search with SQL-like syntax</A>
<LI><A HREF="#Range_Searching">Range Searching</A>
<LI><A HREF="#SQL_searches">SQL searches</A>
<LI><A HREF="#One_click_searches">One-click searches</A>
<LI><A HREF="#In_page_searches">In-page searches</A>
<LI><A HREF="#Search_Profiles">Search Profiles</A>
<LI><A HREF="#Search_Reference">Search Reference</A>
<LI><A HREF="#The_Results_Page">The Results Page</A>
<LI><A HREF="#Updating_session_variables_after">Updating session variables after a search</A>
<LI><A HREF="#Using_a_Search_Cache">Using a Search Cache</A>
</UL>
<LI><A HREF="#THE_ORDER_PROCESS">THE ORDER PROCESS</A>
<UL>
<LI><A HREF="#How_to_set_up_an_order_link">How to set up an order link</A>
<LI><A HREF="#How_to_set_up_an_order_button">How to set up an order button</A>
<LI><A HREF="#Order_Groups">Order Groups</A>
<LI><A HREF="#Basket_display">Basket display</A>
<LI><A HREF="#Multiple_Shopping_Carts">Multiple Shopping Carts</A>
<LI><A HREF="#Advanced_Multi_level_Order_Pages">Advanced Multi-level Order Pages</A>
<LI><A HREF="#Simple_Order_Report_File">Simple Order Report File</A>
<LI><A HREF="#Fully_configurable_Order_Reports">Fully-configurable Order Reports</A>
<LI><A HREF="#Order_Receipts">Order Receipts</A>
<LI><A HREF="#The_Order_Counter">The Order Counter</A>
<LI><A HREF="#Customer_Input_Fields">Customer Input Fields</A>
<LI><A HREF="#Product_Pricing">Product Pricing</A>
<LI><A HREF="#Item_Attributes">Item Attributes</A>
<LI><A HREF="#Product_Discounts">Product Discounts</A>
<LI><A HREF="#Sales_Tax">Sales Tax</A>
<LI><A HREF="#Using_CyberCash">Using CyberCash</A>
</UL>
<LI><A HREF="#SORTING">SORTING</A>
<LI><A HREF="#SHIPPING">SHIPPING</A>
<UL>
<LI><A HREF="#Default_Shipping_Mode">Default Shipping Mode</A>
<LI><A HREF="#Shipping_Cost_Database">Shipping Cost Database</A>
<LI><A HREF="#More_on_UPS_style_lookup">More on UPS-style lookup</A>
<LI><A HREF="#Determining_shipping_modes">Determining shipping modes</A>
<LI><A HREF="#Geographic_qualification">Geographic qualification</A>
<LI><A HREF="#Handling_charges">Handling charges</A>
</UL>
<LI><A HREF="#TRACKING_AND_BACKEND_ORDER_ENTRY">TRACKING AND BACKEND ORDER ENTRY</A>
<UL>
<LI><A HREF="#Easy_ASCII_Tracking">Easy ASCII Tracking</A>
<LI><A HREF="#SQL_Tracking">SQL Tracking</A>
</UL>
<LI><A HREF="#SSL_SECURITY">SSL SECURITY</A>
<UL>
<LI><A HREF="#Administrative_Pages">Administrative Pages</A>
</UL>
<LI><A HREF="#CONTROLLING_PAGE_APPEARANCE">CONTROLLING PAGE APPEARANCE</A>
<UL>
<LI><A HREF="#Using_Frames">Using Frames</A>
<LI><A HREF="#Changing_output_frame_in_a_form">Changing output frame in a form</A>
<LI><A HREF="#Body_and_Buttonbar_Control">Body and Buttonbar Control</A>
<LI><A HREF="#Integrated_Image_Maps">Integrated Image Maps</A>
<LI><A HREF="#Random_Banners">Random Banners</A>
<LI><A HREF="#Rotating_Banners">Rotating Banners</A>
<LI><A HREF="#In_line_Help">In-line Help</A>
</UL>
<LI><A HREF="#STATIC_PAGE_BUILDING">STATIC PAGE BUILDING</A>
<LI><A HREF="#INTERNATIONALIZATION">INTERNATIONALIZATION</A>
<UL>
<LI><A HREF="#Setting_the_locale">Setting the locale</A>
<LI><A HREF="#MiniVend_Locale_Settings">MiniVend Locale Settings</A>
<LI><A HREF="#Special_Locale_keys_for_price_re">Special Locale keys for price representation</A>
<LI><A HREF="#Dynamic_locale_directive_changes">Dynamic locale directive changes</A>
<LI><A HREF="#Sorting_based_on_Locale">Sorting based on Locale</A>
</UL>
<LI><A HREF="#MINIVEND_CONFIGURATION_FILES">MINIVEND CONFIGURATION FILES</A>
<UL>
<LI><A HREF="#Server_Configuration_File">Server Configuration File</A>
<LI><A HREF="#Catalog_Configuration_File">Catalog Configuration File</A>
<LI><A HREF="#Required_Configuration_Directive">Required Configuration Directives</A>
<LI><A HREF="#Optional_Configuration_Directive">Optional Configuration Directives</A>
</UL>
<LI><A HREF="#ADMINISTERING_MINIVEND">ADMINISTERING MINIVEND</A>
<UL>
<LI><A HREF="#Starting_Stopping_and_Re_start">Starting, Stopping, and Re-starting the Servers</A>
<LI><A HREF="#UNIX_and_INET_modes">UNIX and INET modes</A>
<LI><A HREF="#User_reconfiguration">User reconfiguration</A>
<LI><A HREF="#Making_the_Product_Database">Making the Product Database</A>
<LI><A HREF="#Updating_Individual_Records">Updating Individual Records</A>
<LI><A HREF="#Expiring_Sessions">Expiring Sessions</A>
</UL>
<LI><A HREF="#DEBUGGING">DEBUGGING</A>
<LI><A HREF="#MANUAL_INSTALLATION_OF_CATALOGS">MANUAL INSTALLATION OF CATALOGS</A>
<UL>
<LI><A HREF="#Needed_Directories">Needed Directories</A>
<LI><A HREF="#The_Demo_Systems">The Demo Systems</A>
<LI><A HREF="#Setting_up_VLINK_and_TLINK">Setting up VLINK and TLINK</A>
<LI><A HREF="#Compiling_VLINK_and_TLINK">Compiling VLINK and TLINK</A>
</UL>
<LI><A HREF="#AUTHOR">AUTHOR</A>
<LI><A HREF="#ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</A>
</UL>
-->
<!-- INDEX END -->
<P>
<H2><A NAME="Version">Version
</A></H2>
This document describes MiniVend 3.09, based on Andrew Wilcox's original
Vend, Version 0.2, with portions from Vend 0.3. This is the third major
revision of MiniVend.
<P>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION
</A></H1>
MiniVend allows customers to select items to buy from catalog pages. The
program tracks which products they have selected and the quantity desired.
From the ordering page they may complete the ordering process by entering
their name and address, or return to browsing and select more items. Once
the order process is completed, MiniVend submits the order to the system
via email or an external order entry program.
<P>
Though its name begins with ``Mini'', MiniVend is anything but. It is a
high-end, fully customizable, powerful software system with complete
database functionality. It is suitable for many applications besides
shopping carts, though that is its main bent.
<P>
MiniVend plugs into a system with an
<FONT SIZE=-1>SSL</FONT> (Secure Sockets Layer) server, allowing encrypted
transmission of sensitive customer data. This capability makes the entry of
credit card numbers practical and secure.
<P>
Many different catalogs can be run from the same MiniVend server, allowing an
<FONT SIZE=-1>ISP</FONT> to serve many different customers from one or just a few MiniVend server processes. As many as 400 MiniVend catalogs have been run on one machine from the same server process.
<P>
Multiple servers can be forked to serve the same set of catalogs. This
ensures fast response, while only one server runs when there is no catalog
activity.
<P>
MiniVend is powerful, and correspondingly complex. It can easily handle
catalogs of a million items or more, with excellent performance. It has
completely flexible page display, search, and order entry capability. If
you only have a few items to catalog, MiniVend is probably overkill for
your needs. But if you are willing to spend some up-front learning time, it
can support your simple catalog with unlimited room to grow. To get a fast
start with a simple catalog, start with the simple demo and customize from
there.
<P>
<P>
<HR>
<H1><A NAME="OVERVIEW_OF_MINIVEND">OVERVIEW OF MINIVEND
</A></H1>
If you want to get started, just jump to <EM>QUICK START</EM> below. The following section describes how MiniVend works.
<P>
<P>
<HR>
<H2><A NAME="The_Vend_Concept">The Vend Concept
</A></H2>
MiniVend is a descendent of Vend, originally developed by Andrew Wilcox.
Though the original Vend was much simpler than MiniVend in implementation,
the basic concept remains unchanged. Quite simply, MiniVend maintains its
own set of pages, <EM>outside of regular HTML space</EM>, which contain special tags that are interpreted by MiniVend.
<P>
The tags, which are in [square brackets], are interpreted by MiniVend and
many different values can be substituted. Some examples are:
<P>
<DL>
<DT><STRONG><A NAME="item_User">User form input
</A></STRONG><DD>
MiniVend remembers input by a user from form to form, and the value of any
form variable is ``remembered'' and inserted upon finding a <CODE>[value input_field]</CODE>
tag. The <CODE>input_field</CODE> is a normal
<FONT SIZE=-1>HTML</FONT> form field.
<P>
<DT><STRONG><A NAME="item_Database">Database contents
</A></STRONG><DD>
MiniVend can have an unlimited number of attached databases, either in one of its own internal formats or attached via
<FONT SIZE=-1>SQL/ODBC.</FONT> The contents of a database can be referenced with tags like
<CODE>[data table=products field=name key=334-12]</CODE>.
<P>
<DT><STRONG><A NAME="item_Session">Session parameters
</A></STRONG><DD>
Things like where the user originally found your catalog (<CODE>[data session source]</CODE>
and <CODE>[data session referer]</CODE>), domain they are from (<CODE>[data session host]</CODE>), the time of their last access (<CODE>[data session time]</CODE>), and many other parameters.
<P>
<DT><STRONG><A NAME="item_File">File contents or program output
</A></STRONG><DD>
You can insert the contents of an outboard file with <CODE>[file directory/file]</CODE>, or the output from an arbitrary program (given proper permission from
your administrator!).
<P>
<DT><STRONG><A NAME="item_Searches">Searches of files
</A></STRONG><DD>
MiniVend supports different search engines, including <EM>Glimpse</EM>, or you can call your own and have MiniVend process the output for you.
<P>
</DL>
There are over 80 different distinct tags supporting hundreds of functions.
<P>
<P>
<HR>
<H2><A NAME="A_typical_user_session">A typical user session
</A></H2>
The user hears about your catalog via a search engine, link from another page, or click-thru from a banner ad. They access the link, which is a
<FONT SIZE=-1>URL</FONT> pointing to the MiniVend link program (called
<FONT SIZE=-1>VLINK</FONT> or
<FONT SIZE=-1>TLINK,</FONT> more on that below). The MiniVend server is already running on your system, and your catalog has been designed and tested.
<P>
The link program, which is a regular
<FONT SIZE=-1>CGI</FONT> program, calls the MiniVend server. The MiniVend server sees the path information which is appended to the
<FONT SIZE=-1>URL</FONT> calling it, and brings up the corresponding page. The page contains a link to order items from your catalog.
<P>
The user clicks on the link and MiniVend looks in the a <EM>products</EM> database, finds the item, and places it in the user's shopping cart. (Each
user has a separate shopping cart, which is attached to their <EM>session</EM>.)
<P>
Once the user decides to purchase, they check out by filling out a form
with their name, address, payment information, etc. In the process they may
make choices about how the product should be shipped, how they will pay,
and provide any other information you may ask for. They then place (or
``submit'') the order.
<P>
Their payment may be taken at that point via CyberCash and a soft-goods product downloaded -- or their order information may be simply sent to you, the store owner, via encrypted email or
<FONT SIZE=-1>FAX.</FONT> The order is saved to a file or database table as backup, or in the case of fully-automated systems sent directly to an order entry program or database link.
<P>
All of these operations are fully configurable by you. The base MiniVend
distribution includes a sample store -- some users have simply customized
the text and images inside, changed the database entries, and opened their
store. You will probably want to fully customize for a distinctive catalog
look and feel.
<P>
<P>
<HR>
<H2><A NAME="How_MiniVend_Manages_Sessions">How MiniVend Manages Sessions
</A></H2>
Normally, each request for a World Wide Web page which comes in to a server
stands on its own. While the server will probably know which machine a
request comes from, it may not know if the next request comes from the same
browser or even from the same user on that machine.
<P>
MiniVend keeps track of who is ordering what by including in the
<FONT SIZE=-1>URL</FONT> a
<EM>session id</EM>, which is a random piece of text which is different for each customer
browsing the catalog.
<P>
This session
<FONT SIZE=-1>ID</FONT> is either tracked with cookies, or it can be passed along through special URLs within catalog pages. Pages in the catalog served by MiniVend running as a cgi-bin program generate a special
<FONT SIZE=-1>URL</FONT> for every link. Here is an example of such a
<FONT SIZE=-1>URL:</FONT>
<P>
<PRE> <A HREF="http://machine.company.com/cgi-bin/simple/browse?WehUkATn">http://machine.company.com/cgi-bin/simple/browse?WehUkATn</A>;arg;1
</PRE>
<P>
An explanation of each part:
<P>
<DL>
<DT><STRONG><A NAME="item_machine">machine.company.com
</A></STRONG><DD>
Internet address of the server hosting the MiniVend catalog.
<P>
<DT><STRONG><A NAME="item_cgi">cgi-bin
</A></STRONG><DD>
Informs server that the requested page will be generated by a program.
<P>
<DT><STRONG><A NAME="item_simple">simple
</A></STRONG><DD>
Name of the program to run
<P>
<DT><STRONG><A NAME="item_browse">browse
</A></STRONG><DD>
Page of the catalog to display
<P>
<DT><STRONG><A NAME="item_WehUkATn">WehUkATn
</A></STRONG><DD>
The session
<FONT SIZE=-1>ID</FONT>
<P>
<DT><STRONG><A NAME="item__">;
</A></STRONG><DD>
Separates session
<FONT SIZE=-1>ID</FONT> from argument.
<P>
<DT><STRONG><A NAME="item_arg">arg
</A></STRONG><DD>
An argument which can be used by MiniVend to select page display options.
<P>
<DT><STRONG>;
</A></STRONG><DD>
Separates argument from the unique integer.
<P>
<LI><STRONG><A NAME="item_">
</A></STRONG>
<FONT SIZE=-1>A</FONT> unique integer (or source code, if it contains a letter) which prevents caching servers from caching the
<FONT SIZE=-1>URL.</FONT>
<P>
</DL>
<P>
<HR>
<H2><A NAME="Page_Delivery">Page Delivery
</A></H2>
MiniVend pages are written in regular
<FONT SIZE=-1>HTML</FONT> with extensions to support catalog ordering.
MiniVend extensions look like:
<P>
<PRE> [page specials]See our specials![/page]
</PRE>
<P>
Pages are delivered through the following steps:
<P>
<UL>
<LI><STRONG></STRONG>
The
<FONT SIZE=-1>HTTPD</FONT> server (Apache, Netscape, or
<FONT SIZE=-1>NCSA</FONT> are examples of
<FONT SIZE=-1>HTTP</FONT> servers) receives a request for a MiniVend page.
<P>
<LI><STRONG></STRONG>
The server is already running as a daemon, and the request calls a small
<FONT SIZE=-1>C</FONT> program (source is vlink.c or tlink.c) that is
<EM>named according to which catalog is being called.</EM> This program communicates with the MiniVend program via a
<FONT SIZE=-1>UNIX-</FONT> or INET-domain socket.
<P>
<LI><STRONG></STRONG>
MiniVend reads the source page from the MiniVend pages directory, and
interprets the MiniVend tags in the file. If the page doesn't exist, and
corresponds to a part number in the database, it is built ``on the fly''
using a template page. In the process, it may read or modify any number of
database tables. If the user's browser doesn't accept cookies, then any
links generated on the page will contain the <EM>session ID</EM>, which is needed to ensure the user's session is retained.
<P>
<LI><STRONG></STRONG>
The page, which is now entirely in regular
<FONT SIZE=-1>HTML,</FONT> is delivered to the
<FONT SIZE=-1>HTTP</FONT> server, which returns it to the browser.
<P>
</UL>
<P>
<HR>
<H1><A NAME="DISTRIBUTION_AND_SUPPORT_INFORMA">DISTRIBUTION AND SUPPORT INFORMATION
</A></H1>
MiniVend is normally free of charge, and is distributed under the
<FONT SIZE=-1>GNU</FONT> general public license. This means that
individuals and organizations, both commercial and non-commercial, may use
MiniVend without charge. If you modify and redistribute it, there are
certain obligations you must fulfill. See the file <STRONG>Copying</STRONG> which came with your MiniVend distribution for the full license.
<P>
MiniVend is not guaranteed to be supported other than by making full source
code available. If it breaks you get to keep both pieces. However, the
author is always looking to improve MiniVend and sometimes answers
questions. The more concise and better-researched your question, the more
likely it is to get an answer. No tutorials will be provided, though. You
have to learn all of this stuff on your own.
<P>
<P>
<HR>
<H2><A NAME="Where_to_Download_MiniVend">Where to Download MiniVend
</A></H2>
The MiniVend version described in this document is available from:
<P>
<PRE> <A HREF="http://www.minivend.com/minivend/download.html">http://www.minivend.com/minivend/download.html</A>
</PRE>
<P>
You can also go to any
<FONT SIZE=-1>CPAN</FONT> archive and access the directory
<CODE>authors/id/MIKEH</CODE>.
<P>
<P>
<HR>
<H2><A NAME="Perl">Perl
</A></H2>
You will need Perl version 5.004 or higher to run MiniVend 3.09. Many sites are still running lower Perl versions. In addition, on systems that do not have
<FONT SIZE=-1>GDBM</FONT> or DB_File installed, memory problems may occur. Large catalogs will use large amounts of memory if the databases must all reside there.
<P>
You can download the latest Perl 5 from any
<FONT SIZE=-1>CPAN</FONT> (Comprehensive Perl Archive Network) site. Here
are some of the many:
<P>
<FONT SIZE=-1>NORTH</FONT>
<FONT SIZE=-1>AMERICA</FONT>
<P>
<PRE> Florida
<A HREF="ftp://ftp.cis.ufl.edu/pub/perl/CPAN/">ftp://ftp.cis.ufl.edu/pub/perl/CPAN/</A>
Illinois
<A HREF="ftp://uiarchive.cso.uiuc.edu/pub/lang/perl/CPAN/">ftp://uiarchive.cso.uiuc.edu/pub/lang/perl/CPAN/</A>
Massachusetts
<A HREF="ftp://ftp.delphi.com/pub/mirrors/packages/perl/CPAN/">ftp://ftp.delphi.com/pub/mirrors/packages/perl/CPAN/</A>
Oklahoma
<A HREF="ftp://ftp.uoknor.edu/mirrors/CPAN/">ftp://ftp.uoknor.edu/mirrors/CPAN/</A>
Texas
<A HREF="ftp://ftp.metronet.com/pub/perl/">ftp://ftp.metronet.com/pub/perl/</A>
<A HREF="ftp://ftp.sedl.org/pub/mirrors/CPAN/">ftp://ftp.sedl.org/pub/mirrors/CPAN/</A>
<A HREF="ftp://ftp.sterling.com/programming/languages/perl/">ftp://ftp.sterling.com/programming/languages/perl/</A>
</PRE>
<P>
<FONT SIZE=-1>EUROPE</FONT>
<P>
<PRE> Czech Republic
<A HREF="ftp://sunsite.mff.cuni.cz/Languages/Perl/CPAN/">ftp://sunsite.mff.cuni.cz/Languages/Perl/CPAN/</A>
Finland
<A HREF="ftp://ftp.funet.fi/pub/languages/perl/CPAN/">ftp://ftp.funet.fi/pub/languages/perl/CPAN/</A>
France
<A HREF="ftp://ftp.ibp.fr/pub/perl/CPAN/">ftp://ftp.ibp.fr/pub/perl/CPAN/</A>
<A HREF="ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/">ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/</A>
Germany
<A HREF="ftp://ftp.leo.org/pub/comp/programming/languages/perl/CPAN/">ftp://ftp.leo.org/pub/comp/programming/languages/perl/CPAN/</A>
<A HREF="ftp://ftp.rz.ruhr-uni-bochum.de/pub/programming/languages/perl/CPAN/">ftp://ftp.rz.ruhr-uni-bochum.de/pub/programming/languages/perl/CPAN/</A>
Great Britain
<A HREF="ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/">ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/</A>
<A HREF="ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/">ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/</A>
The Netherlands
<A HREF="ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/">ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/</A>
Poland
<A HREF="ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/">ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/</A>
Portugal
<A HREF="ftp://ftp.ci.uminho.pt/pub/lang/perl/">ftp://ftp.ci.uminho.pt/pub/lang/perl/</A>
Slovenia
<A HREF="ftp://ftp.arnes.si/software/perl/CPAN/">ftp://ftp.arnes.si/software/perl/CPAN/</A>
Sweden
<A HREF="ftp://ftp.sunet.se/pub/lang/perl/CPAN/">ftp://ftp.sunet.se/pub/lang/perl/CPAN/</A>
Switzerland
<A HREF="ftp://ftp.switch.ch/mirror/CPAN/">ftp://ftp.switch.ch/mirror/CPAN/</A>
</PRE>
<P>
<FONT SIZE=-1>AUSTRALASIA</FONT>
<P>
<PRE> Australia
<A HREF="ftp://coombs.anu.edu.au/pub/perl/CPAN/">ftp://coombs.anu.edu.au/pub/perl/CPAN/</A>
<A HREF="ftp://ftp.mame.mu.oz.au/pub/perl/CPAN/">ftp://ftp.mame.mu.oz.au/pub/perl/CPAN/</A>
New Zealand
<A HREF="ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/">ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/</A>
</PRE>
<P>
<FONT SIZE=-1>ASIA</FONT>
<P>
<PRE> Japan
<A HREF="ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/">ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/</A>
Taiwan
<A HREF="ftp://dongpo.math.ncu.edu.tw/perl/CPAN/">ftp://dongpo.math.ncu.edu.tw/perl/CPAN/</A>
</PRE>
<P>
<FONT SIZE=-1>AFRICA</FONT>
<P>
<PRE> South Africa
<A HREF="ftp://ftp.is.co.za/programming/perl/CPAN/">ftp://ftp.is.co.za/programming/perl/CPAN/</A>
</PRE>
<P>
Windows users will need to obtain the Standard version Perl, also known as
the <EM>Gurusamy Sarathy</EM> or <EM>CORE</EM> version, from the directory <CODE>ports/win32/Standard/x86</CODE>.
<P>
<P>
<HR>
<H2><A NAME="Setup_for_HTTP_Servers">Setup for HTTP Servers
</A></H2>
The most important issue with MiniVend is the permissions with which the
<FONT SIZE=-1>CGI</FONT> program and the MiniVend server run.
<P>
MiniVend uses a server running <EM>in the background</EM>, with a small
<FONT SIZE=-1>C</FONT> program (generically called <CODE>vlink</CODE>) that communicates with MiniVend via a UNIX-domain socket.
<P>
To improve security, MiniVend normally runs with the socket file having 0600 permissions (rw-------), which mandates that the
<FONT SIZE=-1>CGI</FONT> program and the server run
<EM>as the same user ID</EM>. This means that the <CODE>vlink</CODE> program must be
<FONT SIZE=-1>SUID</FONT> to the same user
<FONT SIZE=-1>ID</FONT> as the server executes under. (Or that
<FONT SIZE=-1>CGIWRAP</FONT> is used on a single catalog system).
<P>
With MiniVend 3.0 multiple catalog capability, the permissions situation
gets a bit tricky. MiniVend comes with a program,
<CODE>makecat</CODE>, which configures catalogs for a multiple catalog system. It should
properly set up ownership and permissions for multiple users if run as the
superuser.
<P>
<P>
<HR>
<H1><A NAME="QUICK_START">QUICK START
</A></H1>
Obtain, decompress and untar the distribution:
<P>
<PRE> gzip -dc minivend-3.09.tar.gz | tar xvf -
</PRE>
<P>
<FONT SIZE=-1>NOTE</FONT>
<FONT SIZE=-1>FOR</FONT>
<FONT SIZE=-1>WINDOWS:</FONT> Windows users need to unzip the file WinZip or a similar program or obtain the self-extracting executable.
<P>
Before installing, check the site where you obtained MiniVend for any
patches that might have been issued since the release.
<P>
Change to the created directory, something like:
<P>
<PRE> cd minivend-3.09
</PRE>
<P>
Run the configure script with:
<P>
<PRE> ./configure
</PRE>
<P>
<FONT SIZE=-1>NOTE</FONT>
<FONT SIZE=-1>FOR</FONT>
<FONT SIZE=-1>WINDOWS:</FONT> Type
<CODE>configure</CODE> instead. The ./ is needed for
<FONT SIZE=-1>UNIX</FONT> users with a properly setup shell.
<P>
If you have trouble with ./configure, try this:
<P>
<PRE> perl Makefile.PL
make
make test
make install
</PRE>
<P>
Replace the <CODE>perl</CODE> with the proper path to your Perl 5.004 or higher binary.
<P>
You will be asked for the directory where you want to install MiniVend -- any directory will do. You must of course have write permission there; and you will eventually need to have write permission on your
<FONT SIZE=-1>CGI-BIN</FONT> and
<FONT SIZE=-1>HTML</FONT> directories. This directory is referred to later in the documentation as
<STRONG>VendRoot</STRONG> or the <STRONG>MiniVend software directory</STRONG>.
<P>
The process should be self-explanatory. If you have trouble answering the
questions asked, <STRONG>look closely</STRONG> at the examples provided. If you still have trouble, you will need to find a tutorial about the World Wide Web -- the
<FONT SIZE=-1>WWW</FONT>
<FONT SIZE=-1>FAQ</FONT> at www.boutell.com would be a good place to look.
<P>
If you discover any problems, refer to the section <EM>If something goes wrong</EM>. Otherwise, MiniVend should be installed at the completion of the script.
It is strongly suggested that you install the demo catalogs as a starting
point for your own catalog -- in fact you will not be able to run MiniVend
until you have created a catalog.
<P>
You will want separate directories to hold the catalog pages and databases.
The <CODE>makecat</CODE> program supplied with MiniVend will make those for you.
<P>
<STRONG>IMPORTANT NOTE:</STRONG> One point that is to be emphasized --
<EM>only your base html pages go in the document space of your http server.</EM>
Any pages with MiniVend elements/tags go in the directory set by the
<EM>PageDir</EM> directive (the default is <CODE>~/catalogs/catalog_name/pages</CODE>). For the demos supplied with MiniVend, this means that only a few pages will be copied to your
<FONT SIZE=-1>HTML</FONT> directory, with the remainder of the pages staying in the directory defined as
<EM>PageDir</EM>.
<P>
If you are on an
<FONT SIZE=-1>ISP</FONT> where <STRONG>all</STRONG> of your files are in
<FONT SIZE=-1>HTML</FONT> document space, you should disable all access to your MiniVend catalog directory with the proper
<FONT SIZE=-1>HTTP</FONT> access restrictions. Normally that is creating a .htaccess file like this:
<P>
<PRE> <Limit GET POST>
order allow,deny
deny from all
</Limit>
</PRE>
<P>
If you are unable to do this, it is recommended that you do not run MiniVend. If you can set file permissions such that files will not be served, it may be
<FONT SIZE=-1>OK,</FONT> but security will be a problem. Please be careful with your customers' personal information.
<P>
<P>
<HR>
<H2><A NAME="The_Catalog">The Catalog
</A></H2>
MiniVend pages are
<FONT SIZE=-1>NOT</FONT> in normal
<FONT SIZE=-1>HTML</FONT> space. They are contained in the
<EM>catalog directory</EM>. Each individual catalog must have its own base directory. The catalog
directory has this structure by default:
<P>
<DL>
<DT><STRONG><A NAME="item_catalog">catalog.cfg
</A></STRONG><DD>
File containing configuration directives for this catalog. (Subcatalogs
have differing information in a file named for the subcatalog.)
<P>
<DT><STRONG><A NAME="item_config">config
</A></STRONG><DD>
Directory that will be read when directives are set with the <filename notation. For example, the file <CODE>config/static.pages</CODE>
will be read when the directive
<P>
<PRE> StaticPage <static.pages
</PRE>
<P>
is encountered in the catalog.cfg file.
<P>
<DT><STRONG><A NAME="item_error">error.log
</A></STRONG><DD>
File which contains catalog-specific errors.
<EM>Check this file when something doesn't work right.</EM>
It is also where any syntax errors in embedded Perl code will be shown.
<P>
<DT><STRONG><A NAME="item_etc">etc
</A></STRONG><DD>
Directory that contains logs, order profiles, and other information. If the <EM>ScratchDir</EM> directive is not redefined (it is set to the directory
<A HREF="#item_tmp">tmp</A> in the simple demo) then search overflow files and cache files will be
based there as well.
<P>
<DT><STRONG><A NAME="item_pages">pages
</A></STRONG><DD>
Directory that contains the pages of your catalog. This can be considered
to be the ``document root'' of the catalog. Pages contained therein are
called with the path information after the script name -- i.e. <CODE>/cgi-bin/simple/products/gold</CODE> will call the page in the file <CODE>pages/products/gold.html</CODE>.
<P>
<DT><STRONG><A NAME="item_products">products
</A></STRONG><DD>
Directory containing database source files, including the special MiniVend
databases shipping.asc, accessories.asc, pricing.asc (and other shipping
database files)
<P>
<DT><STRONG><A NAME="item_reconfig">reconfig
</A></STRONG><DD>
<FONT SIZE=-1>A</FONT> script file, which when executed, will cause the catalog.cfg file to be re-read and the catalog configuration to change. If errors occur, the catalog will stay with its old/previous configuration. This script is set up by the makecat program, but may require editing if you deviate from the standard MiniVend configuration. It operates by executing the link program that is contained in the
<FONT SIZE=-1>CGI</FONT> directory and passing the proper parameters through the environment.
<P>
<DT><STRONG><A NAME="item_session">session
</A></STRONG><DD>
Directory which contains session files when
<FONT SIZE=-1>DBM</FONT> sessions are not in use.
<P>
<DT><STRONG><A NAME="item_session">session.gdbm (or session.db)
</A></STRONG><DD>
The
<FONT SIZE=-1>GDBM</FONT> or DB_File session database file. This is a
<FONT SIZE=-1>DBM</FONT> database that contains the user sessions.
<P>
<DT><STRONG><A NAME="item_tmp">tmp
</A></STRONG><DD>
In the simple demo, this is where the cache and search paging files are