Been looking at the scripting in the version of the server I've got. Can't
quite see how it is implementiung the CGI stuff:

on getSuffix
  set wholeMatches to true
  set itemDel to "."
  put "."& last item of pFile into suffix
  set itemDel to ","
  get itemOffset(suffix,cgiSuffix)
  if it is not 0 then
    open process pFile
    read from process pFile until eof
    # write it to stdout
    write it to socket w
    put cr & "200 OK" & "   "& the date & "   " & the long time & "   " & z
after fld "read" of cd 1
    if the label of btn "log" of cd 2 is "Save log" then put cr &  "200 OK"
& "   "& \
        the date & "   " & the long time & "   " & z  after url logFile
  end if
  get itemOffset(suffix,fileSuffix)
  if it is not 0 then
    put "binfile:"& pFile into xFile
    write url xFile to socket w
    #  write  xFile to stdout
    put cr & "200 OK" & "   "& the date & "   " & the long time & "   " & z
after fld "read" of cd 1
    if the label of btn "log" of cd 2 is "Save log" then put cr &  "200 OK"
& "   "& \
        the date & "   " & the long time & "   " & z  after url logFile
  end if
end getSuffix

What happens when the CGI suffix is not there? Also if Mac's won't run .mt
scripts the same way as Unix, and following on from Scott's comments on
Windows NT servers, wouldn't it be good to implement CGI's in a platform
independent way?

> From: Andu <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Fri, 19 Nov 1999 20:16:18 -0500
> To: [EMAIL PROTECTED]
> Subject: Re: Apache no more: Metacard server and and Metacard CGI's?
> 
>> OK, still can't get the CGI working with the "mchttpd_0.1b.mc" server. In
>> order to rule out my limited understanding of Linux, I've switched to the
>> Mac, and put everything in the same folder.
> 
> I just tested echo.mt with mchttpd and it works if...you have mchttpd,
> echo.mt and MC in the same directory. Also as Scott pointed out, make sure
> all files have permissions set the same (rwx).
> For example: say you have a directory /root/mcrd with all the above in it.
> Make sure you set the directory to it. Start the server(double check the
> Settings) and open the browser with address set to say
> 192.168.33.4:8080/echo.mt. You should see the environment variables of your
> system.
> On MacOS it shouldn't work with .mt files, but, you need a stack scripted
> for receiving and sending appleEvents from/to the server. In the end it
> works just the same. Still didn't have time to check if it works with any
> scripts(perl) but all the server does is to "open process" which mens to
> execute the script.
> Maybe it's time I do this for a living ;-)
> 
>> 
>> Echo.mt still does not work. I've renamed metacard to "mc", the "index.html"
>> and any other root files are served up OK, but the CGI hang's the server (do
>> I need another Metacard app to load and run the CGI?), and it looks as is
>> nested folders aren't recognised within the root folder (pathname problem?).
>> 
>> Haven't looked at the script yet. Might get a chance tonight, but i would
>> really appreciate some help getting the CGI working by Monday as I want to
>> do some teaching using metacard cgi's monday afternoon. Any help out there?
>> 
>>> From: andu <[EMAIL PROTECTED]>
>>> Reply-To: [EMAIL PROTECTED]
>>> Date: Thu, 18 Nov 1999 13:07:40 -0500
>>> To: [EMAIL PROTECTED]
>>> Subject: Re: Apache no more: Metacard server and and Metacard CGI's?
>>> 
>>> On Thu, 18 Nov 1999, you wrote:
>>>> OK progress, I've ditched Apache for now and have got the Metacard
>>>> server up
>>>> and running on Linux. Serving HTML works but can't get the echo.mt cgi to
>>>> work yet.
>>>> 
>>>> I think this is probably because the root for the server is:
>>>> 
>>>> /root/mc23/mchttpd
>>>> 
>>>> and the root for the Metacard app is:
>>>> 
>>>> 
>>>> /root/mc23
>>>> 
>>>> so if the .mt script work like perl etc I guess the first line should be:
>>>> 
>>>> #!/root/mc23/mc
>>>> 
>>>> But not sure.
>>>> 
>>>> By the way, will the server work with Perl CGI's etc?
>>> 
>>> It should work with any scripts, I have to double check though(later on
>>> tonight). You just have to add the suffix to the config file in  Settings.
>>> 
> 
> 
> Regards, Andu
> 
> 

Reply via email to