Running CGI's locally on OSX

Mark Paris mparis at nc.rr.com
Fri Jul 5 08:59:01 EDT 2002


Sivakatirswami,

Try this one instead---I just changed the first line.  Make sure the Darwin
engine is in that directory and chmod'ed to 755, and put your script in
there for good measure (755 also) and then try to run it as
http://myip/cgi-bin/test-mc.cgi

If that doesn't work, try my original "hello" script verbatim from my post a
few days back, with the same directory structure/placement.  I think you
must be close!  I know I found it very frustrating to have a system with so
much ability and so little documentation.  I don't know what Apple is
thinking, but it seems that they want to give a great product, yet keep the
instructions on how to use it a big secret.  Lol.  ?!

Anyway, let me know if it works for you!

Mark



======test-mc.cgi
#! /Library/WebServer/CGI-Executables/Darwin 2
on startup
  put "Hello" into buffer
    put "Content-Type: text/html" & cr
    put "Content-Length:" && the length of buffer & cr & cr
    put buffer
end startup



----- Original Message -----
From: "Sivakatirswami" <katir at hindu.org>
To: "Metacard List" <metacard at lists.runrev.com>
Cc: <use-revolution at lists.runrev.com>
Sent: Thursday, July 04, 2002 9:22 PM
Subject: Re: Running CGI's locally on OSX


> > From: "Mark Paris" <mparis at nc.rr.com> wrote
>
> >
> > What do you get when you try:
> >
> > http://my.machine.ip/ or http://localhost/ ???
> >
> [SNIP]
>
> Thanks Mark, the macDevCenter page on Apache for OSX was useful, if only
to
> help get some more terminal skills up and running...and yes, you are right
> http://my.machine.ip/cgi-bin/ does map to the /Library/ and I am getting
the
> default Apache page...
>
> OK,  I uncommented the httpd.conf file at the point where the
>
>  AddHandler cgi-script .cgi
>
> As this was the sole semi- related recommendation and also recommended by
> Richard MacLemale last year... (Though that should not affect running
CGI's
> in the /Library/WebServer/CGI-Executables/ which should be enabled by
> default...according to the MacDevCenter article)
>
> Theoretically there is nothing else to do.  OK. So far so good,  but, now
I
> am getting a
>
> "Premature end of script headers" error message in the error_log when
trying
> to  call this script:
>
> ======test-mc.cgi
> #!/mc
> on startup
>   put "Hello" into buffer
>     put "Content-Type: text/html" & cr
>     put "Content-Length:" && the length of buffer & cr & cr
>     put buffer
> end startup
> =========
>
> I don't know if this means that the MC Darwin engine is working or not...
>
> Anyone else have clues? Again, seems simple, but doesn't work.
>
> recap:
> --Darwin engine downloaded and installed into
> /Library/WebServer/CGI-Executables/
> --And the above test script as well... Both files permissions set to CHMOD
> 755
> --"AddHandler cgi-script .cgi " was enabled in the httpd.conf file
> --But http://my.machine.ip/cgi-bin/test-mc.cgi still doesn't work
> --Error log says: "Premature end of script headers:
> /Library/WebServer/CGI-Executables/test-mc.cgi"
>
>
>
> Hinduism Today
>
> Sivakatirswami
> Editor's Assistant/Production Manager
> katir at hindu.org
> www.HinduismToday.com, www.HimalayanAcademy.com,
> www.Gurudeva.org, www.hindu.org
>
> Read The Master Course Lesson of the Day at
> http://www.gurudeva.org/lesson.shtml
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list