Associating a script with a CGI

Discussion in 'Install/Configuration' started by Tadeo, Dec 16, 2005.

  1. Tadeo

    Tadeo New Member

    Hello,

    I am currently evaluating the enterprise edition for use in our web store. Could I toruble someone to explain how I can associate a script with a cgi?

    $VH_ROOT=/var/www/vhosts/shop.mysite.com

    $DOC_ROOT=$VH_ROOT/httpdocs

    CGI App Path= /var/www/vhosts/shop.lifetimemoments.com/cgi-bin/mivavm
    (The CGI is outside of the document root)

    I need mivavm to launch whenever the sever encounters a script with the extension .mv or .mvc


    Thanks in advance
  2. mistwang

    mistwang LiteSpeed Staff

    I think your question is similar to http://www.litespeedtech.com/forum/viewtopic.php?t=163

    You can use a rewrite rule to archive this. you need to define a CGI context like /cgi-bin/mivavm

    Then add a rewrite rule , for example

    To rewrite /foo.mv to /cgi-bin/mivavm/foo.mv

    lshttpd will set PATH_INFO and PATH_TRANSLATED automatically, in your script, env PATH_TRANSLATED should be the path to your script.
  3. Tadeo

    Tadeo New Member

  4. mistwang

    mistwang LiteSpeed Staff

    You don't need to create a dedicate rewrite rule for each mvc script, just a generic one can handle all scripts.

    try something like:
    Code:
    RewriteRule /(.*\.mvc?)$  /cgi-bin/mivavm?$1+%{QUERY_STRING}  
    To do what you want.

Share This Page