Associating a script with a CGI

#1
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
 

mistwang

LiteSpeed Staff
#2
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.
 

mistwang

LiteSpeed Staff
#4
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.
 
Top