Running CGI's locally on OSX

Sivakatirswami katir at hindu.org
Fri Jul 5 00:05:01 EDT 2002


> 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




More information about the Use-livecode mailing list