code: 01.02
section: MiniVend_General_Information
type: item
title: Where can I get MiniVend?  How much does it cost?

<A NAME="Where_can_I_get_MiniVend_How_mu">Where can I get MiniVend?  How much does it cost?</A></H2>
<P>
You simply download it from:

<P>
<PRE>    <A HREF="http://www.minivend.com/minivend/download.html">http://www.minivend.com/minivend/download.html</A>
</PRE>
<P>
It also sometimes appears in the Comprehensive Perl Archive Network 
<FONT SIZE=-1>(CPAN)</FONT> library. There are over 40 
<FONT SIZE=-1>CPAN</FONT> sites worldwide. The master site is ftp.funet.fi, with mirror sites located on every continent except Antarctica. MiniVend is available in the directory:


<P>
<PRE>    CPAN/authors/id/MIKEH
</PRE>
<P>
where 
<FONT SIZE=-1>CPAN</FONT> is the base 
<FONT SIZE=-1>URL</FONT> for any 
<FONT SIZE=-1>CPAN</FONT> site. 
<FONT SIZE=-1>A</FONT> list of 
<FONT SIZE=-1>CPAN</FONT> locations is always available at


<P>
<PRE>    <A HREF="http://www.perl.com/CPAN/">http://www.perl.com/CPAN/</A>
</PRE>
<P>
As to cost, MiniVend is <EM>free</EM> within the confines of the 
<FONT SIZE=-1>GNU</FONT> General Public License. Basically, any individual
or company can use MiniVend free of charge -- you have certain
responsibilities if you modify your copy then redistribute it.

<P>
<HR>


code: 01.03
section: MiniVend_General_Information
type: item
title: What else do I need to run MiniVend?

<A NAME="What_else_do_I_need_to_run_MiniV">What else do I need to run MiniVend?</A></H2>
<P>
MiniVend is a complex system requiring the services of other complex pieces
of hardware and software. While it can be very easy to install, you must
look at the ongoing environment as well as just the initial installation.

<DL>
<DT><STRONG><A NAME="item_Perl">Perl</A></STRONG><DD>

First of all, you need a recent Perl. MiniVend later than 3.06 will not run
on anything less than Perl 5.004; 5.005 is recommended but not essential.

<P><DT><STRONG>Perl modules</STRONG><DD>

MiniVend <EM>will</EM> run with a stock Perl, but to use some features of MiniVend (like the admin interface and catalog build ``wizard'') you will need some extra modules. If you are on 
<FONT SIZE=-1>UNIX</FONT> you can use the 
<FONT SIZE=-1>CPAN</FONT> module and run:


<P>
<PRE>        perl -MCPAN -e 'install Bundle::Minivend'
</PRE>
<P>
and it should install all of the modules necessary except the 
<FONT SIZE=-1>DBM/DBI</FONT> ones.

<P>
These modules are strongly recommended:

<P>
<PRE>        MD5
        MIME::Base64
        URI::URL
        Data::Dumper (comes with Perl 5.005)
        GDBM or DB_File (comes with most i386 Perls)
</PRE>
<P>
These are definitely recommended:

<P>
<PRE>        Storable
        SQL::Statement
        Bundle::LWP (contains MIME::Base64 and URI::URL)
</PRE>
<P>
These are nice to have but are not essential:

<P>
<PRE>        Business::UPS (comes with MiniVend)
        Term::ReadLine::Perl
        Term::ReadKey
</PRE>
<P>
You will need the <STRONG>DBI</STRONG> module if using 
<FONT SIZE=-1>SQL,</FONT> along with the appropriate 
<FONT SIZE=-1>DBD</FONT> module for your database.


<P>
The recommended packages for ActiveState Perl for Windows are:

<P>
<PRE>        MD5
        MIME::Base64
        LWP
</PRE>
<P>
The MiniVend setup program will attempt to use <CODE>ppm.pl</CODE>, the ActivePerl package manager, to install them at installation time.

<P><DT><STRONG><A NAME="item_Operating">Operating System</A></STRONG><DD>


<FONT SIZE=-1>UNIX</FONT> is best. The Windows version, while perhaps more than just a toy, is not suitable for high-volume catalog serving. This is mostly due to 
<FONT SIZE=-1>NT</FONT> not fitting the 
<FONT SIZE=-1>UNIX</FONT> <CODE>fork()</CODE> model which works so well with MiniVend.


<P>

<FONT SIZE=-1>A</FONT> catalog designed on a Windows machine should just move over to a 
<FONT SIZE=-1>UNIX</FONT> machine with no changes, so Windows might be a suitable development environment.


<P><DT><STRONG><A NAME="item_Machine">Machine</A></STRONG><DD>

The server should be fast and have lots of memory. 
<FONT SIZE=-1>A</FONT> 200MHz Pentium Pro or equivalent with 
<FONT SIZE=-1>128MB</FONT> of 
<FONT SIZE=-1>RAM</FONT> works well and can serve many catalogs if that is all it does.


<P>
If you are located on a machine with many hundreds of domains, as sometimes
happens with low-cost hosting operations, you can expect some problems. It
is difficult to maintain a stable environment with that many users.

<P></DL>
<P>
MiniVend will run about as well as the platform beneath it. It routinely
runs for months non-stop in a stable environment.

<P>
<HR>


code: 01.04
section: MiniVend_General_Information
type: item
title: If you are having problems

<A NAME="If_you_are_having_problems">If you are having problems</A></H2>
<P>
MiniVend is not guaranteed to be supported in any fashion other than to
make full source code of the current version available. However, the author
is interested in making MiniVend as reliable and trouble-free as possible.
Forward bug reports, questions and comments to the mail list, <A
HREF="mailto:minivend-users@minivend.com.">minivend-users@minivend.com.</A>

<P>
MiniVend is powerful and correspondingly complex. If you are looking to
``point-and-click'' your way to a catalog, you probably should look
elsewhere.

<P>
Do understand that any problems answered in this 
<FONT SIZE=-1>FAQ</FONT> or the documentation may be ignored if you don't:

<UL>
<LI>

mention that you have referenced appropriate items.

<P><LI>

include the various version information that is appropriate.

<P><LI>

mention what is (or is not) in the error.log files

<P></UL>
<P>
The official MiniVend web site is:

<P>
<PRE>    <A HREF="http://www.minivend.com/minivend/">http://www.minivend.com/minivend/</A>
</PRE>
<P>
The latest version of the software, this 
<FONT SIZE=-1>FAQ,</FONT> and the documentation, are available there. Your
problem may not be unique -- check the site first.

<P>
The most common problem on 
<FONT SIZE=-1>UNIX</FONT> is receiving the ``We're sorry, the MiniVend server is unavailable...'' message. This almost always means that permissions are not properly set up, or that the 
<FONT SIZE=-1>VLINK</FONT> program is not setuid (this means that a program runs as a possibly different user 
<FONT SIZE=-1>ID,</FONT> and is enabled with the 
<FONT SIZE=-1>UNIX</FONT> command ``chmod u+s &lt;
file&gt;''). Try temporarily changing the permission of the
MINIVEND_ROOT/etc/socket file to be read/write to all groups (<CODE>chmod 666
etc/socket</CODE>). If MiniVend then works you will have to make sure the user that the 
<FONT SIZE=-1>VLINK</FONT> program runs as matches the user who is running
the MiniVend daemon. It is usual to create a special <CODE>mvend</CODE> or <CODE>minivend</CODE> user to run the daemon and the link program. This means the directory listing for your 
<FONT SIZE=-1>CGI-BIN</FONT> should be something like:


<P>
<PRE>   -rwsr-xr-x   1 minivend users        6312 Dec 30 11:39 cgi-bin/simple
</PRE>
<P>
and for the socket file it should be:

<P>
<PRE>   srw-------   1 minivend users           0 Dec 30 11:41 etc/socket
</PRE>
<P>
See the next section for troubles with running MiniVend on 
<FONT SIZE=-1>ISP</FONT> sites.

<P>
The most common problem on Windows is receiving ``Bad command or file name'' when trying to run the self-extracting 
<FONT SIZE=-1>ZIP</FONT> installation. This means that Perl 5.004 is not installed on your machine or is not in your path. You must properly install Perl 5.004 before extracting.


<P>
Beyond that, if you are unable to get MiniVend installed you should check
to see if you can run <EM>any</EM> 
<FONT SIZE=-1>CGI</FONT> program from the path it is trying to use. The
next most common problem is the user giving the wrong information to <CODE>makecat</CODE>.

<P>
MiniVend is intended to work on Perl Version 5.004 and higher, but the
author does not have the resources (read time) to regression test all
versions with the different versions of Perl. MiniVend will definitely be
tested with the last major release of Perl at the time of package release.
As of this writing, MiniVend's version is 3.12 and Perl's latest version is
5.005_02.

<P>
<STRONG>Please understand that the first remedy in the case of unknown problems will</STRONG>

<STRONG>be to upgrade Perl to the latest version.</STRONG>



<P>
<HR>


code: 01.05
section: MiniVend_General_Information
type: item
title: Information Needed for Support

<A NAME="Information_Needed_for_Support">Information Needed for Support</A></H2>
<P>
First, check the the official MiniVend web site for information:

<P>
<PRE>    <A HREF="http://www.minivend.com/minivend/">http://www.minivend.com/minivend/</A>
</PRE>
<P>
If you are unable to get MiniVend installed, it is almost always a problem
with the Perl installation. Common problems include:

<UL>
<LI>

Broken development versions of Perl. In particular, FreeBSD and 
<FONT SIZE=-1>BSDI</FONT> sometimes ship with development versions.
Solution is to update Perl.

<P><LI>

Your Perl has threading enabled. This may cause problems for MiniVend on
some operating systems. Try building a Perl without threading.

<P><LI>

Occupied default port (7786) or interfering firewall during the test. This
causes 'make test' to fail while MiniVend might still work just fine.

<P><LI>

Bad installation of Perl. This is often an inexperienced system administrator who copies the Perl binary directly to a system bin directory without using 'make install'. 
<FONT SIZE=-1>A</FONT> proper Perl will need to be installed.


<P><LI>

Inadequate system privileges or quota restrictions. If you have a virtual
memory quota then MiniVend can easily exceed it.

<P><LI>


<FONT SIZE=-1>A</FONT> Perl earlier than 5.004 is a problematical installation. It may work if your Perl is properly set up and you have a good 
<FONT SIZE=-1>C</FONT> compiler available, but it may not. Update to Perl 5.005.


<P><LI>

Solaris 2.x with an inadequate 
<FONT SIZE=-1>C</FONT> compiler will not be able to compile vlink.c and
tlink.c. Use tlink.pl as your link program.

<P></UL>
<P>
There are many more possible problems. See the 
<FONT SIZE=-1>README</FONT> file for other OS-specific problems.

<P>
Second, double check that you have done the following things:

<UL>
<LI>

Checked <EM><STRONG>all</STRONG></EM> of the error.log files? There is one for each catalog, and a global one in
the MiniVend software root directory.

<P><LI>

The <EM>vlink</EM> program is 
<FONT SIZE=-1>SUID,</FONT> or you have made appropriate changes in the <EM>ReadPermission</EM> and <EM>WritePermission</EM> directives. With MiniVend 3.0, you should try 
<FONT SIZE=-1>INET</FONT> mode.

<P><LI>

If you run 
<FONT SIZE=-1>CGI-WRAP,</FONT> have you turned off the 
<FONT SIZE=-1>SUID</FONT> bit for vlink with a ``chmod 755 cgi-bin/simple'' or the like?
  

<P><LI>

Have you tried copying the 
<FONT SIZE=-1>INET</FONT> mode link program <CODE>tlink</CODE> over the
<CODE>cgi-bin/simple</CODE> or <CODE>simple.cgi</CODE> program?

<P><LI>

That you have proper permissions on all files that need to be written. This includes the product database 
<FONT SIZE=-1>ASCII</FONT> source files, needed because of locking.


<P><LI>

If the function in question is from an external program (such as 
<FONT SIZE=-1>PGP)</FONT> you have tried the command <EM>as shown in the directive</EM>
from the command line.

<P><LI>

The vlink 
<FONT SIZE=-1>CGI</FONT> program is being executed on a machine that has
the socket file <EM>etc/socket</EM> on a directly attached disk. UNIX-domain sockets will not work on
NFS-mounted filesystems! That means the server <EM>minivend.pl</EM> and the 
<FONT SIZE=-1>CGI</FONT> program <EM>vlink</EM> must be executing on the same machine. As of MiniVend 2.03, you can use 
<FONT SIZE=-1>INET</FONT> mode and the tlink program instead if you must cross 
<FONT SIZE=-1>NFS</FONT> boundaries.


<P></UL>
<P>
If you have a problem you are not able to correct, and you have taken all
of those steps, you can send email to the MiniVend users list:

<P>
<PRE>    minivend-users@minivend.com
</PRE>
<P>
Please include your <STRONG>operating system name</STRONG> and <STRONG>version</STRONG>, your
<STRONG>Perl version</STRONG>, the <STRONG>DBM library in use</STRONG>, and the contents of 
<FONT SIZE=-1>ALL</FONT> error logs.

<P>
Please see this if you don't get an answer:

<P>
<PRE>    <A HREF="http://www.minivend.com/minivend/the_authors_life.txt">http://www.minivend.com/minivend/the_authors_life.txt</A>
</PRE>
<P>
MiniVend is an ambitious and complex program, and is not presented as being <EM>easy to use</EM>, <EM>easy to install</EM>, or <EM>bug-free</EM>. The configuration script was done to try and make a very painful process
only slightly painful. Some people install in one pass. Others never make
it. Determined and thoughtful users almost always make MiniVend work.

<P>
<HR>


code: 01.06
section: MiniVend_General_Information
type: item
title: If you are intending to run MiniVend on an ISP

<A NAME="If_you_are_intending_to_run_Mini">If you are intending to run MiniVend on an ISP</A></H2>
<P>
The great majority of ISPs provide some 
<FONT SIZE=-1>CGI</FONT> service, and more and more run systems that are compatible with MiniVend. The catalog configurator for MiniVend is designed to figure out many 
<FONT SIZE=-1>ISP</FONT> directory setups.


<P>
Almost any Internet Service Provider 
<FONT SIZE=-1>(ISP)</FONT> system
<EM>should</EM> be able to run MiniVend, but some cannot (or will not) run MiniVend at all. On top of that, many times 
<FONT SIZE=-1>ISP</FONT> personnel are too busy to help, won't help, or don't know enough to help. Some are secretive about details of the setup of their systems.


<P>
MiniVend does require a stable platform underneath it. Many 
<FONT SIZE=-1>ISP</FONT> servers are heavily loaded (especially low-cost
ones). If you run on a server which is constantly running out of memory and
file descriptors, you will not be happy with your results with MiniVend.

<P>
Virtual servers that don't provide shell access are not really usable for MiniVend without direct support from the 
<FONT SIZE=-1>ISP</FONT> -- unless you are a CGI/Perl wizard who can figure out how to do it. 8-) It can be done (with a good deal of difficulty) on some virtual servers.


<P>
Iserver.com and others who use an chroot 
<FONT SIZE=-1>HTTP</FONT> daemon for each user will require some
source-code twiddling to get the paths for vlink right -- the catalog
configurator will not do the trick. See the mail list archives for the
hack.

<P>
MiniVend does require a lot of memory, and it does run as a daemon. You will find that that vexes a fair number of ISPs. 
<FONT SIZE=-1>I</FONT> have found it difficult to provide power and speed without using memory, so it will have to stay that way for the time being.


<P>
All in all, you can have a fair amount of confidence that your 
<FONT SIZE=-1>ISP</FONT> can run MiniVend. Or, you can get one who will.
8-)

<P>
<HR>


code: 01.07
section: MiniVend_General_Information
type: item
title: How can I unzip the file?

<A NAME="How_can_I_unzip_the_file_">How can I unzip the file?</A></H2>
<P>
MiniVend is now distributed in a self-extracting zip. If you don't want to install it there, use your 
<FONT SIZE=-1>ZIP</FONT> program to extract to a directory and then run
 <CODE>setup.bat</CODE> or <CODE>configure.bat</CODE>.

<P>
The 
<FONT SIZE=-1>ZIP</FONT> file is identical to the tar file except for the
presence of two files, <CODE>cygwin.dll</CODE> and <CODE>setup.bat</CODE>.

<P>
If you are planning on installing it on 
<FONT SIZE=-1>UNIX,</FONT> it really should be untarred on a 
<FONT SIZE=-1>UNIX</FONT> machine. Though some Windows 
<FONT SIZE=-1>ZIP</FONT> clients will handle the file type, it is best if you just get the 
<FONT SIZE=-1>README</FONT> file from the same place you got the distribution and read that.


<P>
On the 
<FONT SIZE=-1>UNIX</FONT> machine, typically your company server or 
<FONT SIZE=-1>ISP</FONT> server, you need to do:


<P>
<PRE>    gzip -dc minivend-X.XX.tar.gz | tar xvf -
</PRE>
<P>
If you have transferred the file to your Wintel machine before then transferring it to the 
<FONT SIZE=-1>ISP,</FONT> make sure you have done all transfers in 
<FONT SIZE=-1>BINARY</FONT> mode. You will have weird problems if you have made one or more of the transfers in 
<FONT SIZE=-1>ASCII</FONT> mode.


<P>
<HR>


code: 01.08
section: MiniVend_General_Information
type: item
title: About Vend, MiniVend's parent

<A NAME="About_Vend_MiniVend_s_parent">About Vend, MiniVend's parent</A></H2>
<P>
Vend was written by Andrew Wilcox in the early part of 1995, and the first released (beta) version was 0.2. Vend 0.2 is the parent of MiniVend, and the first version of MiniVend (called Vend 0.2m7) was totally based on that. It added searching and 
<FONT SIZE=-1>DBM</FONT> catalog storage. Subsequent versions took parts from Vend 0.3, especially the 
<FONT SIZE=-1>VLINK</FONT> and Server.pm modules, which were adapted to run with MiniVend.


<P>
The first release of MiniVend (1.0) was on February 23, 1996, making it nearly three years old. 
<FONT SIZE=-1>A</FONT> veritable eon in web time!


<P>
Other portions of Vend, notably the database interface from 0.3, were
adopted, but there are distinct differences between MiniVend and Vend.

<P>
Andrew is no longer working on Vend, and all questions and comments
regarding both Vend and MiniVend should be directed to Mike Heins, &lt;<A
HREF="mailto:mikeh@minivend.com">mikeh@minivend.com</A>&gt;

<P>
<HR>


code: 01.09
section: MiniVend_General_Information
type: item
title: Why doesn't my question get an answer?

<A NAME="Why_doesn_t_my_question_get_an_a">Why doesn't my question get an answer?</A></H2>
<P>
Usually it is for one of the following reasons:

<UL>
<LI>

It is of the ``It doesn't work. 
<FONT SIZE=-1>HEEELLLP!!!''</FONT> variety. Such messages are usually
ignored by people on the mail list. (They figure you need help if you are
posting a question.)

<P><LI>

The question is posted in 
<FONT SIZE=-1>HTML.</FONT> Many people don't have HTML-capable mailers and will not bother to read it. Your message is more likely to be answered if you put it in plain old 
<FONT SIZE=-1>ASCII</FONT> format.


<P><LI>

You used the wrong return email address, or you spam-blocked the email
address. Most people will not field the instructions nor bother to re-send
when it bounces.

<P><LI>

The subject line is not informative. ``[item-list] tag'' is better than
``It doesn't work''.

<P><LI>

Information needed for support is not included or is not intelligible. Version of MiniVend, operating system and/or virtual server type, 
<FONT SIZE=-1>HTTP</FONT> server (i.e. Apache), and database in use are all relevant to most questions.


<P><LI>

Question is answered in this 
<FONT SIZE=-1>FAQ,</FONT> the 
<FONT SIZE=-1>README,</FONT> or by doing a simple text search (with keywords you mention) in the documentation. Most people won't do manual reading for you -- they expect you to take the time yourself.


<P><LI>

The message does not mention what is in all of the error logs, i.e. both the main error.log and your catalog error.log. 
<FONT SIZE=-1>HTTP</FONT> server error log entries are also nice to know about, though it is understood that many people don't have access to them.


<P><LI>

The message does not mention what is 
<FONT SIZE=-1>NOT</FONT> in the error logs. If you don't mention it, it
will be presumed you did not look.

<P><LI>

No one knows the answer.

<P></UL>
<P>
<HR>


code: 01.10
section: MiniVend_General_Information
type: item
title: Is MiniVend secure?

<A NAME="Is_MiniVend_secure_">Is MiniVend secure?</A></H2>
<P>
Maybe. It has been downloaded over 100,000 times (availability at 50+ 
<FONT SIZE=-1>FTP</FONT> sites means it is unknown how many more times than
that) with no reported <EM>system</EM> security problems. It uses the Perl Safe.pm module for user-embedded Perl
subroutines and conditionals to make use of those pretty carefree.

<P>
However, there are definite potential problems with credit card number
security that can be avoided:

<UL>
<LI>

<STRONG>Unencrypted credit card numbers stored on disk.</STRONG>



<P>
If you don't use the CreditCardAuto capability for encrypting credit card
numbers, or the supplied CyberCash interface, then there will be
unencrypted credit card numbers present in your session database files.

<P>
If your system is the target of a break in, then these numbers would be available to any user 
<FONT SIZE=-1>ID</FONT> that can read the session files.


<P>
This is the reason MiniVend defaults to read/write permission for the
MiniVend user only.

<P><LI>

<STRONG>Unencrypted credit card numbers sent via email.</STRONG>



<P>
The same things apply for orders sent via email. If it is not encrypted with 
<FONT SIZE=-1>PGP,</FONT> then it is at risk.


<P>
The default demos also store the orders in the file etc/tracking.asc, so
you should check there as well if you want to scrub existing credit card
numbers on disk.

<P><LI>

Running in 
<FONT SIZE=-1>INET</FONT> mode from another machine.

<P>
If you are using 
<FONT SIZE=-1>INET</FONT> mode, and the transmission is going via the
network to another machine (i.e. not localhost), then you should be
possibly concerned about which wires your SSL-encrypted data is traveling
over. You should be behind a firewall, firewall router, or at least some
sort of spoofing-protected filter.

<P></UL>
<P>
The bottom line is that security needs to be your concern. MiniVend tries
to warn you and provide means for protecting customer data, but it can't
stop you from doing all unwise things. The author stands behind the license
for MiniVend and disclaims all responsibility.

<P>
<HR>


code: 01.11
section: MiniVend_General_Information
type: item
title: What HTML editors work with MiniVend?

<A NAME="What_HTML_editors_work_with_Mini">What HTML editors work with MiniVend?</A></H2>
<P>
None, really, though you can embed many MiniVend tags inside of regular 
<FONT SIZE=-1>HTML</FONT> with things like:

<P>
<PRE>    &lt;A HREF=&quot;[href minivend_page]&quot;&gt;Link&lt;/A&gt;
    &lt;SCRIPT LANGUAGE=MV MV=&quot;set Action&quot;&gt;
        mv_todo=return
        mv_nextpage=your_page
    &lt;/SCRIPT&gt;
</PRE>
<P>
In most cases you will have to edit MiniVend pages by hand.

<P>
(MiniVend 3.09 is the first version to allow tags to be embedded within regular 
<FONT SIZE=-1>HTML.)</FONT>


<P>
<HR>


code: 01.12
section: MiniVend_General_Information
type: item
title: How does MiniVend compare with other shopping carts?

<A NAME="How_does_MiniVend_compare_with_o">How does MiniVend compare with other shopping carts?</A></H2>
<P>
MiniVend is a full-featured shopping cart with high-end power. It can and
does maintain databases of hundreds of thousands of items or more, and is
frequently used in catalogs with hundreds or many thousands of items.

<P>
MiniVend is a database-based shopping cart, and has a complex
implementation and a fairly steep learning curve. If all you are ever going
to catalog is just a few items, and/or the items will not frequently
change, MiniVend may be overkill for your needs. It may make more sense to
go with a simpler cart that embeds the product information in the page and
does not require database setup.

<P>
Things that might call for the use of MiniVend:

<UL>
<LI>

hundreds of items or more

<P><LI>

many different catalogs maintained by same organization

<P><LI>

product offering will frequently change

<P><LI>

need for programmable product display

<P><LI>

need for complex ordering interaction

<P><LI>

delivery of soft goods after real-time charge of credit cards

<P><LI>

need flexible searching and categorization options

<P></UL>
<P>
When Minivend might not be the right choice and you might want to use
another free cart

<UL>
<LI>

only a few items

<P><LI>

items will not change much

<P></UL>
<P>
When to consider a commercial product

<UL>
<LI>

you want power, but want to interact only through a site building system like 
<FONT SIZE=-1>MS</FONT> Front Page or Page Mill


<P><LI>

you want to interact only through a 
<FONT SIZE=-1>GUI</FONT> like Windows and not edit files

<P></UL>
<P>
When comparing MiniVend to commercial products, the comparison is better
drawn to the higher end ones costing thousands of dollars rather than the
low end ones costing hundreds of dollars.

<P>
Subjectively, people have both good and bad experiences with MiniVend.

<P>
<PRE>    After investing tens of thousands of dollars and almost
    a year of effort in commercial software, we switched
    to MiniVend and were operational within weeks.
    -- large corporation
   
        MiniVend is too difficult for the user to configure. There
        are too many things that must be gotten just so.
        -- Small internet service provider
</PRE>
<P>
<PRE>    I really like the new site, its laid out well and the
    documentation is so good I've decided to use it even though
    I'm not a programmer.
    -- happy prospective user
</PRE>
<P>
<PRE>        Your documentation is awful.
        -- not-so-happy prospective user
</PRE>
<P>
<PRE>    Your documentation is some of the best and most comprehensive
    we have seen for a freeware program.
    -- happy user
</PRE>
<P>
<PRE>        And the your pages don't have the right information in
        them and that's MY FAULT? How about the fact that your
        configure script acts differently every time it gets run?
        -- not-so-happy user
</PRE>
<P>
(Obviously, mileage varies with the user. Thankfully, the happy ones *seem*
to outnumber the unhappy ones by 10 to 1 or more...)

<P>
Despite being free, MiniVend will require an investment -- either your time
or the money to engage a consultant skilled in the web and in databases. If
given its due, MiniVend can provide power that no other free shopping cart
has.

<P>
<HR>


code: 01.12
section: MiniVend_General_Information
type: item
title: What can you expect in the way of support?

<A NAME="What_can_you_expect_in_the_way_o">What can you expect in the way of support?</A></H2>
<P>
(This is the author, Mike Heins, speaking.)

<P>

<FONT SIZE=-1>I</FONT> am interested in creating a better MiniVend.
However, it has become pretty popular and you should not expect individual
support.

<P>
What 
<FONT SIZE=-1>I</FONT> will typically do:

<UL>
<LI>

Follow up on cogent bug reports, usually with fairly quick response. 
<FONT SIZE=-1>A</FONT> bug is not that you cannot install MiniVend -- it is a demonstrated fault in the program logic that can be duplicated. 
<FONT SIZE=-1>A</FONT> cogent bug report is detailed and concise, and includes HTML/code snippets that demonstrate the problem.


<P><LI>

Take note of faults in the demo. Any fixes will be discussed on the mailing
list and <EM>may</EM> be fixed in the next release version of MiniVend. The demo is a demo -- it
is not a finished application.

<P><LI>

Take note of faults in the documentation and update the next release
version of MiniVend. If you provide edited replacement text it is
appreciated. The documentation source is available if you would like to see
how it is maintained.

<P><LI>

Try to answer well-presented questions that appear on the mailing list.

<P><LI>

Try to constantly and incrementally improve the 
<FONT SIZE=-1>FAQ</FONT> and other supporting information.

<P></UL>
<P>
All of these are things 
<FONT SIZE=-1>I</FONT> try to do. There is no commitment -- check your license for MiniVend. All are done on a time-available basis. If you don't include all relevant information 
<FONT SIZE=-1>I</FONT> will probably ignore the question. 
<FONT SIZE=-1>I</FONT> answer on the mailing list so that information can get to more people and be archived for posterity.


<P>
What 
<FONT SIZE=-1>I</FONT> will not do:

<UL>
<LI>

Answer questions that are 
<FONT SIZE=-1>URGENT</FONT> or cry for 
<FONT SIZE=-1>HELLLPPP!!!!</FONT>


<P><LI>

Conduct tutorials.

<P><LI>

Visit a 
<FONT SIZE=-1>URL</FONT> to look at a problem.

<P><LI>

Conduct a 
<FONT SIZE=-1>Q&amp;A</FONT> to extract needed information.

<P><LI>

Accept phone calls about MiniVend.

<P></UL>
<P>
<HR>


code: 01.13
section: MiniVend_General_Information
type: item
title: Where can I get more help?

<A NAME="Where_can_I_get_more_help_">Where can I get more help?</A></H2>
<P>
If you cannot work with MiniVend without more help, you should engage a consultant to help with integration and administration. The ideal consultant will have a complete understanding of web servers, 
<FONT SIZE=-1>HTML,</FONT> databases, and Perl.


<P>
The author is sometimes available for consulting on MiniVend, and offers a
seminar on using and employing MiniVend.

<P>
If you cannot find a consultant, you might post to the mail list and
solicit help. Several competent consultants frequent the list and may
respond.

<P>
<HR>


code: 02.00
section: MiniVend_General_Information
type: overview
title: MiniVend General Information

<A NAME="MiniVend_General_Information">MiniVend General Information</A></H1>
<P>
MiniVend is a freely-redistributable electronic catalog, otherwise known as a shopping cart. It serves any number of catalogs via the World Wide Web, allowing users to select items for placement on their shopping list, or cart, and then buy them by filling out an order form. Since MiniVend supports Secure Sockets Layer 
<FONT SIZE=-1>(SSL),</FONT> the customer can securely put their credit card number in the form if you have an 
<FONT SIZE=-1>HTTP</FONT> server that supports 
<FONT SIZE=-1>SSL.</FONT>


<P>
MiniVend supports a host of features -- a complete list is available at its
web home page:

<P>
<PRE>        <A HREF="http://www.minivend.com/minivend/">http://www.minivend.com/minivend/</A>
</PRE>
<P>
MiniVend is written and maintained by Mike Heins, but much credit goes to
Andrew Wilcox, who originated Vend and created many of the underlying
algorithms.

<P>
MiniVend is freely redistributable under the 
<FONT SIZE=-1>GNU</FONT> General Public License, a copy of which should come with every MiniVend package. Basically this means that you can use it for commercial or non-commercial purposes for free, but you you have certain responsibilities if you modify and/or redistribute it. See the 
<FONT SIZE=-1>GNU</FONT> 
<FONT SIZE=-1>GPL</FONT> for more information.


<P>
<HR>


code: 02.02
section: Windows_specific_questions
type: item
title: &quot;Bad command or file name&quot; when double-clicking on the EXE

<A NAME="_Bad_command_or_file_name_when_">&quot;Bad command or file name&quot; when double-clicking on the EXE</A></H2>
<P>
This means Perl is not in your 
<FONT SIZE=-1>PATH</FONT> or is not installed.

<P>
You can use a 
<FONT SIZE=-1>ZIP</FONT> program to extract the archive to a temporary
directory and then either:

<UL>
<LI>

Edit the file setup.bat and replace the call to ``perl Makefile.PL'' with
``c:\full\path\to\perl Makefile.pl''

<P><LI>

Enter the minivend-3.0x directory and issue the command
``c:\full\path\to\perl Makefile.pl''

<P></UL>
<P>
If you still have problems, it probably means Perl is not installed
properly. You need the either the ActiveState 5.005 version, or the 5.004
version, variously known as the <EM>Gurusamy Sarathy</EM>, <EM>core</EM>, or <EM>standard</EM> version. See this page for pointers to the latest Perl:

<P>
<PRE>    <A HREF="http://www.perl.com/pace/pub/perldocs/latest.html">http://www.perl.com/pace/pub/perldocs/latest.html</A>
</PRE>
<P>
See the Perl distribution for details on how to install it, the MiniVend
README-win.txt file for pointers to exact URLs, or visit

<P>
<PRE>    <A HREF="http://www.perl.com">http://www.perl.com</A>
</PRE>
<P>
for more information.

<P>
<STRONG>NOTE:</STRONG> MiniVend will <STRONG>not</STRONG> work with the ActiveState version 5.003 build 3xx distributed with the 
<FONT SIZE=-1>NT</FONT> resource kit.

<P>
<HR>


code: 02.02
section: Windows_specific_questions
type: item
title: Install fails &quot;Can't copy Start MiniVend Server.pif&quot;

<A NAME="Install_fails_Can_t_copy_Start_">Install fails &quot;Can't copy Start MiniVend Server.pif&quot;</A></H2>
<P>
This is caused by an intermittent failure in the Win32::Shortcut module (or
my application of it). In any case, unzip the file, and run ``setup''.
If/when it fails with this error, create a file named ``Start MiniVend
Server.pif'' and rerun the installation. 

<P>
This problem should be eliminated in MiniVend 3.12.

<P>
<HR>


code: 02.03
section: Windows_specific_questions
type: item
title: Search paging doesn't work for Windows.

<A NAME="Search_paging_doesn_t_work_for_W">Search paging doesn't work for Windows.</A></H2>
<P>
There is a bug in MiniVend 3.06 which fails to account for Windows not
being able to have a colon (:) in a filename.

<P>
This is fixed in MiniVend 3.07 and above.

<P>
<HR>


code: 03.00
section: Windows_specific_questions
type: overview
title: Windows-specific questions

<A NAME="Windows_specific_questions">Windows-specific questions</A></H1>
<P>
<HR>


code: 03.02
section: Configuration_Problems
type: item
title: VLINK or TLINK compile problems

<A NAME="VLINK_or_TLINK_compile_problems">VLINK or TLINK compile problems</A></H2>
<P>
(None of this is valid for Windows. Use the precompiled <CODE>tlink.exe</CODE>.)

<P>
The latest version of <CODE>vlink.c</CODE> and <CODE>tlink.c</CODE> have been compiled on the following systems:

<P>
<PRE>    BSD2.0 (Pentium/x86)
    FreeBSD 2.1
    SunOS 4.1.4
    Solaris 2.4 (Sun compiler)
    Solaris 2.5 (GCC, but not all versions)
    Linux 1.2.13
    Linux 2.0.x
    IRIX 5.3
    Digital Unix (OSF/Alpha)
    AIX 4.1
    SCO OpenServer 5.x
</PRE>
<P>
Some problems may occur. In general, you can ignore warnings about
pointers.

<P>
Make sure that you have run the configure program in the src directory. If
you used MiniVend's configuration, and selected the default of compiling
those programs, the configuration was run, and all of the proper libraries
should be used.

<P>
You can compile manually with the proper settings with this series of
commands:

<P>
<PRE>    cd src
    ./configure
    perl -e 'do &quot;syscfg&quot;; system (&quot;$CC $CFLAGS $DEFS $LIBS -o tlink tlink.c&quot;)'
    perl -e 'do &quot;syscfg&quot;; system (&quot;$CC $CFLAGS $DEFS $LIBS -o vlink vlink.c&quot;)'
</PRE>
<P>
There is also a ``compile.pl'' script which will compile with the current
settings.

<P>
If you cannot compile, try using the <CODE>tlink.pl</CODE> script which should work on most any system.

<P>
<HR>


code: 03.03
section: Configuration_Problems
type: item
title: We're sorry, the MiniVend server is unavailable...

<A NAME="We_re_sorry_the_MiniVend_server">We're sorry, the MiniVend server is unavailable...</A></H2>
<P>
This is the most common problem on 
<FONT SIZE=-1>UNIX</FONT> systems. It almost always means that permissions are not properly set up, or that the 
<FONT SIZE=-1>VLINK</FONT> program is not setuid. Try temporarily changing the permission of the MINIVEND_ROOT/etc/socket file to be read/write to all groups (
<CODE>chmod 666 etc/socket</CODE>). This must be done <EM>after</EM> the server is started, as MiniVend deletes and recreates the socket every time it starts. If MiniVend then works you will have to make sure the user that the 
<FONT SIZE=-1>VLINK</FONT> program runs as matches the user who is running the MiniVend daemon.


<P>
&lt;
<FONT SIZE=-1>HR&gt;</FONT>
<STRONG>It is not recommended that you install the MiniVend software
as <CODE>root</CODE>.</STRONG> If you are setting MiniVend up for the entire machine, and not just as a
virtual host user, it is usual to create a special <CODE>mvend</CODE> or <CODE>minivend</CODE> user to run the daemon and the link program. This means the directory listing for your 
<FONT SIZE=-1>CGI-BIN</FONT> should be something like:


<P>
-rwsr-xr-x 1 minivend users 6312 Dec 30 11:39 cgi-bin/simple

<P>
and for the socket file it should be:

<P>
srw------- 1 minivend users 0 Dec 30 11:41 etc/socket

<P>
Once you have set up the software, you can easily install catalogs as root <STRONG>as long as your <CODE>umask</CODE> is set to 2 or 22</STRONG>.

<P>
(The following assumes you have made the MiniVend software owned and run by
the special user <CODE>mvend</CODE> and that each user has a MiniVend catalogs directory <CODE>/home/user/catalogs</CODE>).

<P>
<EM>The following policies should be automatically offered when
installing MiniVend 3.06 or higher.</EM>



<P>
The best way to set permissions on a multi-user system is to make all files
group readable and writable (660 or 664 mode). If you have a system setup
that places each user in their own group, then make
<CODE>mvend</CODE> a member of each user's group and set ownership and permissions with:

<P>
find /home/user/catalogs -print | xargs chown user find /home/user/catalogs
-print | xargs chgrp user find /home/user/catalogs -print | xargs chmod
g+rw

<P>
For best results, make the user's default umask be 2 so that they will by
default create files that have the proper permissions.

<P>
If you have all users in the same group, the above is not secure. You
should put <CODE>mvend</CODE> in a group of which no user is a member (perhaps mvend would be a good
choice) and then make all files owned by the group mvend and all
directories be set to mode 2775:

<P>
find /home/user/catalogs -print | xargs chown user find /home/user/catalogs
-print | xargs chgrp mvend find /home/user/catalogs -print | xargs chmod
g+rw find /home/user/catalogs -type d -print | xargs chmod g+s

<P>
This will make files default to the proper group when created (on most 
<FONT SIZE=-1>UNIX</FONT> versions, anyway). 
<FONT SIZE=-1>&lt;HR&gt;</FONT>


<P>
If you are on a virtual hosting system, the procedure varies. Making the program setuid should work for most systems -- if your setup uses 
<FONT SIZE=-1>CGI-WRAP</FONT> or another setuid scheme it should still work 
<FONT SIZE=-1>OK,</FONT> though you may have to

<EM>unset</EM> the setuid bit with <CODE>chmod u-s cgi-bin/simple</CODE> or the like. If you have a non-standard 
<FONT SIZE=-1>CGI</FONT> setup, as some virtual host systems do, you will need to know something about 
<FONT SIZE=-1>UNIX</FONT> and the web -- or engage a consultant -- to properly set the paths up. Usually switching to 
<FONT SIZE=-1>TLINK/INET</FONT> mode is the easiest thing to do, though with
 <STRONG>Iserver</STRONG> and a few others it may take more than that. 
<FONT SIZE=-1>&lt;HR&gt;</FONT>

<P>
If you used the <CODE>makecat</CODE> program to build the catalog, it should warn you if it was not able to make
the link program setuid. To set the program (in the file <CODE>cgi-bin/simple</CODE> in this example) to be setuid, you use the command:

<P>
<PRE>    chmod u+s cgi-bin/simple
</PRE>
<P>
<STRONG>Please understand that the first remedy in the case of unknown problems will
be to upgrade Perl to the latest version.</STRONG>



<P>
<HR>


code: 03.04
section: Configuration_Problems
type: item
title: Error -- the MiniVend server was not running...

<A NAME="Error_the_MiniVend_server_was">Error -- the MiniVend server was not running...</A></H2>
<P>
This indicates that the link 
<FONT SIZE=-1>CGI</FONT> is not communicating with the MiniVend server.

<P>
<STRONG>IMPORTANT NOTE:</STRONG> The server should always be started by the same user 
<FONT SIZE=-1>ID</FONT> which owns the suid
<EM>vlink</EM> program. (This does not apply to 
<FONT SIZE=-1>TLINK/INET</FONT> mode.)

<P>
The server must be running, first of all. If you didn't start it, you can
do so by going to the <STRONG>MiniVend home directory</STRONG> and typing:

<P>
<PRE>    bin/start
</PRE>
<P>
You can check to see if your server is running by typing:

<P>
<PRE>    Linux, SunOS, BSD:    ps -ax | grep minivend
    Most other systems:   ps -elf | grep minivend
</PRE>
<P>
<STRONG>Note</STRONG>: Solaris and 
<FONT SIZE=-1>IRIX</FONT> truncate the string, and doesn't allow setting of
the <CODE>$0</CODE> parameter. You may have to grep for 'perl' instead.

<P>
If the server is not running, it may have failed due to another process occupying the 
<FONT SIZE=-1>TCP</FONT> socket 7786. If using 
<FONT SIZE=-1>VLINK,</FONT> you may start MiniVend with 'start -u', which will not monitor the internet-domain socket.


<P>
If 
<FONT SIZE=-1>VLINK</FONT> is not communicating with the server, there are a number of possible reasons. First, if you are trying to run MiniVend on an 
<FONT SIZE=-1>ISP,</FONT> go to the section about 
<FONT SIZE=-1>ISP</FONT> problems -- it is probably one of those. If you are running MiniVend on a single machine, it is probably one of:


<P>
<PRE>    1. Permissions problems
    2. MiniVend on NFS-mounted file system
</PRE>
<P>
Permissions are easy. If you for some reason can't run 
<FONT SIZE=-1>VLINK</FONT> as an 
<FONT SIZE=-1>SUID</FONT> program 
<FONT SIZE=-1>(SUID</FONT> to your user 
<FONT SIZE=-1>ID,</FONT> not to root), then you will need to make permissions more permissive. See the MiniVend documentation for how to use the ReadPermission and WritePermission directives to make the session files and sockets 'group' or 'world' readable and writable. If you can make your 
<FONT SIZE=-1>UID,</FONT> or the one you have chosen to own MiniVend, the same group as your 
<FONT SIZE=-1>HTTP</FONT> user, then you can make the files group read-write. If you can't, you will have to set the dreaded 'world' permissions.


<P>
If you are running MiniVend on an NFS-mounted file system it cannot run in server mode, because UNIX-domain sockets don't work on 
<FONT SIZE=-1>NFS.</FONT> You will need to change to static mode from server mode, or better yet, put MiniVend on a file system that is directly mounted.


<P>
As of MiniVend 2.03, you can use MiniVend in 
<FONT SIZE=-1>INET</FONT> mode along with the tlink.c program to allow running across 
<FONT SIZE=-1>NFS</FONT> boundaries. If you have not changed the configured defaults, and still it will not communicate, you should try setting the 
<FONT SIZE=-1>LINK_HOST</FONT> and 
<FONT SIZE=-1>LINK_PORT</FONT> directives in tlink.c and recompiling. &lt;hr&gt;


<P>
<HR>


code: 03.05
section: Configuration_Problems
type: item
title: I get messages like 'Config.pm not found'. What does it mean?

<A NAME="I_get_messages_like_Config_pm_n">I get messages like 'Config.pm not found'. What does it mean?</A></H2>
<P>
This means your Perl is not properly installed, or that MiniVend is not using the proper Perl binary. On 
<FONT SIZE=-1>UNIX,</FONT> try reinstalling MiniVend and using the standard Perl installation sequence:


<P>
<PRE>    /complete/path/to/proper/perl Makefile.PL
    make
    make test
    make install
</PRE>
<P>
Otherwise, contact your system administrator.

<P>
<HR>


code: 03.06
section: Configuration_Problems
type: item
title: Your demo has a very large price for the first item, and when I change the quantity the price drops precipitously.

<A NAME="Your_demo_has_a_very_large_price">Your demo has a very large price for the first item, and when I change the quantity the price drops precipitously.</A></H2>
<P>
This is a feeble attempt at humor. Check out the <STRONG>Quantity Pricing</STRONG>
feature of MiniVend. Try looking at:

<P>
<PRE>    <A HREF="http://www.minivend.com/cgi-bin/simple/quantity">http://www.minivend.com/cgi-bin/simple/quantity</A>?;00-0011
</PRE>
<P>
<HR>


code: 03.07
section: Configuration_Problems
type: item
title: Can't locate lib.pm in @INC. BEGIN failed--compilation aborted.

<A NAME="Can_t_locate_lib_pm_in_INC_BEG">Can't locate lib.pm in @INC. BEGIN failed--compilation aborted.</A></H2>
<P>
Your Perl is not properly installed. Someone has put a Perl up on your
system, then either moved or removed the library directory.

<P>
Contact your system administrator and ask them to re-install Perl.

<P>
<HR>


code: 03.08
section: Configuration_Problems
type: item
title: Can I run MiniVend on my Macintosh?

<A NAME="Can_I_run_MiniVend_on_my_Macinto">Can I run MiniVend on my Macintosh?</A></H2>
<P>
No. MiniVend will not run on a Macintosh running System 7 or other
``Finder'' operating system. If some technically-oriented user would port
it, or someone will give MiniVend's author a PowerMac, then it might. 8-)

<P>
MiniVend's *files* can be manipulated by any computer. As long as uploads/downloads of database source, pages, and configuration files are done in 
<FONT SIZE=-1>ASCII</FONT> mode, there is no reason you can't edit them on your Mac. And with MySQL or other 
<FONT SIZE=-1>ODBC</FONT> databases on your UNIX-based 
<FONT SIZE=-1>ISP,</FONT> you can even directly interface to the database you use with MiniVend -- provided you have the scarce 
<FONT SIZE=-1>ODBC</FONT> middleware needed for the Mac. But you must run it on a 
<FONT SIZE=-1>UNIX</FONT> (or maybe soon on a Win95/NT machine).


<P>
MiniVend <EM>has</EM> been known to run on MkLinux and Linux for the PowerPC.

<P>
<HR>


code: 03.09
section: Configuration_Problems
type: item
title: Shopping cart is dropped when using SSL.

<A NAME="Shopping_cart_is_dropped_when_us">Shopping cart is dropped when using SSL.</A></H2>
<P>
This is usually due to the HostnameLookups (Stronghold/Apache parameter)
not matching for the two servers, secure and non-secure.

<P>
If it still does not work, then try changing some of the appropriate
configuration parameters in minivend.cfg:

<P>
<PRE>    DomainTail   No
    IpHead       Yes
</PRE>
<P>
The above setting will typically make MiniVend work when it is possible to
work.

<DL>
<DT><STRONG><A NAME="item_MiniVend">MiniVend 3.11 and above</A></STRONG><DD>

If you use 
<FONT SIZE=-1>PGP</FONT> for credit card encryption, or CyberCash or some
other secure payment system, then you might try in your catalog.cfg:

<P>
<PRE>    WideOpen Yes
</PRE>
<P>
This completely disables 
<FONT SIZE=-1>IP</FONT> checking.

<P></DL>
<P>
<HR>


code: 03.10
section: Configuration_Problems
type: item
title: Segmentation fault or other core dump

<A NAME="Segmentation_fault_or_other_core">Segmentation fault or other core dump</A></H2>
<P>
If this happens when you run the MiniVend test or server, it is always a
Perl that has a problem. Not sometimes, always.

<P>

<FONT SIZE=-1>A</FONT> proper Perl should never have a segmentation
violation, period. And it should not dump core (unless you passed it a -u
option somehow).

<P>
You will need to either update Perl or report the bug to the proper personnel. Depending on your situation and technical ability, this may be your system admin, 
<FONT SIZE=-1>ISP,</FONT> or the Perl porters.


<P>
<HR>


code: 03.11
section: Configuration_Problems
type: item
title: MiniVend doesn't work with RedHat 5.0 (glibc)

<A NAME="MiniVend_doesn_t_work_with_RedHa">MiniVend doesn't work with RedHat 5.0 (glibc)</A></H2>
<P>
This is a defective Perl distributed by RedHat. The problem is that they don't take 
<FONT SIZE=-1>GLIBC</FONT> into account. It will pass make test 100%, but strftime dumps core on a segfault.


<P>
You can either update your Perl 
<FONT SIZE=-1>RPM,</FONT> or build Perl 5.005 or higher on your machine.
Either should solve the problem.

<P>
<HR>


code: 03.11
section: Configuration_Problems
type: item
title: XXXXXX.pm does not match executable version.

<A NAME="XXXXXX_pm_does_not_match_executa">XXXXXX.pm does not match executable version.</A></H2>
<P>
This is a Perl which does not have the right Perl library installed. It
usually results from a naive system administrator who thinks they can
bypass the 'make install' for Perl and just copy the Perl binary.

<P>
In any case, it has nothing to do with MiniVend when you are running on 
<FONT SIZE=-1>UNIX.</FONT> MiniVend does not include any compiled
libraries.

<P>
<HR>


code: 03.12
section: Configuration_Problems
type: item
title: Read on closed filehandle &amp;lt;STATIC&gt;

<A NAME="Read_on_closed_filehandle_lt_ST">Read on closed filehandle &amp;lt;STATIC&gt;</A></H2>
<P>
This is just a warning caused by a bug in MiniVend 3.02 and is benign.

<P>
To eliminate the warning, go to the catalog directory and do:

<P>
<PRE>    touch pages/.static
</PRE>
<P>
<HR>


code: 04.00
section: Configuration_Problems
type: overview
title: Configuration Problems

<A NAME="Configuration_Problems">Configuration Problems</A></H1>
<P>
Most MiniVend configuration and setup problems are due to one of:

<DL>
<DT><STRONG><A NAME="item_Too">Too-low version of Perl</A></STRONG><DD>

If you have a Perl earlier than 5.004, installation is problematical and
will require diving into the source of MiniVend. Don't try it; update.

<P><DT><STRONG><A NAME="item_Broken">Broken Perl version.</A></STRONG><DD>


<FONT SIZE=-1>BSDI</FONT> and FreeBSD distributions often come with a
version of Perl like 5.003_02 or 5.003_07. These are development versions
of Perl which cannot be used to run MiniVend in the normal course of
events. Get and install Perl 5.004.

<P>
RedHat Linux 5.0 distributed a broken Perl; update it if you have an 
<FONT SIZE=-1>RPM</FONT> earlier than February 1998.

<P><DT><STRONG><A NAME="item_Wrong">Wrong information given to makecat program</A></STRONG><DD>

To install a working demo, MiniVend needs to know what DocumentRoot is and how to run 
<FONT SIZE=-1>CGI</FONT> programs. Details of this setup are server- and site-specific, and you may need to do some research.


<P>
If your web server is Apache or 
<FONT SIZE=-1>NCSA,</FONT> Minivend will try and parse its
<CODE>httpd.conf</CODE> file to help you along, but many ISPs don't allow users to read these and
it may fail.

<P></DL>
<P>
<HR>


code: 04.02
section: ISP_Problems
type: item
title: No shell access allowed on my ISP.

<A NAME="No_shell_access_allowed_on_my_IS">No shell access allowed on my ISP.</A></H2>
<P>
This used to mean that you were totally out of luck. You probably still
are, but it is at least <EM>possible</EM> to run MiniVend on a virtual server such as 
<FONT SIZE=-1>HWY.NET.</FONT>

<P>
You should be able to use the tlink.pl program and 
<FONT SIZE=-1>INET</FONT> mode to start using MiniVend -- with quite a bit
of work. You will need to hand-edit all of the configuration files, and use
tlink.pl with the appropriate settings. Long term, you should put a
compiled tlink in place.

<P>
You will also have to start the MiniVend daemon via a 
<FONT SIZE=-1>CGI</FONT> program that you write.

<P>
Bottom line: don't try this unless most people call you a wizard. 8-)

<P>
The MiniVend web site has pointers to ISPs who happily host MiniVend.

<P>
<HR>


code: 04.03
section: ISP_Problems
type: item
title: No C compiler to compile VLINK or SVEND.

<A NAME="No_C_compiler_to_compile_VLINK_o">No C compiler to compile VLINK or SVEND.</A></H2>
<P>
Since 
<FONT SIZE=-1>VLINK</FONT> needs certain values set in the source before compilation, a pre-compiled version will not work. It is recommended that you get the latest version of MiniVend and run in 
<FONT SIZE=-1>INET</FONT> mode along with the tlink.pl Perl-based link program.


<P>

<FONT SIZE=-1>A</FONT> pre-compiled tlink.c might also work for you if you
can use the defaults of 'localhost' and port 7786.

<P>
<HR>


code: 04.04
section: ISP_Problems
type: item
title: Perl version too low

<A NAME="Perl_version_too_low">Perl version too low</A></H2>
<P>
MiniVend 3.12 requires Perl 5.004 or higher. Perl 5.004_04 or higher is
strongly recommended.

<P>
MiniVend earlier than 3.06 can run on Perl 5.003, but don't expect any
support from the mail list.

<P>
<HR>


code: 04.05
section: ISP_Problems
type: item
title: We're sorry, the MiniVend server is unavailable...

<A NAME="We_re_sorry_the_MiniVend_server">We're sorry, the MiniVend server is unavailable...</A></H2>
<P>
<EM>The below all assume you were able to start the MiniVend server.</EM>



<P>
This could be almost anything, but with a properly configured MiniVend it is almost undoubtedly due to your 
<FONT SIZE=-1>CGI-BIN</FONT> and/or your MiniVend directory being located on a different filesystem than the actual machine that is executing the program. 
<FONT SIZE=-1>VLINK</FONT> uses UNIX-domain sockets, which don't work on NFS-mounted filesystems.


<P>
Iserver.com and other systems which use chroot 
<FONT SIZE=-1>HTTP</FONT> servers require quite a bit of extra
configuration to get going.

<P>
If you have not been careful to set permissions properly when running in 
<FONT SIZE=-1>VLINK/UNIX</FONT> mode, the link 
<FONT SIZE=-1>CGI</FONT> will not be able to communicate with the MiniVend server. Please read the documentation, which covers this in detail.


<P>
As of MiniVend 2.03, you can run in 
<FONT SIZE=-1>INET</FONT> mode with the tlink link program to prevent those
problems.

<P>
<HR>


code: 04.06
section: ISP_Problems
type: item
title: Document contains no data or premature end of script headers (especially on BSDI or FreeBSD)

<A NAME="Document_contains_no_data_or_pre">Document contains no data or premature end of script headers (especially on BSDI or FreeBSD)</A></H2>
<P>
This usually means that your 
<FONT SIZE=-1>HTTP</FONT> server ran out of resources during the execution
of the link program. It couldn't create more sockets, is unable to create a
process, or can't open any more files.

<P>
This happens especially in frames catalogs, when MiniVend is sending more than one page simultaneously. And even more especially on FreeBSD and 
<FONT SIZE=-1>BSDI,</FONT> which are distributed with the kernel parameters 
<FONT SIZE=-1>SOMAXCONN</FONT> and 
<FONT SIZE=-1>CHILD_MAX</FONT> set to levels unsuitable for serving the web.


<P>
Go to

<P>
<PRE>    <A HREF="http://www.dejanews.com">http://www.dejanews.com</A>
</PRE>
<P>
and try searching on 
<FONT SIZE=-1>CHILD_MAX</FONT> -- this should give you plenty of pointers
on how to set those parameters properly.

<P>
<HR>


code: 04.06
section: ISP_Problems
type: item
title: MiniVend server only runs for a while, then dies.

<A NAME="MiniVend_server_only_runs_for_a_">MiniVend server only runs for a while, then dies.</A></H2>
<P>
Many ISPs don't allow your user 
<FONT SIZE=-1>ID</FONT> to run a program unless it is logged in! The moment a watchdog program notices a daemon running with a non-logged-in 
<FONT SIZE=-1>UID,</FONT> it terminates the program. Or it terminates programs that haven't been active for 
<FONT SIZE=-1>XX</FONT> minutes. Contact your 
<FONT SIZE=-1>ISP</FONT> about this -- they may be able to do something for you.


<P>
<HR>


code: 04.07
section: ISP_Problems
type: item
title: My provider runs Windows NT

<A NAME="My_provider_runs_Windows_NT">My provider runs Windows NT</A></H2>
<P>
MiniVend is unlikely to work on Windows 
<FONT SIZE=-1>NT</FONT> ISPs in the near future. If you have a dedicated 
<FONT SIZE=-1>NT</FONT> machine, there is a version of MiniVend for Windows 
<FONT SIZE=-1>NT.</FONT> It may work well for you, but there are differences in operation from the 
<FONT SIZE=-1>UNIX</FONT> version (mostly due to NT's lack of <CODE>fork()</CODE> or and lack of threading support in Perl).


<P>
<HR>


code: 05.00
section: ISP_Problems
type: overview
title: ISP Problems

<A NAME="ISP_Problems">ISP Problems</A></H1>
<P>
Great strides have been made since MiniVend's early days. The great majority of ISPs provide some 
<FONT SIZE=-1>CGI</FONT> service, and more and more run systems that are compatible with MiniVend. The new catalog configurator for MiniVend makes setup much easier.


<P>

<FONT SIZE=-1>A</FONT> word of warning -- if you chose your 
<FONT SIZE=-1>ISP</FONT> mostly on price, you can expect problems. There is no such thing as a free lunch; the low-cost providers typically have heavily-loaded machines and many domains. The more domains and the more load the unhappier you will be with MiniVend. MiniVend works best on a fast machine with plenty of memory.


<P>

<FONT SIZE=-1>A</FONT> few Internet Service Provider 
<FONT SIZE=-1>(ISP)</FONT> systems still have difficulty with one or the other aspect of running MiniVend. 
<FONT SIZE=-1>A</FONT> few cannot (or will not) run MiniVend at all. On top of that, many times 
<FONT SIZE=-1>ISP</FONT> personnel are too busy to help, won't help, or don't know enough to help. Some are secretive about details of the setup of their systems.
 

<P>
All in all, you can have a fair amount of confidence that your 
<FONT SIZE=-1>ISP</FONT> can run MiniVend. Or, you can get one who will.
8-)

<P>
<HR>


code: 05.02
section: Things_about_MiniVend_that_peopl
type: item
title: Is MiniVend a script, an application, or what? Why is it so big?

<A NAME="Is_MiniVend_a_script_an_applica">Is MiniVend a script, an application, or what? Why is it so big?</A></H2>
<P>
MiniVend is not just a script. It is a combination of many programs, Perl modules, and links to other subsystems such as 
<FONT SIZE=-1>SQL</FONT> databases, CyberCash, 
<FONT SIZE=-1>PGP,</FONT> and the Glimpse search engine.


<P>
It is so big because it is more than just a shopping cart -- it is a
complete database access and retrieval application. It uses a lot of memory
because the author got a case of feeping creaturitis and added too many
features while attempting to maintain backward compatibility with older
catalogs.

<P>
This means that MiniVend is probably not a good choice for someone who is
going to offer only a few products. It is optimized for catalogs of more
than a hundred items -- catalogs that expect to change and grow over time.
It is suitable for very large catalogs.

<P>
<HR>


code: 05.03
section: Things_about_MiniVend_that_peopl
type: item
title: What is a daemon? Why is MiniVend a daemon?

<A NAME="What_is_a_daemon_Why_is_MiniVen">What is a daemon? Why is MiniVend a daemon?</A></H2>
<P>

<FONT SIZE=-1>A</FONT> daemon is a program that always is running in the
background on the system, initialized and waiting for something to do.
MiniVend runs as a daemon in the normal course of events.

<P>
Other programs that you may be familiar with that run as daemons in most
cases:

<UL>
<LI>


<FONT SIZE=-1>HTTP</FONT> server (Apache, etc.)

<P><LI>

MySQL, mSQL, Oracle, and other 
<FONT SIZE=-1>SQL</FONT> servers

<P><LI>

Sendmail

<P></UL>
<P>
MiniVend takes an appreciable amount of time to compile and load except on
the fastest systems. It has many configuration options, and can serve
hundreds of catalogs. If it were to be loaded every time a user accessed
it, it would be unusable.

<P>
The daemon approach allows a rich set of features to be accessed fast. The actual 
<FONT SIZE=-1>CGI</FONT> program (vlink or tlink) is a small program written in 
<FONT SIZE=-1>C</FONT> -- it communicates with the minivend daemon.


<P>
One of the side effects of this is that when you change a configuration
file, you must tell MiniVend. You do this either by restarting the server,
or better yet, using the <EM>reconfig</EM> script to reconfigure an individual catalog.

<P>
<HR>


code: 05.04
section: Things_about_MiniVend_that_peopl
type: item
title: Hey, where are the pages?

<A NAME="Hey_where_are_the_pages_">Hey, where are the pages?</A></H2>
<P>
MiniVend pages are not kept in normal 
<FONT SIZE=-1>HTML</FONT> space. Look in the catalog subdirectory pages.

<P>
The pages are always filtered through the MiniVend daemon before being
delivered.

<P>
<HR>


code: 05.05
section: Things_about_MiniVend_that_peopl
type: item
title: Hey, where are the images?

<A NAME="Hey_where_are_the_images_">Hey, where are the images?</A></H2>
<P>
MiniVend is a 
<FONT SIZE=-1>CGI</FONT> program, and if you tried to use relative image paths you would end up with 
<FONT SIZE=-1>IMG</FONT> tags like
 

<P>
<PRE>    &lt;IMG SRC=&quot;/cgi-bin/simple/../whatever.jpg&quot;&gt;
</PRE>
<P>
Not what you want. So MiniVend by default uses an
<CODE>ImageDir</CODE> for a prefix. In the demo that would be <CODE>/simple/images/</CODE>, so image specs that have no absolute path information are prefixed with
that.

<P>
In your MiniVend page, this tag

<P>
<PRE>    &lt;IMG SRC=&quot;ordernow.gif&quot;&gt;
</PRE>
<P>
will become

<P>
<PRE>    &lt;IMG SRC=&quot;/simple/images/ordernow.gif&quot;&gt;
</PRE>
<P>
and this:

<P>
<PRE>    &lt;IMG SRC=&quot;items/00-0011.jpg&quot;&gt;
</PRE>
<P>
will become

<P>
<PRE>    &lt;IMG SRC=&quot;/simple/images/items/00-0011.jpg&quot;&gt;
</PRE>
<P>
Absolute image paths are not affected, so if you reference an image at
/other/images/whatever.gif, it will not be touched.

<P>
<HR>


code: 05.06
section: Things_about_MiniVend_that_peopl
type: item
title: Can I use MiniVend with my existing static catalog pages?

<A NAME="Can_I_use_MiniVend_with_my_exist">Can I use MiniVend with my existing static catalog pages?</A></H2>
<P>
Yes, but you probably won't want to in the long run.

<P>
MiniVend is designed to build pages based on templates, from a database. If
all you want is a shopping cart, you probably should use a simpler program.

<P>
It is not difficult to convert existing static pages to MiniVend, but
maintaining them can be a nightmare.

<P>
<HR>


code: 05.06
section: Things_about_MiniVend_that_peopl
type: item
title: How do you pass variables from page to page?

<A NAME="How_do_you_pass_variables_from_p">How do you pass variables from page to page?</A></H2>
<P>
No effort needed -- MiniVend does this automatically.

<P>
Every user session that is started by MiniVend automatically creates a
variable set for the user. As long as the user session is maintained, and
does not expire, any variables you set on a form will be ``remembered'' in
future sessions.

<P>
Don't use the prefix mv_ for your own variables -- MiniVend treats these
specially and they may not behave as you wish. Use the mv_ variables only
as they are documented.

<P>
Also, because you can set so many variables, MiniVend does not unset
variables it does not find on the current form. That means you can't expect
a checkbox to become unchecked unless you explicitly reset it.

<P>
<HR>


code: 05.07
section: Things_about_MiniVend_that_peopl
type: item
title: How can I tell when I need to quote a tag inside a tag?

<A NAME="How_can_I_tell_when_I_need_to_qu">How can I tell when I need to quote a tag inside a tag?</A></H2>
<P>
In general, you don't need to quote the following tags which are
interpreted first within a list:

<P>
<PRE>    [item-code] [item-data ...] [item-field ...] etc.
    [loop-code] [loop-data ...] [loop-field ...] etc.
    [sql-code]  [sql-data ...]   [sql-field ...] etc.
</PRE>
<P>
This is because they are interpreted as a part of the surrounding <CODE>[loop]</CODE>, <CODE>[item-list]</CODE>, <CODE>[search-list]</CODE>,
<CODE>[sql list]</CODE>, or <CODE>[tag each table]</CODE> constructs.

<P>
So this will work:

<P>
<PRE>    [item-list]
    [page [item-field url]]detailed info[/page] on [item-description]
    [/item-list]
</PRE>
<P>
This will <EM>not</EM> work:

<P>
<PRE>    [page [value mypage]]
</PRE>
<P>
The [value ...] tag is not interpolated before page, and the parser will
not know to do so. It needs to be instead:

<P>
<PRE>    [page href=&quot;[value mypage]&quot;]
</PRE>
<P>
Clear as mud, right? Well, at least if you quote them all you can't go
wrong. 8-)

<P>
<STRONG>IMPORTANT NOTE:</STRONG> The above only applies to <STRONG>New</STRONG> style tags. The old MiniVend 1.x/2.x parser interpolates tags in a highly
ordered fashion and tags are rarely/never quoted. It is no longer
recommended that you use the old parser. If you have constructs which work
under the old parser and that you want to retain, surround them with a
[compat]... the tags ...[/compat] tag pair to send them to the old parser.

<P>
<HR>


code: 06.00
section: Things_about_MiniVend_that_peopl
type: overview
title: Things about MiniVend that people sometimes don't understand....

<A NAME="Things_about_MiniVend_that_peopl">Things about MiniVend that people sometimes don't understand....</A></H1>
<P>
There are a few things that seem to escape some users in the documentation.
This is no doubt due to the author's closeness and familiarity with the
concepts of MiniVend.

<P>
This section attempts to explain some of these basic issues.

<P>
<HR>


code: 06.02
section: Setup_Questions
type: item
title: Can I run multiple catalogs on one server?

<A NAME="Can_I_run_multiple_catalogs_on_o">Can I run multiple catalogs on one server?</A></H2>
<P>
Yes. MiniVend supports multiple independent catalogs. There are users who
run more than 500 catalogs on a single machine. The capacity is usually a
function of how busy the catalogs are and how much memory and processor
speed your system has.

<P>
<HR>


code: 06.03
section: Setup_Questions
type: item
title: How do I start MiniVend when I reboot?

<A NAME="How_do_I_start_MiniVend_when_I_r">How do I start MiniVend when I reboot?</A></H2>
<P>
Use the standard facility on your operating system. For 
<FONT SIZE=-1>BSD</FONT> style systems, the file is usually called rc.local
(in the /etc directory).

<P>
On 
<FONT SIZE=-1>SVR4</FONT> systems, it is quite a bit more complex -- look
for the /etc/rc.d directory and see what other programs do. Often the file
is called S99startup or something similar.

<P>
<STRONG>IMPORTANT NOTE:</STRONG> MiniVend must not run as root, which is the user that the startup file
executes as.

<P>
The technique to start up depends on the facility of your
<CODE>su(1)</CODE> command. This should work on most operating systems:

<P>
<PRE>    su minivend &lt;&lt;EOF
    /your/minivend/dir/bin/start
    EOF
</PRE>
<P>
The <STRONG>EOF</STRONG> must be the only thing on the line (no leading or trailing whitespace).

<P>
If your <CODE>su(1)</CODE> command has a -c option (as most System 5 UNIXes
do) then you can just do:

<P>
<PRE>    su -c /your/minivend/dir/bin/start minivend
</PRE>
<P>
<HR>


code: 06.04
section: Setup_Questions
type: item
title: How do I set up a Mall?

<A NAME="How_do_I_set_up_a_Mall_">How do I set up a Mall?</A></H2>
<P>
MiniVend can share product databases, session files, and any other
databases.

<P>
To make a mall, where all merchants submit orders through one clearing
house, simply share the session file among all of the merchants. Any
ordered items from any of the catalogs will show up in the same shopping
basket.

<P>
There are some caveats. It will be a good idea to add a product attribute
that holds the merchant number, to distinguish between possibly identical
part numbers. This would also mean using the SeparateItems directive to
place all orders on a separate line. MiniVend 3.x does this automatically,
provided the databases are set up as separate files using the <STRONG>ProductFiles</STRONG>
directive.

<P>
Pricing information will only come through if the merchants all share a
product database, or at least share a pricing database. If the second is
desired, you must build a pricing database that holds all merchant part
numbers, ensuring no two are the same, and configure the PriceBreaks
directive to start at quantity 1.

<P>
You can easily have some merchants who share a database and order point,
while others operate completely independent catalogs -- all running from
the same MiniVend server.

<P>
<HR>


code: 06.05
section: Setup_Questions
type: item
title: Can I attach a size or color to a product?

<A NAME="Can_I_attach_a_size_or_color_to_">Can I attach a size or color to a product?</A></H2>
<P>
MiniVend has product modifiers, or attributes, which can be carried around
with the product.

<P>
You can use the <STRONG>SeparateItems</STRONG> directive or set the
<STRONG>mv_separate_items</STRONG> variable on the order form to cause ordered items to be put on separate
lines in the shopping basket. This makes size/color handling much easier
for multiple items. They <EM>can</EM>
be stacked, which means that you can add multiple instances of a size or
color to an individual product within a shopping cart entry line, but this
is too much trouble.

<P>
It is useful to maintain a separate database in the accessories file to
build select and other menus for size selection. The results can key into
an arbitrary database, allowing even more control.

<P>
The attribute information is placed on the form with form fields, like:

<P>
<PRE>    &lt;INPUT TYPE=XXXXX NAME=&quot;[modifier-name size]&quot; VALUE=&quot;[item-modifier size]&quot;&gt;
</PRE>
<P>
The embedded Perl capability of MiniVend means that you can discover the
number of items on order of each type, and build quite detailed input
forms.

<P>
The MiniVend documentation has some examples which should help you.

<P>
As of MiniVend 3.0, the [item-accessories <EM>attribute</EM>] tag will automatically place a suitable select widget on an 
<FONT SIZE=-1>HTML</FONT> form, and ``remember'' what should be selected.
See the MiniVend documentation for
<STRONG>Item Attributes</STRONG>.

<P>
<HR>


code: 06.06
section: Setup_Questions
type: item
title: PGP encryption -- Server Error

<A NAME="PGP_encryption_Server_Error">PGP encryption -- Server Error</A></H2>
<P>
As always, check the error log. The most common problem is something like:

<P>
<PRE>    minivend.com 3Ex5lvta:minivend.com - [01/Sep/1997:09:08:43] simple /cgi-bin/simple
    &gt; Encryption error:
    &gt;
</PRE>
<P>
If the key you are sending to has not been signed by another (trusted) user, then you will get error returns from some flavors of 
<FONT SIZE=-1>PGP,</FONT> which causes the problem. The fix is to route the error output to /dev/null (at least on 
<FONT SIZE=-1>UNIX)</FONT> by changing the EncryptProgram directive in catalog.cfg:


<P>
<PRE>    EncryptProgram  /usr/local/bin/pgp -feat sales@your.com 2&gt;/dev/null
</PRE>
<P>
On Windows or other operating systems, the only fix is to sign the key or
otherwise prevent the error from occurring.

<P>
<HR>


code: 06.07
section: Setup_Questions
type: item
title: PGP encryption -- What do I do now that it is working?

<A NAME="PGP_encryption_What_do_I_do_n">PGP encryption -- What do I do now that it is working?</A></H2>
<P>
This depends on what you do with orders once you receive them by email.

<P>
Some 
<FONT SIZE=-1>PC</FONT> mail agents (notably Eudora) will decrypt the 
<FONT SIZE=-1>PGP</FONT> message embedded within the message text. In that case, you can simply embed the
 <CODE>[value mv_credit_card_info]</CODE> call right in the message and be done with it.

<P>
If your mailer will not decrypt on the fly, the best way to read the credit card number is to set up 
<FONT SIZE=-1>MIME</FONT> encoding of the order email. To do this, find the order report you are using. In the standard demos it is
 <CODE>pages/ord/report.html</CODE> or <CODE>etc/report</CODE>.

<P>
Set up two 
<FONT SIZE=-1>MIME</FONT> regions in that file. First, at the top of the
file:

<P>
<PRE>    [tag mime type TEXT/PLAIN; CHARSET=US-ASCII][/tag]
    [tag mime Order Text]
</PRE>
<P>
<PRE>    ORDER DATE: [calc]localtime[/calc]
    ORDER NUMBER: [value mv_order_number]
</PRE>
<P>
<PRE>    Name: [value name]
    Company: [value company]
</PRE>
<P>
<PRE>    (Rest of order text, including item list)
    [/tag]
</PRE>
<P>
Then, at the bottom of the report.html file, put the credit card info:

<P>
<PRE>    [if value mv_credit_card_info]
    [tag mime type application/pgp-encrypted][/tag]
    [tag mime Credit Card Information]
</PRE>
<P>
<PRE>    [value mv_credit_card_info]
</PRE>
<P>
<PRE>    [/tag]
    [/if]
</PRE>
<P>
Once this is done, you can then read mail, using your 
<FONT SIZE=-1>PGP</FONT> client as a helper application to decode the 
<FONT SIZE=-1>MIME</FONT> attachment. This does not require a fancy setup -- you can use the standard 
<FONT SIZE=-1>MIT</FONT> 
<FONT SIZE=-1>PGP</FONT> 2.6.2 if desired. If you are using 
<FONT SIZE=-1>UNIX,</FONT> set up as the helper for the 
<FONT SIZE=-1>MIME</FONT> type

<STRONG>application/pgp-encrypted</STRONG>:

<P>
<PRE>    xterm -e pgp -m %s
</PRE>
<P>
On windows, it might be:

<P>
<PRE>    c:\mycommands\pgp -m %s
</PRE>
<P>
More automated or user-friendly setups are left as an exercise for the
user.

<P>
<HR>


code: 06.08
section: Setup_Questions
type: item
title: How do I get the number of items in a shopping cart?

<A NAME="How_do_I_get_the_number_of_items">How do I get the number of items in a shopping cart?</A></H2>
<P>
If it is simply the <EM>total</EM> number, extended according to quantity, then you can use the [nitems] tag.
If you need this number for use in an embedded Perl script, you will need
to set <CODE>interpolate=1</CODE> (or user [[nitems]] in the old parser).

<P>
If it is the number of line items you need, then you can use a Perl script:

<P>
<PRE>    [perl carts]
    $#{$Safe{'carts'}-&gt;{'main'}} + 1;
    [/perl]
</PRE>
<P>
(The 'main' refers to the main shopping cart.)

<P>
If you have SeparateItems in effect, and need the number of
<EM>unique</EM> items, you could use:

<P>
<PRE>    [perl]
    $items = q{[item-list][item-code]|[/item-list]};
    @items = split /\|/, $items;
    $count = 0;
    for (@items) {
    $count++ unless $seen{$_}++;
    }
    $count;
    [/perl]
</PRE>
<P>
<HR>


code: 06.09
section: Setup_Questions
type: item
title: The demo doesn't do...(pick one)

<A NAME="The_demo_doesn_t_do_pick_one_">The demo doesn't do...(pick one)</A></H2>
<P>
That is because it is a demo. It is not intended to be a finished catalog,
just a starting point.

<P>
Though the author likes to get reports of malfunctions in the demo, he
feels absolutely no urgency about fixing or responding to such reports.

<P>
<HR>


code: 06.10
section: Setup_Questions
type: item
title: How can I use MiniVend with Microsoft Access?

<A NAME="How_can_I_use_MiniVend_with_Micr">How can I use MiniVend with Microsoft Access?</A></H2>
<P>
Though MiniVend has 
<FONT SIZE=-1>ODBC</FONT> capability, the Microsoft Access 
<FONT SIZE=-1>ODBC</FONT> driver is not a network driver. You cannot access it on a 
<FONT SIZE=-1>PC</FONT> from your 
<FONT SIZE=-1>ISP</FONT> or 
<FONT SIZE=-1>UNIX</FONT> system.


<P>
However, you can turn it around. Once you have created a MySQL or other 
<FONT SIZE=-1>SQL</FONT> database on the 
<FONT SIZE=-1>UNIX</FONT> machine, you may then obtain the Windows 
<FONT SIZE=-1>ODBC</FONT> driver for the database (mySQL has a package called myODBC) and use the 
<FONT SIZE=-1>UNIX</FONT> database as a data source for your PC-based database program.


<P>
Here is a quick procedure that might get you started:

<UL>
<LI>

Get and mySQL from:

<P>
<PRE>    <A HREF="http://www.mysql.com">http://www.mysql.com</A>
</PRE>
<P>
Install it on your 
<FONT SIZE=-1>UNIX</FONT> box. On Linux it is as easy as getting the 
<FONT SIZE=-1>RPM</FONT> distribution:


<P>
<PRE>    <A HREF="http://www.mysql.com/rpm/">http://www.mysql.com/rpm/</A>
</PRE>
<P>
You install it by typing, as root, <CODE>rpm -i mysql-3.XX.XX.rpm</CODE>. If you are not root, you will have to build the source distribution.

<P><LI>

To avoid permissions problems for your testing, stop the mysql daemon and
allow global read-write access with:

<P>
<PRE>    mysqladmin shutdown
    safe_mysqld --skip-grant-tables &amp;
</PRE>
<P>
Obviously, you will want to study mySQL permissions and set up some security pretty quickly. It has excellent capability in that area, and the 
<FONT SIZE=-1>FAQ</FONT> will help you get over the hurdles.


<P><LI>

Set up a database for testing on the 
<FONT SIZE=-1>UNIX</FONT> machine:

<P>
<PRE>    mysqladmin create test_odbc
    mysql test_odbc
</PRE>
<P>
Make an 
<FONT SIZE=-1>SQL</FONT> query to set up a table, for example:

<P>
<PRE>    mysql&gt; create table test_me ( code char(20), testdata char(20) );
    Query OK, 0 rows affected (0.29 sec)
</PRE>
<P>
<PRE>    mysql&gt; insert into test_me VALUES ('key1', 'data1');
    Query OK, 1 rows affected (0.00 sec)
</PRE>
<P>
<PRE>    mysql&gt; insert into test_me VALUES ('key2', 'data2');
    Query OK, 1 rows affected (0.00 sec)
</PRE>
<P>
<PRE>    mysql&gt;
</PRE>
<P><LI>

Get and install myODBC, also from the MySQL site (use a mirror):

<P>
<PRE>    <A HREF="http://www.mysql.com">http://www.mysql.com</A>
</PRE>
<P>
You install this package on your Windows 95 or 
<FONT SIZE=-1>NT</FONT> box. It is a simple setup.exe process which leads you to the control panel for setting up an 
<FONT SIZE=-1>ODBC</FONT> data source. Set up a data source named
 <CODE>test_odbc</CODE> that points to the database <CODE>test_odbc</CODE> on the 
<FONT SIZE=-1>UNIX</FONT> box. You will need to know the host name and the
port (usually 3306).

<P><LI>

With MS-Access, you can then open a blank database and select File/Get External Data/Link Tables. Select File Type of 
<FONT SIZE=-1>'ODBC</FONT> databases', and the proper data source, and voila! You should have access to the database residing on the 
<FONT SIZE=-1>UNIX</FONT> side.


<P></UL>
<P>
<HR>


code: 06.11
section: Setup_Questions
type: item
title: Difficulty interacting with browser: Request method for form submission is not POST

<A NAME="Difficulty_interacting_with_brow">Difficulty interacting with browser: Request method for form submission is not POST</A></H2>
<P>
There are many possible causes for this error. Using MiniVend 3.08 and
above, the main 3 are:

<UL>
<LI>

This most common case is where the user bookmarks a shopping cart after
Recalc or bookmarks a checkout page. Those pages are usually the results of
form submissions, and are not really a candidate for a bookmark. You should
make sure you provide links to both of those pages on the <STRONG>interact</STRONG> special page (in special/interact if you have started with the demo).

<P><LI>

User hits 
<FONT SIZE=-1>BACK</FONT> with a very small cache. There are quite a few
users who have decided 10Kbytes is enough of a cache, and that won't quite
cut it. 8-) (Actually, they probably assumed the number to enter was in
megabytes.)

<P>
One possible cause is that you must define <STRONG>METHOD=POST</STRONG> in all of your forms, not <STRONG>METHOD=post</STRONG>. The lower case form is not recognized in the 
<FONT SIZE=-1>HTTP</FONT> spec.

<P><LI>

If you are using 
<FONT SIZE=-1>SSL</FONT> and don't have a later 
<FONT SIZE=-1>HTTP</FONT> server (released after say September of 1997), there is a bug in earlier versions Microsoft Internet Explorer's version of 
<FONT SIZE=-1>SSL3.</FONT> Stronghold 2.1.1 works around this bug, so if you use Stronghold you should update.


<P></UL>
<P>
MiniVend 3.05 and later has a new TolerateGet directive which allows you to have forms with 
<FONT SIZE=-1>METHOD=GET.</FONT> To use, set the session 
<FONT SIZE=-1>ID</FONT> in your form


<P>
<PRE>    &lt;INPUT TYPE=hidden NAME=mv_session_id VALUE=&quot;[data session id]&quot;&gt;
</PRE>
<P>
then set <CODE>TolerateGet Yes</CODE> in minivend.cfg (the main configuration file) and use 
<FONT SIZE=-1>METHOD=GET</FONT> on forms that have problems.

<P>
This may prevent errors due to one of the causes above.

<P>
<HR>


code: 06.12
section: Setup_Questions
type: item
title: How can I trace the source of a purchase and run a partners program?

<A NAME="How_can_I_trace_the_source_of_a_">How can I trace the source of a purchase and run a partners program?</A></H2>
<P>
MiniVend has a facility that adds a parameter called <EM>source</EM>
to the session database for that user.

<P>
You should give your partners a source code, which must contain at least one letter character (A-Za-z only). It is placed in the sourcing 
<FONT SIZE=-1>URL</FONT> after two semicolons as a query string of:


<P>
<PRE>    ;;Source1
</PRE>
<P>
If this is appended to the 
<FONT SIZE=-1>URL</FONT> with which the user <STRONG>calls MiniVend</STRONG>
it will then be placed in the session identifier <CODE>source</CODE>.

<P>
This 
<FONT SIZE=-1>URL:</FONT>

<P>
<PRE>    C&lt;&lt;&gt;A HREF=&quot;<A HREF="http://yourcatalog.com/cgi-bin/yourcat/sp_offer">http://yourcatalog.com/cgi-bin/yourcat/sp_offer</A>?;;Source1&quot;&gt;
        Special offer!&amp;lt;/A&gt;
</PRE>
<P>
Will yield <CODE>Source1</CODE> from the MiniVend tag [data session source].

<P>
<HR>


code: 06.13
section: Setup_Questions
type: item
title: How can I send an email copy of the receipt to a user?

<A NAME="How_can_I_send_an_email_copy_of_">How can I send an email copy of the receipt to a user?</A></H2>
<P>
There are several ways, but this is a more complex question than it may
seem like it is.

<P>
You will have to deal with bad email addresses, deciding which information to send, showing delivery times, etc. You also have to be very careful with credit card information -- if you have not taken the proper security measures (by enabling 
<FONT SIZE=-1>PGP</FONT> credit card encryption or using CyberCash) you might just mail them their own unencrypted credit card number!


<P>
If you still decide to do this, then 
<FONT SIZE=-1>I</FONT> will show what 
<FONT SIZE=-1>I</FONT> consider to be the best method -- and Caveat Emptor.


<P>
<STRONG>Use a GlobalSub</STRONG>



<P>
This is the best way, as it is fairly secure. (In case you are one of those
people who go light on the documentation 8-(, you will need to read it in
this case.)

<P>
<PRE>  GlobalSub &lt;&lt;EOF
  sub form_mail {
      my($to, $subject, $reply, $body) = @_;
      my($ok);
  
      return '' unless $to;
  
      $subject = 'Copy of your order' unless $subject;
  
      $reply = '' unless defined $reply;
      $reply = &quot;Reply-to: $reply\n&quot; if $reply;
  
      $ok = 0;
      SEND: {
          open(Vend::FORMMAIL,&quot;|$Vend::Cfg-&gt;{SendMailProgram} -t&quot;) or last SEND;
          print Vend::FORMMAIL &quot;To: $to\n&quot;, $reply, &quot;Subject: $subject\n\n&quot;, $body
              or last SEND;
          close Vend::FORMMAIL or last SEND;
          $ok = ($? == 0);
      }
  
      if (!$ok) {
          logError(&quot;Unable to send mail using $Vend::Cfg-&gt;{SendMailProgram}\n&quot; .
              &quot;To '$to'\n&quot; .
              &quot;With subject '$subject'\n&quot; .
              &quot;With reply-to '$reply'\n&quot; .
              &quot;And body:\n$body&quot;);
      }
  
      return $ok ? 'Copy mailed to user.' : 'EMAIL COPY FAILED.';
  }
  EOF
</PRE>
<P>
The above routine can be called on the report.html page with:

<P>
<PRE>  [perl arg=sub interpolate=1] form_mail (
                      q{[value email]},
                      'Your order from mycompany.com',
                      'sales@mycompany.com',
                      &lt;&lt;'EndOfOrder' )
  
     NAME: [value name]
  ADDRESS: [value address]
           [value city] [value state] [value zip] [value country]
  
  [item-list]
  [item-quantity] [item-code] [item-description] [item-price]
  [/item-list]
  SUBTOTAL: [subtotal]
  SALESTAX: [salestax]
  SHIPPING: [shipping]
  TOTAL:    [total-cost]
  
  EndOfOrder
  [/perl]
  
</PRE>
<P>
(With the old parser, you use [perl sub] ... [/perl] with double brackets
around some of the inside MiniVend tags.)

<P>
Of course you can place any valid tags in the body -- which is that area
before the EndOfOrder ``here document'' marker. The usual here document
caveats apply -- must be by itself at the beginning of a line, with no
trailing whitespace, and <STRONG>watch those carriage returns if you use a Wintel machine.</STRONG>



<P>
<HR>


code: 06.14
section: Setup_Questions
type: item
title: Configuring catalog whatever...Use of uninitialized value at Config.pm line 1614, &lt;CONFIG&gt; chunk 322.

<A NAME="Configuring_catalog_whatever_U">Configuring catalog whatever...Use of uninitialized value at Config.pm line 1614, &lt;CONFIG&gt; chunk 322.</A></H2>
<P>
This is a warning from Perl indicating that an empty value was found where
one is expected. The warning is left in so that you know that something is
missing.

<P>
Whatever it is, it can be found at the specified ``chunk'', or line, of
catalog.cfg -- if you use the #include capability, it would have to be
factored in as well.

<P>
The usual reason is that a file is specified in one of the directives
(usually one of <STRONG>Help SearchProfile OrderProfile Buttonbars UpsZoneFile</STRONG>) and does not exist. See the documentation for the directive on how the
file name should be specified.

<P>

<FONT SIZE=-1>&lt;H3&gt;</FONT> Mini-FAQ: Why isn't the error more
enlightening?&lt;/H3&gt;

<P>
Because Perl won't tell us what exactly went wrong -- see <EM>it's</EM>

<FONT SIZE=-1>FAQ</FONT> for why.

<P>
<HR>


code: 06.15
section: Setup_Questions
type: item
title: We need some more information! Problem: unspecified error

<A NAME="We_need_some_more_information_P">We need some more information! Problem: unspecified error</A></H2>
<P>
This is a fault in the order profile, and can be due to any of:

<UL>
<LI>

Problems with encryption

<P><LI>

Inadvertently setting the same variable twice on the form, causing problems
due to the embedded null.

<P><LI>

Changing the checkout profile and not testing properly under all
conditions.

<P></UL>
<P>
On earlier versions of MiniVend, the demo order profile was placed in an
outboard file. On newer versions, it is embedded right in the checkout
page. Try replacing [set checkout_profile] with:

<P>
<PRE>    [set checkout_profile]
    &amp;final=yes
    &amp;set=mv_Junk 1
    [/set]
</PRE>
<P>
If the order completes, then you have a problem in your profile. Also,
check the <CODE>RequiredFields</CODE> directive in <CODE>catalog.cfg</CODE>, as that is set to <CODE>name</CODE> in the demo. If the <CODE>name</CODE> variable is blank, then you will find that the order doesn't complete.

<P>
The order profile must not have non-blank lines that don't contain valid
check procedures (excluding comments). If you are using a Perl routine in
the profile, as above, you must take care that the routine returns a valid
check routine.

<P>
<HR>


code: 06.16
section: Setup_Questions
type: item
title: How do I display Euro pricing?

<A NAME="How_do_I_display_Euro_pricing_">How do I display Euro pricing?</A></H2>
<P>
(Thanks to Thomas ``Balu'' Walter for this answer.)

<P>
You can use MiniVend's 
<FONT SIZE=-1>II8N</FONT> facilty via the Locale directive:

<P>
In catalog.cfg:

<P>
<PRE> # to define the euro-Settings (PriceDivide is for converting from DM)
 Locale eur_EUR PriceDivide         1.95583
 Locale eur_EUR p_cs_precedes       0
 # this is great - you can even use HTML-Tags to display an euro-image
 Locale eur_EUR currency_symbol     &quot;&lt;IMG src=&quot;/path/to/image/euro.gif&quot;&gt;&quot;
 Locale eur_EUR p_sep_by_space      2
 Locale eur_EUR mon_decimal_point   ,
</PRE>
<P>
<PRE> # and the DM
 Locale de_DE
 Locale de_DE p_cs_precedes  0
 Locale de_DE p_sep_by_space 2
</PRE>
<P>
On your pages (this is from a search results page, the [item-.... ...]
notation may be different depending on your context):

<P>
<PRE> [item-price]&lt;br&gt;&lt;!-- german is default --&gt;
 [setlocale eur_EUR]
   [currency convert=1][item-field price][/currency]&lt;br&gt;&lt;!-- the euro --&gt;
 [setlocale]
</PRE>
<P>
Any questions? Read the docs about ``Internationalization''.

<P>
<HR>


code: 06.16
section: Setup_Questions
type: item
title: Sorting doesn't work across multiple pages

<A NAME="Sorting_doesn_t_work_across_mult">Sorting doesn't work across multiple pages</A></H2>
<P>
This is a bug in all versions of MiniVend prior to 3.12. Update to solve
the problem.

<P>
<HR>


code: 06.17
section: Setup_Questions
type: item
title: I am searching for a string and it is not found. I know it is there!

<A NAME="I_am_searching_for_a_string_and_">I am searching for a string and it is not found. I know it is there!</A></H2>
<P>
Set <CODE>mv_substring_match</CODE> to <CODE>yes</CODE> (<CODE>su=yes</CODE> in one-clicks).

<P>
This most commonly happens when searching for non-ISO-8859 (Cyrillic, or
characters like umlaut and eacute) characters in word-match mode. The
problem is, that unless your locale is set up properly that Perl doesn't
think a non-ISO-8859 and a space character is a boundary.

<P>
Also, if you are searching for non-alpha characters then they will also not
be interpreted as word characters and the boundary problems will still
exist.

<P>
<HR>


code: 07.00
section: CHANGES
type: overview
title: CHANGES

<A NAME="CHANGES">CHANGES</A></H1>

$Log$

<P></DL>
</BODY>

</HTML>


code: 07.00
section: Setup_Questions
type: overview
title: Setup Questions

<A NAME="Setup_Questions">Setup Questions</A></H1>
<P>
MiniVend is quite powerful, but also quite complex. There are many new possibilities opened up with its conditional 
<FONT SIZE=-1>HTML,</FONT> but also many pitfalls.


<P>
Read the documentation thoroughly, then inspect the <CODE>sample</CODE>
and <CODE>simple</CODE> demo pages for help. Pay particular attention to:

<P>
<PRE>    browse*.html
    flypage.html
    results.html
    ord/basket.html
    ord/checkout.html
</PRE>
<P>
These pages use many of the powerful features of MiniVend, and studying
them will be instructive.

<P>
<HR>


code: 07.02
section: Performance_issues
type: item
title: MiniVend runs, but it's sooo sllooowww...

<A NAME="MiniVend_runs_but_it_s_sooo_sll">MiniVend runs, but it's sooo sllooowww...</A></H2>

This is almost certainly due to a system that has inadequate memory or network bandwidth. On a moderately fast 
<FONT SIZE=-1>ISP</FONT> server with sufficient memory, pages should start displaying in less than 2 seconds. On a fast server, pages should start loading almost instantaneously.


<P>

code: 07.03
section: Performance_issues
type: item
title: MiniVend slows down over time

<A NAME="MiniVend_slows_down_over_time">MiniVend slows down over time</A></H2>

There are many possible reasons for this, but most have to do with memory
or session database size.

<P><UL>
<LI>

See the documentation on 
<FONT SIZE=-1>MINIVEND</FONT> 
<FONT SIZE=-1>ADMINISTRATION</FONT> and learn how to expire your session database. If it gets many megabytes large, then accessing a key will get slow.


<P><LI>

Second, if your machine is memory-poor you will find that MiniVend gets
swapped to disk. Unless your system is very fast, this will greatly hurt
performance. MiniVend works best on a machine that rarely if ever swaps to
disk.

<P><LI>

Third, this often has nothing to do with MiniVend at all but has to do with your 
<FONT SIZE=-1>HTTP</FONT> server. Any long-running daemon has the potential for a memory leak -- try stopping and starting your 
<FONT SIZE=-1>HTTP</FONT> server and seeing what happens to performance.


<P><LI>

On Windows, you will want to stop and re-start your MiniVend server at
least once per day. You can use a system agent to automate it -- you will
want to stop the server to expire the session database anyway. You need to
do this because MiniVend requires the Unix-specific <CODE>fork()</CODE>
call to spawn multi-tasked servers, and without multi-tasked servers there
is a strong possibility of a memory leak -- especially if you use embedded
Perl or conditional tags.

<P></UL>


code: 07.04
section: Performance_issues
type: item
title: My server is getting loaded. How do I use the static page capability?

<A NAME="My_server_is_getting_loaded_How">My server is getting loaded. How do I use the static page capability?</A></H2>

Here is an example based on the simple demo.

<P>
To set up the simple demo catalog statically, all that is required is to
put in catalog.cfg:

<P>
<PRE>    StaticDir   /ext/htdocs/simple/static
    StaticPath  /simple/static
    StaticAll   Yes
    StaticFly   Yes
    NoCache     ord special
</PRE>
<P>
<EM>The root WWW directory (DocumentRoot) on my system is /ext/htdocs --  </EM>

<EM>you would change your StaticDir accordingly.</EM>  <STRONG>Make sure the directory</STRONG>

<STRONG>is empty -- MiniVend will overwrite files there!</STRONG>



<P>
Then edit a couple of the pages -- catalog.html and results.html. They have
``dynamic'' elements, ones that prevent the static build for those two
pages (and any searches calling them for a template) from succeeding.
Insert anywhere in the page:

<P>
<PRE>        [tag flag build][/tag]
</PRE>
<P>
This tells the builder to go ahead and build the static page anyway,
despite the dynamic elements. (The elements in this case are the Perl code
telling the user their name in catalog.html, the dynamic ``Check Basket''
icon on the results page, and some sorting parameters that are not used in
the one-click search.)

<P>
At that point, if you are in control of the MiniVend software directory and
changed directory to it, you should be able to run:

<P>
<PRE>        bin/minivend -build simple
</PRE>
<P>
(Users who are provided a catalog without control of the server will not be
able to do this. The administrator would need to get involved.)

<P>
You will see some output from the build command, giving you the status of the build for individual pages. 
<FONT SIZE=-1>(HINT:</FONT> send the standard output to a file to get a full report.) It will show information like:


<P>
<PRE>    Checking page catalog ......................................done.
    Checking page browse .......................................done.
    Checking page canceled ...............skipping, dynamic elements.
    ...
    Checking part number 00-0011................................done.
    ...
    Checking part number 00-342.................................done.
    Building page browse........................................done.
    ...
    Building page catalog ......................................
    &gt;&gt; found search mp=0/se=Renaissance.........................save.
    &gt;&gt; found search mp=0/se=Impressionists......................save.
    &gt;&gt; found search mp=0/se=Surrealists.........................save.
    &gt;&gt; found search mp=0/se=Americana...........................save.
    &gt;&gt; found search mp=0/se=Contemporary........................save.
    done.
    Building part number 00-0011................................done.
    ...
    Building part number 00-342.................................done.
    Re-checking /simple/static/scan5.html.......................none.
    ...
    Re-checking /simple/static/scan3.html.......................none.
    done.
</PRE>
<P>
Restart the server and re-enter the catalog. Now all accesses should be fast whenever possible. One-click searches and flypages are in static 
<FONT SIZE=-1>HTML</FONT> space, and only orders and checkout ops should be parsed by MiniVend.


<P>
This should get you started -- see the documentation for more information,
particularly the section on what are ``dynamic'' tags and how to flag
databases as dynamic with the DynamicData directive.

<P>

code: 07.04
section: Performance_issues
type: item
title: The browse page (from the demo) is SLOW+!

<A NAME="The_browse_page_from_the_demo_">The browse page (from the demo) is SLOW+!</A></H2>

(This old page is not used any more starting at 3.12.)

<P>
That is because it is only useful for small product lines. It pulls out all
keys from the entire database and iterates over them, which is not
reasonable for more then 50 products or so (depending on your server
speed).

<P>

<FONT SIZE=-1>A</FONT> better approach is to use a search and browse by
category, an example of which is given in the demo.

<P>
You could also try something like:

<P>
<PRE>    [perl arg=scratch]
            $start = tag_data('session', 'arg') || 1;
            $chunk = 1;
            if($start =~ /(\d+):(\d*)/) {
                    $start = $1;
                    $chunk = $2 || 1;
            }
            $prev = $start - $chunk;
            if($prev &lt; 1) {
                    $prev = 0;
            }
            $Safe{'scratch'}{'start'} = $start;
            $Safe{'scratch'}{'chunk'} = $chunk;
            $Safe{'scratch'}{'next'} = $start + $chunk;
            $Safe{'scratch'}{'prev'} = $prev;
            $Safe{'scratch'}{'not_shown'} = 1;        return '';
    [/perl]
</PRE>
<P>
<PRE>    [search-region arg=&quot;
                        ra=yes
                        fm=[scratch first]
                        ml=[scratch chunk]
                        sp=browse
                        tf=category
                        to=f         &quot;]
    [search-list]
    
    [on-change 1]
    [condition][item-field category][/condition]
    &lt;TABLE WIDTH=&quot;80%&quot;&gt;&lt;TR BGCOLOR=&quot;#cccccc&quot; TEXT=&quot;WHITE&quot;&gt;&lt;TD ALIGN=CENTER&gt;
        &lt;BR&gt;&lt;H1&gt;[item-field category]&lt;/H1&gt;
    &lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;
    [/on-change 1]
    &lt;P&gt;
    [if-field image]
    &lt;IMG SRC=&quot;[item-field image]&quot;&gt;
    &lt;P&gt;
    [/if-field]
</PRE>
<P>
<PRE>    &lt;H2&gt;[item-description]&lt;/H2&gt;
    &lt;P&gt;
    [L]Catalog[/L] [L]Number[/L]: [item-code]
    &lt;P&gt;
    [L]Price[/L]: [item-price]
    &lt;P&gt;
    [page [item-code]]&lt;IMG BORDER=0
            SRC=&quot;details.gif&quot; ALT=&quot;[L]More Info[/L]&quot;&gt;[/page]
    [order [item-code]]&lt;IMG BORDER=0
        SRC=&quot;ordernow.gif&quot; ALT=&quot;[L]ORDER NOW[/L]&quot;&gt;[/order]
    [/search-list]
    [/search-region]
</PRE>
<P>
<PRE>    [if scratch prev]
    [page href=browse1 arg=&quot;[scratch prev]:[scratch chunk]&quot;]
        &lt;B&gt;[L]Previous[/L]&lt;/B&gt;
        &lt;/A&gt;&amp;nbsp;&amp;nbsp;
    [/if]
    [if type=explicit compare=&quot;[calc]
                [value mv_search_match_count] &gt; [scratch next]
                [/calc]&quot;]
    [page href=browse1 arg=&quot;[scratch next]:[scratch chunk]&quot;]&lt;B&gt;[L]Next[/L]&lt;/B&gt;&lt;/A&gt;
    [/if]
</PRE>
<P>

code: 07.05
section: Performance_issues
type: item
title: I am using SQL, and MiniVend is so SLOW.....

<A NAME="I_am_using_SQL_and_MiniVend_is_">I am using SQL, and MiniVend is so SLOW.....</A></H2>

It isn't MiniVend.

<P>
First of all, did you index your 'code' field? The reason MiniVend doesn't do it for you is that every 
<FONT SIZE=-1>SQL</FONT> database seems to do that a bit differently. Even then, you can do some stuff with MiniVend's 
<FONT SIZE=-1>COLUMN_DEF</FONT> parameter:


<P>
<PRE>  Database  products  COLUMN_DEF  code=char(16) PRIMARY KEY
</PRE>
<P>
That will index at least the <CODE>code</CODE> field for MySQL. Other databases differ.

<P>
MiniVend can return 
<FONT SIZE=-1>VERY</FONT> fast 
<FONT SIZE=-1>SQL</FONT> search results. But you need to at least give it something to work with. The proper method for fast selection is:


<P>
<PRE> [sql type=list
      query=&quot;select code,category,title,price from products&quot; ]
</PRE>
<P>
<PRE> Category: [sql-param category]&lt;BR&gt;
 Title:    &lt;A HREF=&quot;[area [sql-code]]&quot;&gt; [sql-param title] &lt;/A&gt;&lt;BR&gt;
 Price:    &lt;A HREF=&quot;[area order [sql-param 0]]&quot;&gt; [sql-param price] &lt;/A&gt;&lt;BR&gt;
</PRE>
<P>
<PRE> [/sql]
</PRE>
<P>

<FONT SIZE=-1>IMPORTANT</FONT> 
<FONT SIZE=-1>NOTE:</FONT> The sql-param tag did not accept named fields before MiniVend 3.12beta4. Access with
 <CODE>[sql-param n]</CODE>, where <CODE>n</CODE> is a modulus-zero positional field set from your query. In the example
above, code=0, category=1, title=2, price=3.

<P>
This is especially powerful when you consider a joined query like

<P>
<PRE>        SELECT code, price, title, extended.desc
        FROM   products, extended
        WHERE  products.category = 'Renaissance'
</PRE>
<P>
That will index at least the <CODE>code</CODE> field for MySQL. Other databases differ.

<P>
Don't forget that you must index your fields if you want fast searching
with them as a criteria.

<P>
Here is a nice synonym for <CODE>[sql type=list ...]</CODE>:

<P>
<PRE> [new]
 [search-region arg=&quot;
     st=sql
     ml=1000
     sq=select code,title,artist,price from products where code &lt; '5'
     &quot;]
 &lt;PRE&gt;
 [search-list][item-code]: [item-param title] [item-param artist] [item-param price]
 [/search-list] &lt;/PRE&gt;
</PRE>
<P>
<PRE> [/search-region]
</PRE>
<P>

code: 08.00
section: Performance_issues
type: overview
title: Performance issues

<A NAME="Performance_issues">Performance issues</A></H1>
<P>
MiniVend is not a lightweight program.

<P>
If you are running it on a low-end 
<FONT SIZE=-1>ISP</FONT> whose major selling point is low cost, you will
frequently find that MiniVend performance is very poor. This is due to
either:

<DL>
<DT><STRONG><A NAME="item_Not">Not enough memory</A></STRONG><DD>

If memory is low, the program will ``swap'' to disk. If lots of swap is
used, you can expect very bad performance. This is the most common speed
problem.

<P>
If your 
<FONT SIZE=-1>ISP</FONT> uses 
<FONT SIZE=-1>IDE</FONT> hard disks you can expect 
<FONT SIZE=-1>REALLY</FONT> bad performance. 
<FONT SIZE=-1>IDE</FONT> disks are very slow for multi-user machines, which should have 
<FONT SIZE=-1>SCSI</FONT> if 
<FONT SIZE=-1>ANY</FONT> swapping is to be done.


<P><DT><STRONG><A NAME="item_Too">Too many domains</A></STRONG><DD>

If there is a huge amount of traffic on the system, then it can run at a very high ``load average''. 
<FONT SIZE=-1>IF</FONT> load average runs routinely above 2, you can expect problems.


<P><DT><STRONG><A NAME="item_Underpowered">Underpowered machine</A></STRONG><DD>

If it is an old machine, it may be too slow for MiniVend. 
<FONT SIZE=-1>A</FONT> Pentium of less than 100MHz is probably not good
enough unless it is completely dedicated to MiniVend. The faster the
processor, the happier you will be.

<P>

