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>
You also need Perl 5.005 or higher, available from 
<FONT SIZE=-1>CPAN.</FONT> 
<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. See the 
<FONT SIZE=-1>GPL</FONT> at:


<P>
<PRE>        <A HREF="http://www.gnu.org/copyleft/gpl.txt">http://www.gnu.org/copyleft/gpl.txt</A>
</PRE>
<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, it is not
always. 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>
<P>
First of all, you need a recent Perl. MiniVend 4 will not run on anything
less than Perl 5.005.

<DT><STRONG>Perl modules</STRONG><DD>
<P>
MiniVend <EM>will</EM> run with a stock Perl, but to use some features of MiniVend (like the MiniMate interface) 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
        SQL::Statement
        URI::URL
        Safe::Hole
        GDBM or DB_File (comes with most i386 Perls)
</PRE>
<P>
These are definitely recommended:

<P>
<PRE>        Storable
        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
        SQL_Statement
        DB_File
</PRE>
<P>

<FONT SIZE=-1>FUTURE:</FONT> The MiniVend setup program will attempt to use <CODE>ppm.pl</CODE>, the ActivePerl package manager, to install them at installation time.

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

<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>
Mac 
<FONT SIZE=-1>OS</FONT> is not supported. If the time comes when it starts to reasonably support normal 
<FONT SIZE=-1>POSIX</FONT> services, then an attempt to port will be made. This is not likely, in my estimation. MiniVend does run fine on 
<FONT SIZE=-1>OS/X.</FONT>


<DT><STRONG><A NAME="item_Machine">Machine</A></STRONG><DD>
<P>
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.

</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. While MiniMate <EM>can</EM> make administration easier, you should not expect to put up a catalog with
no effort.

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

<UL>
<LI>
<P>
mention that you have referenced appropriate items in the documentation and 
<FONT SIZE=-1>FAQ.</FONT>


<LI>
<P>
include the various version information that is appropriate.

<LI>
<P>
mention what is (or is not) in the error.log files

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

<P>
<PRE>    <A HREF="http://www.minivend.com/">http://www.minivend.com/</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. There is a search feature that encompasses the documentation and 
<FONT SIZE=-1>FAQ;</FONT> there is also a mail list and an archive for it.


<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 link program is not in the
right location.

<P>
If your provider uses 
<FONT SIZE=-1>CGI-WRAP</FONT> or 
<FONT SIZE=-1>SUEXEC,</FONT> it will probably error out if you selected 
<FONT SIZE=-1>UNIX</FONT> mode and didn't reply ``Yes'' to the question
 <EM>Do you use CGIWRAP?</EM>. To unset the setuid bit for another try, telnet in and do

<P>
<PRE>        chmod u-s cgi-bin/simple
</PRE>
<P>
where <CODE>cgi-bin</CODE> is the directory that the program is located.

<P>
To reenable it:

<P>
<PRE>        chmod u-s cgi-bin/simple
</PRE>
<P>
If that doesn't work, it usually means you are on a virtual host with
limited command set.

<P>
To verify that this is the problem, try temporarily changing the permission
of the MINIVEND_ROOT/etc/socket file to be read/write by setting in <CODE>minivend.cfg</CODE>:

<P>
<PRE>        SocketPerms 0666
</PRE>
<P>
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>
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.005 and higher, but the
author does not have the resources (read time) to regression test all
versions with the different versions of Perl, nor the differing operating
systems that exist. 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 4.0 and Perl's latest release version is 5.005_03.

<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/">http://www.minivend.com/</A>
</PRE>
<P>
If you are unable to get MiniVend installed, it is almost always a problem
with your answers to its questions or with the the Perl installation.
Common problems include:

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

<LI>
<P>
Occupied default port (8786) or interfering firewall during the test. This
causes part of 'make test' to fail while MiniVend might still work just
fine.

<LI>
<P>
Very old machine or a machine with very low memory (less than 
<FONT SIZE=-1>64M).</FONT> The test programs might time out while MiniVend
might still work. It won't work very well; expect very slow performance if
you don't have sufficient memory.

<LI>
<P>
Bad installation of Perl. While not as common as it used to be, since Perl 5 is distributed with so many systems, it does happen. 
<FONT SIZE=-1>A</FONT> proper Perl will need to be installed.


<P>
If MiniVend does a core dump or causes a segmentation fault, this is most
certainly the problem.

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

<LI>
<P>

<FONT SIZE=-1>HPUX</FONT> may not be able to compile vlink.c and tlink.c.
Use tlink.pl as your link program. In addition, Solaris often comes with
either no tools or your path may not point to /usr/ccs/bin where some of
the tools are.

</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>
<P>
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.

<LI>
<P>
Try 
<FONT SIZE=-1>INET</FONT> mode if 
<FONT SIZE=-1>UNIX</FONT> mode fails, and vice-versa.


<LI>
<P>
If you run 
<FONT SIZE=-1>CGI-WRAP</FONT> or 
<FONT SIZE=-1>SUEXEC,</FONT> have you turned off the 
<FONT SIZE=-1>SUID</FONT> bit for vlink with a

<CODE>chmod 755 cgi-bin/simple</CODE> or the like? (The <CODE>makecat</CODE> program does this if you answer its question correctly.)

<LI>
<P>
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?

<LI>
<P>
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.


<LI>
<P>
If the function in question is from an external program (such as 
<FONT SIZE=-1>PGP)</FONT> you have tried the command <STRONG>as shown in the directive</STRONG>
from the command line, and as the <STRONG>same user ID as the minivend daemon</STRONG>.

<LI>
<P>
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. In most cases, you can use 
<FONT SIZE=-1>INET</FONT> mode and the tlink program instead if you must cross 
<FONT SIZE=-1>NFS</FONT> boundaries.


</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>
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 three files, <CODE>cygwin.dll</CODE>, <CODE>setup.pl</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 ancestor

<A NAME="About_Vend_MiniVend_s_ancestor">About Vend, MiniVend's ancestor</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 (0.2m7) was on December 28, 1995, making it over four 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 the commonality between the original Vend and MiniVend is
minimal.

<P>
<HR>

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

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

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

<LI>
<P>
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.


<LI>
<P>
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.

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

<LI>
<P>
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 types in use are all relevant to most questions.


<LI>
<P>
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.


<LI>
<P>
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.


<LI>
<P>
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.

<LI>
<P>
No one knows the answer.

</UL>
<P>
<HR>


code: 01.10
section: MiniVend_General_Information
type: item
title: I sent the author a REAL IMPORTANT question and he didn't answer!

<A NAME="I_sent_the_author_a_REAL_IMPORTA">I sent the author a REAL IMPORTANT question and he didn't answer!</A></H2>
<P>

<FONT SIZE=-1>I</FONT> know your problem is important to you, but please
take note of these facts:

<UL>
<LI>
<P>
MiniVend has been downloaded over a million times, and is included on
CD-ROMs that have been distributed hundreds of thousands of times.

<LI>
<P>
The mail list has had over 30,000 posts in its lifetime, many of them
questions.

<LI>
<P>
The author has received tens of thousands of messages about MiniVend.

<LI>
<P>
There are thousands of users running tens of thousands of catalogs with
Minivend.

<LI>
<P>
The author is only one person, has a family, has a living to earn, and is
still actively developing MiniVend.

</UL>
<P>
If you think about these things, you will see why the web site and the mail
list are the only reliable support for MiniVend.

<P>
There are a number of consultants who frequent the mail list, and the
MiniVend web site has a list of people who have declared that they do
MiniVend consulting.

<P>
Bear in mind that companies spend up to millions of dollars to put a high-quality catalog operation on line. MiniVend has been used to provide catalogs that rival those high-end operations in many ways. But, as they say, 
<FONT SIZE=-1>TANSTAAFL.</FONT>


<P>
<HR>


code: 01.11
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 500,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>
<P>
<STRONG>Unencrypted credit card numbers stored on disk.</STRONG>



<P>
If you don't use MiniVend's encryption capability for encrypting credit
card numbers, or the real-time payment (CyberCash, etc.) 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.

<LI>
<P>
<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.

<LI>
<P>
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.

<LI>
<P>
Running 
<FONT SIZE=-1>SQL</FONT> databases without 
<FONT SIZE=-1>WRITE_CONTROL</FONT> or other permission blocks.
 

<P>
It is possible to enter arbitrary 
<FONT SIZE=-1>SQL</FONT> in some search definitions. Though MiniVend tries to block non-select calls, this is not bulletproof. It is best to have certain tables be read-only for MiniVend, i.e. no insert or update permission. For tables that must be updated (i.e. userdb, transactions, and orderline) should use the 
<FONT SIZE=-1>WRITE_CONTROL</FONT> capability and the NoSearch directive to protect them.


</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.12
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 by accepting a performance penalty you can embed many MiniVend tags inside of regular 
<FONT SIZE=-1>HTML</FONT> with things like:


<P>
<PRE>        [pragma no_html_parse 0]
    &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>
You will probably have to edit MiniVend pages by hand.

<P>
Some 
<FONT SIZE=-1>HTML</FONT> editors have a tag like 
<FONT SIZE=-1>&lt;NOTOUCH&gt;&lt;/NOTOUCH&gt;</FONT> that defines regions which should not be wrapped or reformatted by the editor. You should use this.


<P>
Also, if uploading a page from a Mac or 
<FONT SIZE=-1>PC</FONT> make sure to upload in 
<FONT SIZE=-1>ASCII</FONT> (i.e. non-image) mode. If you ignore this, you can break your MiniVend catalog!


<P>
<HR>


code: 01.13
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>
<P>
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.


<LI>
<P>
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 demos are demos --
not a finished application.

<LI>
<P>
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.

<LI>
<P>
Try to answer some of the well-presented questions that appear on the
mailing list.

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

</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>
<P>
Accept phone calls about MiniVend.

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


<LI>
<P>
Conduct tutorials.

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

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

</UL>
<P>
<HR>


code: 01.14
section: MiniVend_General_Information
type: item
title: I want to partner with you, or exchange links, or ....

<A NAME="I_want_to_partner_with_you_or_e">I want to partner with you, or exchange links, or ....</A></H2>
<P>
We receive many, many requests for this type of thing. The answer is almost
always no, we are not interested. We might be interested if there is a big
check or significant Perl expertise being offered.

<DL>
<DT><STRONG><A NAME="item_Payment">Payment gateways</A></STRONG><DD>
<P>
There are literally dozens of different companies doing e-commerce payment
services on the web. We have received inquiries from many of them over
time. The only way we will consider putting in support for a specific
payment gateway is if it is a funded consulting project. This is usually
thousands of dollars and is prohibitive 

<P>
Users have integrated Minivend with many different payment gateways -- we
have done various versions of CyberCash, Signio, and Authorize.net over
time. We support CyberCash directly in MiniVend as the market leader;
Minivend 4 makes it pretty easy to integrate your own gateway.

<DT><STRONG><A NAME="item_Directory">Directory listings</A></STRONG><DD>
<P>
You may list Minivend in your software directory, but we won't maintain the
listing and we don't want to be on your mail list.

<DT><STRONG><A NAME="item_CD">CD-ROM distributions</A></STRONG><DD>
<P>
You may distribute MiniVend unchanged on your 
<FONT SIZE=-1>CDROM.</FONT> We like to get a copy if you do, but that is
not strictly required.

<DT><STRONG><A NAME="item_Reselling">Reselling</A></STRONG><DD>
<P>
You can't resell Minivend because it is Gnu 
<FONT SIZE=-1>GPL</FONT> licensed; but you can give it away. See the
www.gnu.org website for more information.



code: 01.14
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>
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: 01.15
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 database-based. It 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 is probably
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>
<P>
hundreds of items or more

<LI>
<P>
many different catalogs maintained by same organization

<LI>
<P>
product offering will frequently change

<LI>
<P>
need for programmable product display

<LI>
<P>
need for complex ordering interaction

<LI>
<P>
delivery of soft goods after real-time charge of credit cards

<LI>
<P>
need flexible searching and categorization options

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

<UL>
<LI>
<P>
only a few items

<LI>
<P>
items will not change much

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

<UL>
<LI>
<P>
you want power, but want to interact only through a site building system like 
<FONT SIZE=-1>MS</FONT> FrontPage or Netobjects Fustion


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

</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 heavily outnumber the unhappy ones...)

<P>
One user says:

<P>
<PRE>        -- MiniVend is an electronic commerce development environment; 
           *not* a shopping cart.
</PRE>
<P>
This is not far from the truth, though modifying the ``simple'' or
``basic'' demo seems to work for many users.

<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: 02.
section: Windows_specific_questions
type: item
title: &quot;Bad command or file name&quot; when double-clicking on the setup icon

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

<P>
You might try:

<P>
<PRE>        c:\full\path\to\perl setup.pl
</PRE>
<P>
If you still have problems, it probably means Perl is not installed
properly. You need the ActiveState 5.005 version, i.e. build 5xx. (If you
can build your own Perl we assume you won't need the help of this
question.)

<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.



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 database retrieval and display
application focused on e-commerce. In other words, a high-end and powerful
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.

<P>
MiniVend supports Secure Sockets Layer 
<FONT SIZE=-1>(SSL),</FONT> 
<FONT SIZE=-1>PGP/GPG</FONT> strong encryption, and online payment services to improve security. It is designed never to write an unencrypted credit card number to disk.


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

<P>
<PRE>        <A HREF="http://www.minivend.com/">http://www.minivend.com/</A>
</PRE>
<P>

<FONT SIZE=-1>A</FONT> more complete list is in its documentation,
available via links from above.

<P>

<FONT SIZE=-1>A</FONT> full list can only be seen by examining its source
code. 8-)

<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: 03.00
section: Windows_specific_questions
type: overview
title: Windows-specific questions

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


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 or tlink.pl</CODE>.)

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

<P>
<PRE>    AIX 4.1
    BSD2.0 (Pentium/x86)
    Digital Unix (OSF/Alpha)
    FreeBSD 2.x and 3.x
    IRIX 5.3, IRIX 6.1
    Linux
    SCO OpenServer 5.x
    Solaris 2.x (Sun compiler and GCC)
    Solaris 7 (Sun compiler and GCC)
    SunOS 4.1.4
</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 use MiniVend's makecat program it will try to compile an appropriate
link at that time, and will substitute tlink.pl if that doesn't work.

<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 <CODE>compile_link</CODE> program which has docmentation embedded and which will compile an
approprate link.

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



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>





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;




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.



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>


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.



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 
<FONT SIZE=-1>UNIX</FONT> or another Mac operating system. MiniVend
 <EM>does</EM>
run on MkLinux, Linux 
<FONT SIZE=-1>PPC,</FONT> and 
<FONT SIZE=-1>OS/X.</FONT>




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>
If you still are having problems, try this combination in catalog.cfg, the
catalog configuration file:

<P>
<PRE>        SessionExpire  10 minutes
        WideOpen       Yes
</PRE>
<P>
The above setting will typically make MiniVend work when it is possible to
work.



code: 03.10
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 shouldn't run RedHat 5.0 anyway; it has drastic security problems.
Update to a later version and build a new Perl.



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.




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 or
directories.

<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.



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_Wrong">Wrong information given to makecat program</A></STRONG><DD>
<P>

<FONT SIZE=-1>THIS</FONT> 
<FONT SIZE=-1>IS</FONT> 
<FONT SIZE=-1>BY</FONT> 
<FONT SIZE=-1>FAR</FONT> 
<FONT SIZE=-1>THE</FONT> 
<FONT SIZE=-1>MOST</FONT> 
<FONT SIZE=-1>COMMON</FONT> 
<FONT SIZE=-1>PROBLEM.</FONT>


<P>
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>
Re-run the configuration again, and <EM>pay close attention</EM> to the prompts given. There are examples given which apply to most systems.

<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.

<DT><STRONG><A NAME="item_Too">Too-low version of Perl</A></STRONG><DD>
<P>
If you have a Perl earlier than 5.005, MiniVend will not work. Don't even
try an earlier version; you must update.

<DT><STRONG>Perl compiled with USE_THREADS</STRONG><DD>
<P>
Run <CODE>perl -V</CODE>. If you see 
<FONT SIZE=-1>-DUSE_THREADS</FONT> in the compilation definition, you might
run into problems with MiniVend.

</DL>


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.



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.



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 requires Perl 5.005 or higher. Perl 5.005_03 or higher is strongly
recommended.

<P>
MiniVend 3 can run on Perl 5.004, but it is no longer being actively
developed.



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>
You can run in 
<FONT SIZE=-1>INET</FONT> mode with the <CODE>tlink</CODE> link program to prevent those problems.



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 often 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.deja.com">http://www.deja.com</A>
</PRE>
<P>
and try searching on for 
<FONT SIZE=-1>MAXUSERS</FONT> -- this should give you plenty of pointers on
how to set those parameters properly.



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.




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 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 user-space threading support in Perl).




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-)



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.



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>
<P>

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

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

<LI>
<P>
Sendmail

</UL>
<P>
MiniVend takes an appreciable amount of time to compile and load even 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.



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.



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.



code: 05.06
section: Things_about_MiniVend_that_peopl
type: item
title: My [item-field name] tag isn't working! (or [loop-field ...] or [foo-field ..]

<A NAME="My_item_field_name_tag_isn_t_w">My [item-field name] tag isn't working! (or [loop-field ...] or [foo-field ..]</A></H2>
<P>
Read the fine manual. You probably want [item-data foo name] instead.

<P>
The <CODE>[item-field name]</CODE> tag normally only references items in the <CODE>products</CODE> table.

<P>
The reason for this is the scenario where you split your products over
multiple tables using the <CODE>ProductFiles</CODE>
directive, Perhaps you have one named <CODE>new</CODE>
and one <CODE>used</CODE>, or one for several different vendors.

<P>
The <CODE>[item-field ...]</CODE> tag will select the data from the first <CODE>ProductFiles</CODE> entry that pertains.

<P>
If you want to call data from a specific table, use
<CODE>[item-data table column]</CODE>.



code: 05.07
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>
That being said, all you usually have to do to place an order link on a
page is:

<P>
<PRE>        &lt;A HREF=&quot;/cgi-bin/simple/order?mv_order_item=SKU_OF_ITEM&quot;&gt;Order!&lt;/A&gt;
</PRE>
<P>
Replace <CODE>/cgi-bin/simple</CODE> with the path to your MiniVend link.



code: 05.07
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.



code: 05.08
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.
    [foo-code]  [foo-data ...]   [foo-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>
You might wonder why unquoted tags are even allowed. The answer is performance; if you have large lists of tags you can achieve significant speedups by using positional parameters. It requires 
<FONT SIZE=-1>CPU</FONT> power to parse and disassemble the named parameters.




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.



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.



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/restart
    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/restart minivend
</PRE>
<P>
MiniVend supplies a <CODE>restart</CODE> script which tries to do the above portably. It works on many operating
systems (Linux and Solaris have been tested by the author.)



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. It has many features which support mall building.

<P>
You can easily build separate and mostly identical catalogs which you link to via 
<FONT SIZE=-1>HTML.</FONT>


<P>
But building a mall is as much an exercise in data and process as in
software. Consider the following questions:

<OL>
<LI>
<P>
Who will be clearing payment?

<LI>
<P>
What happens if everyone doesn't have the same tax rate?

<LI>
<P>
How will you clear orders to multiple vendors?

<LI>
<P>
How will you bring together multiple types of shipping?

<LI>
<P>
How will the vendors get product data (including images) to you?

</OL>
<P>
If you cannot answer those questions and then visualize how to build a
mall, then you probably should not try.



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>
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>
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 is the default in the demo catalogs.)
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>
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 demos have some examples which should help you -- try ordering
the T-Shirt and visiting its flypage.



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>
Probable causes:

<DL>
<DT><STRONG><A NAME="item_Minivend">Minivend user ID doesn't have keyring</A></STRONG><DD>
<P>
You must have a <CODE>.pgp</CODE> or <CODE>.gnupg</CODE> directory in the <STRONG>home</STRONG> directory of the user running MiniVend. It is also possible to set an environment variable (variously 
<FONT SIZE=-1>PGPPATH</FONT> or 
<FONT SIZE=-1>GNUPGPATH)</FONT> to orient the program correctly.


<DT><STRONG><A NAME="item_Trust">Trust problems</A></STRONG><DD>
<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. Sometimes 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/bin/pgp -fat -r sales@your.com 2&gt;/dev/null
</PRE>
<P>
For 
<FONT SIZE=-1>GNU</FONT> Privacy Guard, 
<FONT SIZE=-1>GPG,</FONT> you would use something like:


<P>
<PRE> EncryptProgram /usr/local/bin/gpg -fa --always-trust -r sales@your.com
        
On Windows or other operating systems, the only fix is to sign the
key or otherwise prevent the error from occurring.
</PRE>
</DL>


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.



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 can use

<P>
<PRE>        $number = $Tag-&gt;nitems();
</PRE>
<P>
If it is the number of line items you need, then you can use a Perl script:

<P>
<PRE>    [perl]
        return scalar @{$Carts-&gt;{main}};
    [/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]
        my $cart = $Carts-&gt;{main};
                foreach my $item (@$cart) {
    @items = split /\|/, $items;
    $count = 0;
    for (@items) {
    $count++ unless $seen{$_}++;
    }
    $count;
    [/perl]
</PRE>


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.



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>
<P>
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.

<LI>
<P>
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.


<LI>
<P>
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>
<LI>
<P>
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).

<LI>
<P>
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.


</UL>


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>
<P>
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).

<LI>
<P>
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.

<LI>
<P>
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.


</UL>
<P>
MiniVend also 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>
You might then try 
<FONT SIZE=-1>METHOD=GET</FONT> on forms that have problems. This may
prevent errors due to one of the causes above.



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> as a query string of:


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

<P>
The Minivend 3 idiom ?;;Source1 continues to be supported, so existing
partner sites should work without change.



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>
This is supported in Minivend via a UserTag, [email ...]. See the
``simple'' and ``basic'' demos.



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.



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>
<P>
Problems with encryption

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

<LI>
<P>
Changing the checkout profile and not testing properly under all
conditions.

</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.



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''.



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.



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.



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 possibilities opened up with its conditional 
<FONT SIZE=-1>HTML,</FONT> but also many pitfalls.


<P>
Read the documentation thoroughly, then inspect the <CODE>basic</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.



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>
<P>
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.




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>
<P>
There are many possible reasons for this, but most have to do with memory
or session database size.

<UL>
<LI>
<P>
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.


<LI>
<P>
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.

<LI>
<P>
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.


<LI>
<P>
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.

</UL>


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>
<P>
(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>


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>
<P>
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>


code: 07.05
section: Performance_issues
type: item
title: My session files change to owner root every day!

<A NAME="My_session_files_change_to_owner">My session files change to owner root every day!</A></H2>
<P>
You have the expireall -r entry in the root crontab, and it should either
be in the Minivend user crontab or run as:

<P>
44 4 * * * su -c ``/MINIVEND_ROOT/bin/expireall -r'' 
<FONT SIZE=-1>MINIVEND_USERNAME</FONT>



code: 07.06
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>
<P>
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.



code: 08.00
section: CHANGES
type: overview
title: CHANGES

<A NAME="CHANGES">CHANGES</A></H1>
<P>
$Log: faq.pod,v $ Revision 1.3 1999/08/14 07:39:23 mike Added static build
stuff

</DL>
</DL>
</BODY>

</HTML>


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>
<P>
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.


<DT><STRONG><A NAME="item_Too">Too many domains</A></STRONG><DD>
<P>
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.


<DT><STRONG><A NAME="item_Underpowered">Underpowered machine</A></STRONG><DD>
<P>
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.



code: 08.01
section: Shipping_questions
type: item
title: I can't get shipping subroutines to work (Minivend 3)

<A NAME="I_can_t_get_shipping_subroutines">I can't get shipping subroutines to work (Minivend 3)</A></H2>
<P>

<FONT SIZE=-1>I</FONT> don't blame you. The interface is terrible and has
gone away in MiniVend 4.

<P>
The best way to do this is to define a UserTag and use it as the subroutine
method. For example, in the <CODE>flycat</CODE> demo (or in the MiniVend 4 <CODE>usertag/</CODE>
directory) you will see a UserTag:

<P>
<PRE>    UserTag  ups-query  Order  mode origin zip weight country
    UserTag  ups-query  Routine &lt;&lt;EOR
    sub {
        my( $mode, $origin, $zip, $weight, $country) = @_;
        BEGIN {
            eval {
                require Business::UPS;
                import Business::UPS;
            };
        };
        $country = uc $country;
        $country = undef if $country eq 'US';
        my ($shipping, $zone, $error) =
            getUPS( $mode, $origin, $zip, $weight, $country);
        if($error) {
            $Vend::Session-&gt;{ship_message} .= &quot; $mode: $error&quot;;
            return 0;
        }
        return $shipping;
    }
    EOR
</PRE>
<P>
This is called via entries in shipping.asc:

<P>
<PRE>  GNDRES  Ground Residential  weight  0   150 f [ups-query
                                                    origin=&quot;[dv origin_zip]&quot;
                                                    zip=&quot;[default zip 98366]&quot;
                                                    country=&quot;[default country US]&quot;
                                                    mode=&quot;GNDRES&quot; weight=&quot;@@TOTAL@&quot;
                                                ] [dv ups_adder]
</PRE>
<P>

<FONT SIZE=-1>NOTE:</FONT> The above should be all on one line, or you need
to escape the newline with a \.

<P>
This is very flexible, but you can make the call much less complex if you
do the parameter checks and substitutions in your own routine (i.e. read
the value of $::Values-&gt;{country} or $Values-&gt;{country} instead of
passing a parameter).



code: 08.02
section: Shipping_questions
type: item
title: I am using &quot;price&quot; as the shipping criteria and it seems to be wrong

<A NAME="I_am_using_price_as_the_shippi">I am using &quot;price&quot; as the shipping criteria and it seems to be wrong</A></H2>
<P>
When you put <EM>price</EM> in the field, MiniVend will do exactly what it says in the documentation;
multiply the value of the <CODE>products</CODE>
database field <EM>price</EM> by the number of items in the cart. If you have quantity discounds, price
adjustments, or other discounts in force via
<CODE>CommonAdjust</CODE> or another facility they will not be taken into account.

<P>
The solution is simple -- put <CODE>[subtotal]</CODE> instead of <CODE>price</CODE> in the criterion field. MiniVend will interpret 
<FONT SIZE=-1>MML</FONT> tags normally in that position, as it will in the <CODE>cost</CODE> field.



code: 09.00
section: Shipping_questions
type: overview
title: Shipping questions

<A NAME="Shipping_questions">Shipping questions</A></H1>
<P>
MiniVend has one of the most complete and flexible shipping calculators
found in an ecommerce program. You can do most anything with a global
UserTag, even to the point of looking up a cost at a remote calculator.
(See the <CODE>[ups-query]</CODE> tag in the <CODE>flycat</CODE> or <CODE>usertag</CODE> directories for an example.)

<P>
However, all of this comes at the price of complexity. Many questions have
already been answered on the user list.



