Configure Miva Merchant Empresa for UNIX

Note: If you are not a system administrator, you will not be able to perform the installation as described below.

Introduction

The configuration directives or environmental variables, provide Miva Merchant Empresa with startup information. The primary purpose is to set the global operating environment; file locations, buffer settings, security settings, among others. These instructions are intended for the System Administrator.  

Configurations

There are two configurations:

The path to either of these configuration libraries may be set in httpd.conf, or the library may be renamed to libmivaconfig.so and placed in the current directory (usually where the Miva Merchant binary resides).

Advanced users may also develop their own configuration libraries, which is beyond the scope of this document.

 4.x Configuration (env.so): Environment Variables

The following Environmental Variables are used only when the 4.x Configuration Library, env.so, is used. Enter the variables you require as you would other Environmental Variables in the httpd.conf (or srm.conf). For example:

SetEnv MvCONFIG_Var_Name /path or value

These variables can also be entered into other server configuration files, such as htaccess and bashrc.

Note: The directives (variables) are usually entered into httpd. However, you can also enter the variables into the .bashrc, .profile, or .cshrc. Remember to modify the syntax accordingly.

 MvCONFIG_BUFSZ_CALL

The allocated buffer size when acting on the MivaScript tag, MvCALL, reading data. (The Virtual Machine emulates a browser using HTTP protocol to contact a remote host.)

 MvCONFIG_BUFSZ_CONTENT

The allocated buffer size MvCALL uses for uploading a file to the remote server.

 MvCONFIG_BUFSZ_IMPORT

When reading files associated with the MivaScript <MvIMPORT> tag, Miva Merchant Empresa VM allocates a buffer for the incoming data. This allows you to tune the performance of Miva Merchant Empresa VM import processing to optimize data read performance. (Reasonable numbers less than 100000 are a good idea on most systems and smaller numbers, such as 10000, should be used on heavily loaded systems without a lot of RAM.)

 MvCONFIG_BUFSZ_OUTPUT

The allocate buffer size is used for output. Multiple buffers are created and, unless BUFSZ_OUTPUT_FLUSH is used, all output is buffered and output at the end of execution (so content-length can be calculated).

 MvCONFIG_BUFSZ_SMTP

The allocated buffer size the MivaScript tag MvSMTP uses when writing to the SMTP mail server.

 MvCONFIG_BUFSZ_TEMPLATE

Miva Merchant Empresa allocates a buffer for active documents and attempts to load as much of the active document in the buffer as it can before processing.

 MvCONFIG_BUFSZ_OUTPUT_FLUSH

The output_flush specifies how many bytes are in the output when an output (and output the HTTP headers, if necessary) is done; flush occurs when the output buffers reach the value set for the flush. (See MvCONFIG_BUFSZ_OUTPUT.)

 MvCONFIG_COMMERCE_<method>

<method> is the commerce method that corresponds to the specific commerce service that is installed in the Miva Merchant Empresa VM commerce directory. For example, the entry in your httpd.conf would be similar to the following:

MvCONFIG_COMMERCE_MethodName  /home/user/lib/commerce/library.so

 MvCONFIG_COOKIES

This value is available to Miva Merchant Empresa VM active documents in the Collared system variable.

Note: Cookies must be enabled for Miva Merchant use.

 MvCONFIG_DATABASE_<type>

Determines the directory in which Miva Merchant Empresa VM looks for a database library. <type> is the database type.

 MvCONFIG_DEFAULT_FILE

The file name of the default active document name, if no name is specified on the URL command line. This is usually set to "index.mvc" (".mvc" is the usual Miva Merchant Empresa VM suffix for active document names).

 MvCONFIG_DELAY_FILE

Specify a file delay for use with an operation which requires looping for guaranteed completion, such as finishing an MvLOCKFILE block. Or, to prevent infinite loops when MvCONFIG_TIMEOUT_GLOBAL (globaltimeout) is set to zero.

 MvCONFIG_DIR_BUILTIN

Identifies the path in which the Miva Merchant Empresa VM looks for the built-in libraries.

 MvCONFIG_DIR_CA

Determines the directory in which Miva Merchant Empresa VM looks for the SSL certificate files.

 MvCONFIG_DIR_COMMERCE

Identifies the location of the directory that corresponds to a specific commerce service that require a data directory in the Miva Merchant data directory.

 MvCONFIG_DIR_DATA

The full path of the data directory.

 MvCONFIG_DIR_MIVA

Determines the directory in which Miva Merchant Empresa VM looks for the documents it will execute (active documents). (Use an absolute path for mivaroot). This can be overridden with the ~login directive on the URL command line only when the MvCONFIG_DIR_USER is also set.

MvCONFIG_DIR_MIVA /home/mivauser/public_html

If MvCONFIG_DIR_MIVA is /sites/sitename/public_html, and the URL is http://mivasite.com/cgi-bin/miva?/diag.mvc, the Miva Merchant Engine will look for the file in the directory assigned by this MvCONFIG_DIR_MIVA (.../public_html). If the URL is http://mivasite.com/cgi-bin/miva?/subdirectory/file.mvc, Miva Merchant Empresa VM will look for the file in the subdirectory of the path set (.../public_html/subdirectory).

 MvCONFIG_DIR_TEMP

Location for the temporary files used during an MvPack. This is particularly useful when using NFS.

 MvCONFIG_DIR_USER

One type of URL Miva Merchant Empresa VM executes, when it refers to a script file that is stored in a user's private HTML directory; the defined value is appended to the user's home directory, and takes the form: http://www.mivasite.com/~mivauser/script.mvc. Miva Merchant Empresa VM looks for the script file in the directory defined by this directive. (Typically, it will be defined to be the same as the UserDir of the Web server.)

 MvCONFIG_DIR_USERDATA

Authorizes all users (except root) to use MivaScript applications. If the value starts with slash (/), then it is assumed to be an absolute path, and no other checking is done. If it does not start with a slash, the directory is appended to the user's home directory.

 MvCONFIG_FLAGS_SECURITY

The numeric value given to this variable allows you to enable configurations that may not be secure under all circumstances. The default value of 0 (zero) specifies that under no circumstances, will Miva Merchant Empresa VM be allowed to follow symbolic links from source code or data directories. A value of 0 (zero) here also disallows Miva Merchant Empresa VM from following an absolute path, that may be specified in an application, to read or write data.

Value

Description

0

Do not allow Miva Merchant Empresa VM to follow symbolic links or an absolute path (default)

1

Follow symbolic links in the source code directory.

2

Ignore symbolic link ownership in the source code directory.

4

Follow symbolic links in the data directory.

8

Ignore symbolic link ownership in the data directory.

16

Allow absolute paths for data files.

Working as a bitmask, you can combine the values to allow combinations of different options. For example, the following option would allow Miva Merchant Empresa VM to ignore symbolic link ownership in the source code directory (2), and follow symbolic links in the data directory (4).

 MvCONFIG_INFO_SERVERADMIN

Set this variable to the email address to be shown when Miva Merchant Empresa VM encounters a system configuration or authorization error, or cannot find the specified active document.

 MvCONFIG_LIBRARY

The full path and filename of the configuration library, such as env.so or custom ones.

 MvCONFIG_LOCK_EXPIRATION

Identifies the number of seconds old a lockfile must be before it is considered expired and is removed. This prevents stale lockfiles from causing subsequent processes to timeout waiting for a lock.

 MvCONFIG_LOCK_HOSTNAME

Controls the host name that is written to the lockfile. Used if there are multiple hosts writing lockfiles to the same directory, which is possible if using NFS or some other fileserver. Each system must have a unique value for lockhostname (which almost always occurs, since the network hostnames will be different).

 MvCONFIG_MAX_DOCACHE (new in 4.05)

When set to a value greater than 0, controls the maximum number of MvDO files that will be cached. This option is similar to the maxfiles configuration option. Some servers may need a value of 25.

 MvCONFIG_MAX_FILES

When set to a value greater than 0, this directive will control the maximum number of file handles opened by the engine (not including the handle for the executable file itself, standard input, standard output, and standard error). Scripts that need to access more than "maxfiles" files simultaneously will still execute, because the engine will create virtual file handles.

 MvCONFIG_SSL_OPENSSL

The directory in which the SSL file, libssl.so, resides.

 MvCONFIG_SSL_CRYPTO

The directory in which the SSL file, libcrypto.so, resides.

 MvCONFIG_TIMEOUT_CALL

During a call operation (MvCALL), Miva Merchant Empresa VM opens a TCP/IP port to a Web host. This option sets the number of seconds that Miva Merchant Empresa VM will wait for communication from the remote host.

 MvCONFIG_TIMEOUT_FILE

Specify a file timeout to prevent infinite loops when globaltimeout is set to zero. Or, with an operation which requires looping for guaranteed completion, such as finishing an MvLOCKFILE block.

 MvCONFIG_TIMEOUT_GLOBAL

When Miva Merchant Empresa VM has completed processing the information in the global configuration file and begins to execute an active document, it sets a global timer for the number of seconds specified by this variable. After the set number of seconds has elapsed, Miva Merchant Empresa VM, closes all files, and terminates. This helps in preventing processes from running too long. Miva Merchant Empresa VM's default value is 90 seconds and can be overridden by setting this variable. Set this variable to 0 if you would like no global time-out to be set.

 MvCONFIG_TIMEOUT_MAIL

During sending and receiving mail operations, Miva Merchant Empresa VM opens a TCP/IP port to the SMTP or POP3 host. This variable sets the number of seconds Miva Merchant Empresa VM will wait for communication from the remote host.

 3x.so Configuration: Options and Tags

 3x.so Options (Directives)

These 3x.so directives for the Virtual Machine are either new for use with the VM or were previously undocumented. Enter them into the mivavm.conf, as you require for your server setup.

The general format for a configuration option is:

configuration option=value

callbuffersize

The allocated buffer size when acting on an MvCALL, where the Virtual Machine emulates a browser using HTTP protocol to contact a remote host and send and/or receive data.

contentbuffersize

The allocated buffer size MvCALL uses for sending data to the remote server.

smtpbuffersize

The allocated buffer size the MivaScript tag MvSMTP uses when writing to the SMTP mail server.

nice

Changes the priority that MivaScript runs under UNIX. Values below 0 indicate a priority higher than normal; values under 0 indicate a priority lower than normal.

tempdir

Location for the files that are temporarily created by Miva Merchant Empresa.

 3x.so TAGS

These new tags are used in the 3x.so library with the Miva Merchant Empresa Virtual Machine. They are not valid for the 3.x Miva Merchant Empresa Engine.

 <BUILTIN-LIB LIBRARY="path">

Set the full path to each built-in function library.

<BUILTIN-LIB LIBRARY = "/usr/local/miva/lib/builtins/string.so">

 <DATABASE-LIB METHOD="type" LIBRARY="path">

Register each database library type and its full path.

Advanced and Additional Configurations

Apache: Redirection Configuration

  1. If you wish to use redirection (short-style URLs), and are running the Apache Web server, add the following lines to your httpd.conf or srm.conf file. (As of Apache version 1.3.4, Apache recommends that all Apache configuration commands be stored in httpd.conf.)
  2. To create a ScriptAlias for a global cgi-bin, add the following line to your httpd.conf or srm.conf file (whichever one you used in step 1, above).

Note: If you are not using Apache, you will need to consult your Web server's documentation for information on setting up redirection.

 Zeus: Aliases and Handlers

  1. On Edit Server page, under Module Configurables, click the "Path Mapping" box.
  2. Under "Aliases" (see following image).
  3. Under "Handlers"

Configuring Miva Merchant Empresa VM with Apache suexec

Apache suexec is a CGI wrapper program that enables the Web server to run CGI programs as a specific user.

To use Miva Merchant Empresa VM under Apache suexec, you will need to install a separate copy of the Miva Merchant Empresa VM binary in each user's private cgi-bin. Each binary should be owned by the owner of the cgi-bin directory. To ease the administration process, you may configure these binaries to share common configuration files.

Note: Set the following commands:
chmod 755 mivavm
chown <cgi-bin Directory Owner> mivavm

3.x Engine and 4.x Virtual Machine Equivalents

The following list shows the 3.x Miva Merchant Empresa Engine directive and its equivalent 4.x directive for the Virtual Machine.

 Directive Equivalents

3.x ENGINE Directive

4.x VIRTUAL MACHINE Directive

callbuffersize

MvCONFIG_BUFSZ_CALL

contentbuffersize

MvCONFIG_BUFSZ_CONTENT

n/a

MvCONFIG_BUFSZ_OUTPUT

smtpbuffersize

MvCONFIG_BUFSZ_SMTP

 

 

authfile

3x.so only

authuserdir

MvCONFIG_DIR_USERDATA

cadir

MvCONFIG_DIR_CA

stmodedatadir

MvCONFIG_DIR_DATA

calltimeout

MvCONFIG_TIMEOUT_CALL

commercedir

MvCONFIG_DIR_COMMERCE

defaultmacroencoding

n/a

n/a

MvCONFIG_DATABASE_<method>

 

 

(<DATABASE-LIB METHOD="type" LIBRARY="path"> in 3x.so)

dnslookup

3x.so only

filetimeout

MvCONFIG_TIMEOUT_FILE

filedelay

MvCONFIG_DELAY_FILE

globaltimeout

MvCONFIG_TIMEOUT_GLOBAL

importbuffersize

MvCONFIG_BUFSZ_IMPORT

lockexpiration

MvCONFIG_LOCK_EXPIRATION

 

 

lockhostname

MvCONFIG_LOCK_HOSTNAME

logfile

n/a

loglevel

n/a

mailtimeout

MvCONFIG_TIMEOUT_MAIL

n/a

MvCONFIG_MAX_DOCACHE (maxdocache in 3x.so)

maxfiles

MvCONFIG_MAX_FILES

maxfunctiondepth

n/a

mivadefault

MvCONFIG_DEFAULT_FILE

mivaroot

MvCONFIG_DIR_MIVA

 

 

nice

3x.so only. See Note Below

openssl

MvCONFIG_SSL_OPENSSL

openssl_crypto

MvCONFIG_SSL_CRYPTO

packages

n/a

redirectonly

3x.so only

securityoptions

MvCONFIG_FLAGS_SECURITY

serveruserid

3x.so only

 

 

sitevars

3x.so only

serveradmin

MvCONFIG_INFO_SERVERADMIN

stmodedatadir

3x.so only

tempdir

MvCONFIG_DIR_TEMP

templatebuffersize

MvCONFIG_BUFSZ_TEMPLATE

usecookies

MvCONFIG_COOKIES

userdir

MvCONFIG_DIR_USER

usersitevars

3x.so only

validextensions

3x.so only

 

 

virtualhostvariable

3x.so only

workdir

n/a

n/a

MvCONFIG_DIR_BUILTIN

 (BUILTIN-LIB LIBRARY="path" in 3x.so)

n/a

MvCONFIG_DATABASE_<method>

(<DATABASE-LIB METHOD="type" LIBRARY="path"> in 3x.so)

n/a

MvCONFIG_LIBRARY

 

Note: nice changes the priority that MivaScript runs under UNIX. Valid values are -20 to + 20. Values below 0 indicate a priority higher than normal; values over 0 indicate a priority lower than normal.  

Tag Equivalents

These are tags in the 3.x Miva Merchant Empresa Engine, and a directive (or configuration variable) in 4.x Miva Merchant Empresa Virtual Machine.

3.x Tag 4.x Directive

<COMMERCE-LIB>  MvCONFIG_COMMERCE_<method>

MvCONFIG_DIR_COMMERCE

<PACKAGE>           n/a

<virtualhost>          Apache Env Variable <Virtual Host>

To emulate the 3.x virtual host, enter the required Environmental Variables (SetEnv) inside the Apache <VirtualHost> block in httpd.conf.

Miva Merchant Commerce Libraries

The Miva Merchant Virtual Machine supports compiled MivaScript, including Miva Merchant 4.14 and above. Some of the following Miva Merchant (4.14 and above) modules use a Commerce Library, OpenSSL, or neither, as indicated in the "Method or OpenSSL" column.

 
Module
Method or OpenSSL
Library(1)
Authorize.Net Payment Services
AuthorizeNet
and OpenSSL
authnet-vx.xx-platform.so
Cardservice/LinkPoint
LinkPoint
linkpoint--vx.xx-platform.so
CertiTAX
CertiTAX
Obtain from vendor.
CyberCash Payment Services
( to maintain compatibility with previous Miva Merchant versions)
CyberCash
cybercash-vx.xx-platform.so
CyberSource ICSv2 Payment Services
ICS2
ics2-vx.xx-platform.so
And, obtain SDK from vendor.
debit-it!
OpenSSL
 
E-Commerce Exchange/QuickCommerce 3.0 Payment Gateway
QuickCommerce
authnet-vx.xx-platform.so
e-ValuCheck
OpenSSL
 
FedEx Shipping
OpenSSL
 
GlobalCommerce Payment Gateway
GlobalCommerce
Obtain from vendor.
merchantcommerceinc.com
Innovative Gateway Solutions
OpenSSL
 
Lynk Internet Processing
OpenSSL
 
Miva Merchant Marketplace (4.14 and above)
OpenSSL
 
Miva Merchant Payment
ICS2
ics2-vx.xx-platform.so
Moneris e-SELECT Payment Service
e-SELECT
Obtain from vendor.
Paradata Payment Service
Paradata
Obtain from vendor
PayPal Instant Payment Notification
OpenSSL
 
PayQuake (formerly U.S. Merchant Systems)
OpenSSL
 
R-P-G (Rodopi Payment Gateway)
OpenSSL
 
USPS Shipping
none
 
Verisign Payflow Link
none
 
Verisign Payflow Pro (PaymentNet)
PNTransact
Obtain SDK from the vendor.
(1) vx.xx represents the version of the commerce library, such as v4.02. platform represents the specific platform, such as solaris_28 or linux_libc2.