CGI and Perl

Setting Up Your minivend.cfg File

You also need to set up your minivend.cfg configuration file. Some of this file is set up for you when you run configure; however, you may want to tailor some variables manually.

The important two variables in this file are VendURL and SecureURL. They specify the CGI program used for all links within the catalog. The only difference between these two variables normally is that VendURL uses the HTTP protocol where SecureURL uses the HTTPS protocol. Both variables need to specify the URL at which MiniVend can find the vlink executable, which is normally your cgi-bin directory. This value is set for you during configuration.

Another important set of variables is PageDir, ProductDir, and DataDir. These variables specify where to find HTML files, product database files, and other database files. You normally want to separate at least your HTML pages from your database files. You can separate your product database files from your extra database files, although doing so is unnecessary. The directories specified for these variables are relative to the MiniVend installation directory unless they begin with the / character.

The last variable is the Database variable. You can have as many instances of this variable as you like. The format for the value of this variable is

database_name database_file delimiter_type

database_name is a name you choose for the database that is specified when you use the [data] tag in your HTML files. database_file is an ASCII database file, as described in the preceding section, which resides in the DataDir directory. delimiter_type was also explained in the preceding section; the values are as follow:

  • Type 1: Defaults to the same as the products database file.
  • Type 2: Each field contained on its own line, where blank lines delimit records.
  • Type 3: Each field separated by \n%%\n combination and records separated by \n%%%\n combination.
  • Type 4: CSV
  • Type 5: PIPE
  • Type 6: TAB

The minivend.cfg file also contains many other variables. I suggest you look over the MiniVend documentation for a more detailed and up-to-date reference. You can configure the values in these files by using the mat administrative CGI tool, which I describe later in this chapter.

by BrainBellupdated