Saw a few postings about setting up Windows2000 IIS to work with 
cmc.exe to execute .mt scripts (as a CGI processor) so I decided to 
give it a whirl (I'm trying to decide if I should use ASP/Database or 
a MetaCard solution at the server end).

Here is what I found:  (this assumes you have downloaded and unzipped 
cmc.zip from MetaCard's ftp site, installed and at least tested 
access to your IIS default pages from a remote computer)

A. Setting up IIS
     i. Setting Up the Directory for your mt scripts
        (assuming you have the Internet Services Manager open)
        1. Create a virtual directory as you normally would. Mine was "mc"
        2. Right click on the directory, View Tasks->Permissions Wizard
            a. use default settings, give the whole directory the 
settings as the main one.

        3. Right click on the directory, choose Properties (this can 
be a sub-directory of your virtual one)
        4. Directory tab,  Execute Permissions = Scripts and Executables
        5. Put your .mt script in there.

    ii.  Setting up the cmc.exe
        1. Put the cmc.exe into some place that has a dos-happy path 
(i.e no spaces!). I used c:\inetpub\scripts\ but I *think* anywhere 
will work.


    iii. Setting up IIS so it knows where to find cmc.exe
        1. Right Click on the computer (mine was "pclaptop" )
        2. Choose Properties,then Edit the WWW service Master Properties
        3. Home Directory Tab
        4. Down in the Application settings, click on Configuration...
        5. Add an App Mapping, extension .mt (needs the '.'), the path:
                     c:\inetpub\scripts\cmc.exe %s
          (dont forget the %s or it will moan about no script being passed)
        6. I left the other settings alone....you should be able to 
restrict the Verbs to GET,POST
        7. OK yourself out of there.

B. Writing an .mt script to work with IIS

  i.    Here's a simple one: (I'm re-typing, so I hope I didnt add any 
errors). Save it into your virtual directory (test.mt)
       NOTE: I REPLACED the <  and > with [  and ]
     # this will spit back hello world and whatever you pass in
     on startup
        put "[html]hello world, you said"&&$QUERY_STRING&&"[/html]" into sText
        put "Content-Length:"&&length(sText)&return
        put "Content-Type: text/html"&return&return
        # the pair of returns is essential
        put sText
    end startup

ii. Getting fancy..
       1. functions are supported
       2. you can "start using" other stacks and call functions in them
       3. you can access data in any stack...I didn't try  putting 
stacks in other directories...but it worked from one in the same 
directory.

iii. Calling it
      (assuming a script test.mt in your virtual directory mt - actual 
directory could be something different!!)
       http://www.yoursite.com/mc/test.mt?test=mark

      should spit back

      hello world, you said test=mark


 
iv. Questions...
      1. Where is read from stdin until empty ? (you see this on the 
.mt scripts for Linux, etc..)  -  it makes the app just sit 
there...waiting, waiting...I don't really know what this does on 
NT/2000, so maybe a more enlightened person can let me know.
     2. I didn't try POST.  Should work ok.


-----

So there you have it. Windows2000 and cmc.exe.  Let me know what you think.

As far as comparisons go....the MC stuff looks like it will work for 
simple, quick-and-dirty apps or ones that won't be used by a lot of 
people. Its nowhere near as fast *on the Win2000* machine as ASP, 
even when ASP is searching a database. As my server might, at some 
point, get a lot of users, I'm going to have to live with Bill Gates 
for the server app.  Too bad, too, since the metatalk language is a 
hell of a lot easier to deal with than VBScript.

However, it works.,..very useful if you want to add a web interface 
to a MC application that serves info.  I'm sure that I will use it 
for any small-scale server apps that I need.

-ml


Mark J. Luetzelschwab           [EMAIL PROTECTED]
Graduate Research Assistant         (v) (512) 232 6034
Instructional Technology            (f) (512) 232 2322
Reading and Language Arts:
http://www.texasreading.org

Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to