www.digitaldaze.com
M i v a   V i r t u a l   H o s t   S u p p o r t

To provide Miva support (not Miva Merchant) for a Virtual host, we recommend that you use Miva's <VirtualHost> configuration directive.

  1. Be sure that you are running the latest version of Miva (at the time of this writing, it is v.3.57). One way to check for this is by looking for the version number in the first couple of lines of the Miva configuration file, ~/etc/miva.conf. If you are not running v.3.57, you should consider Upgrading Miva/HTMLScript.

  2. Be sure that the following parameters are set in miva.conf:
    virtualhostvariable=SERVER_NAME
    dnslookup=0
    

    NOTE: If you choose to set virtualhostvariable=HTTP_HOST, then your miva.conf must have a <VirtualHost> directive for each of the virtual host's domain names. For example, using 'HTTP_HOST' will require both virtualhost-domain.com and www.virtualhost-domain.com to have its own <VirtualHost> directive in miva.conf. This is why we recommend using 'SERVER_NAME' instead, because in your httpd.conf, you can consolidate a virtual host's multiple host names under a single <VirtualHost> directive with just one ServerName. This is documented in the instructions below.

  3. Add the <VirtualHost> directive to miva.conf. Assuming that you are using virtualhostvariable=SERVER_NAME in miva.conf, the name of the <VirtualHost> should equal the ServerName for the host defined in the <VirtualHost> directive for your web server in your httpd.conf.

    Ideally, the mivaroot parameter should equal the virtual host's DocumentRoot (another parameter of the <VirtualHost> directive in httpd.conf).

    The stdmodedatadir should be outside of the ~/www/htdocs directory, unaccessable by others, since all data collected by Miva will be stored in that directory.

    The VirtualHost directive in miva.conf should look something like this:

    <VirtualHost www.VIRTUALHOST-DOMAIN.NAME>
    mivaroot=/usr/local/etc/httpd/htdocs/VIRTUALHOST-DOMAIN-DIR
    stdmodedatadir=/usr/local/etc/httpd/miva/VIRTUALHOST-DOMAIN-DIR_data
    mivadefault=index.html 
    serveradmin=webmaster@VIRTUALHOST-DOMAIN.NAME
    </VirtualHost>
    

  4. You may or may not need to modify your web server configuration file, httpd.conf, depending on the method you are using to give your virtual host's CGI support. After ensuring that the parameters defined in the <VirtualHost> directive in httpd.conf matches those you set in the <VirtualHost> directive of miva.conf, you must check if your virtual host has access to the Miva engine that was put in your ~/www/cgi-bin during the Miva installation.

    If the virtual host is sharing your virtual server's primary cgi-bin directory--meaning that you have not explicitly identified an alternate ScriptAlias for the host in the <VirtualHost> directive of httpd.conf--then after following all the instructions above, Miva should be setup and ready to support your virtual host. If you don't understand what a ScriptAlias is, then your virtual host is probably using your primary cgi-bin directory and the Miva engine therein, so you don't have to worry about making anymore changes. Go on to the next step.

    However, if the virtual host has its own cgi-bin directory, then we would recommend that you give that virtual host access to the Miva engine in your primary cgi-bin directory by adding the following to your httpd.conf's <VirtualHost> directive:

    ScriptAlias /cgi-miva/ /usr/local/etc/httpd/cgi-bin/
    AddType application/x-httpd-Miva .mv
    Action application/x-httpd-Miva /cgi-miva/miva
    

  5. Test your setup by copying the Miva Maillist applet (it can be found in the /usr/local/contrib/miva_apps/maillist/ on your Virtual Server host machine) to your virtual host's mivaroot (which should be its DocumentRoot, assuming you followed the instructions above) and running it in your browser. For example:
    % cp /usr/local/contrib/miva_apps/maillist/* ~/www/VIRTUALHOST-PATH
    

    Then, in your browser, access this URL:

    http://VIRTUALHOST-DOMAIN.NAME/maillist.mv

    When you run this applet, it should save the submitted data in the virtual host's stdmodedatadir in a file called mailing.dat. If not, review the instructions above along with your own setup for any configuration errors.

    NOTE: If Miva still has problems running an application for a virtual host, or runs the application but stores data in the wrong directory, then delete all the files in your workdir (the default installation will have this set as ~/www/miva/workdir). This directory contains a caching database with virtual host configuration information. Deleting the database files will require Miva to reload the new VirtualHost information from miva.conf.

     

    [Legal Notice]
    http://www.digitaldaze.com