OK, this is solved now... See below for the "skinny Primer"

> on 07-05-2002 06:01 AM, Mark Paris at [EMAIL PROTECTED]
> wrote:
> Try #! /Library/WebServer/CGI-Executables/Darwin 2
> On the first line
>  And
> on Thu, 04 Jul 2002 13:17:12 Richard MacLemale at <[EMAIL PROTECTED]>
> wrote
> Ask and ye shall receive...
> 
> http://mitchellonline.pasco.k12.fl.us/training/metacardcgi.htm
> Let me know if there's any mistakes in it, because I wrote it half a year
> ago.  Also, there's one important piece of info that I think I left out.
> When writing a cgi script for darwin mc, the script must contain UNIX line
> breaks, NOT Mac line breaks.  Which means you can't write it in TextEdit or
> SimpleText.  The best, easiest way to do this is to grab a free copy of
> BBEdit Lite, which can save files with UNIX line breaks.  Then you're off to
> the races!

Yes, this now works! :
======test-mc.cgi
#! /Library/WebServer/CGI-Executables/mc #or whatever engine filename
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

But (duh!) 

#!mc

On the first line will also work. Putting a slash in front when the engine
filename was obviously the wrong thing to do (Unix thinks it's a directory)

So.. It was a "path thing" that was the trouble... OK, that's a wrap. And,
Richard... You page looks good except
a)  Yes, we need to document using Unix endlines (I did use BBEdit and I
just save scripts that way as standard procedure... So I also didn't think
about it, but needs to be told..." and
b) you only need the one file -- the engine itself (no home stack tools etc)
in the CGI-Executables

Thanks for everyone's input... What a great forum!

=============Kevin... Someone could polish this for a tip of the week:

SKINNY PRIMER: installing faceless Metacard or Revolution
On your MAX OSX machine for running CGI's on your own machine:

0) Go to system preferences and turn on Web Sharing

1) Download the Darwin engine, untar and put it in:
/Library/WebServer/CGI-Executables

2) Put your CGI script in the same folder: but, caveat: be sure to save your
script in BBEdit as generic text with Unix endlines

3) Using Terminal.app... Navigate to CGI-Executables and then run
>From the command line:

chmod 755 darwinEngine myCGIscript.cgi

4) from command line run

ls -l to check on your permissions which should now read

rxw r-w r-w for both files

Which means: owner can read, execute and write, groups can read and write
only and the public/world can read and write only.

5) See http://mitchellonline.pasco.k12.fl.us/training/metacardcgi.htm

For more detailed explanation (Note his explanation uses Metacard...and fyi
you do not need the tools, home stack.. Only the engine is required)

6) in your browser enter

http://my.machine.ip/cgi-bin/test.cgi

To test.

7) Sample test script below. The first line is critical. It can be either

#! /Library/WebServer/CGI-Executables/darwinEngine ## for clarity
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

Or the first line can be simply

#!darwinEngine ## no slash at the beginning,

If the above works you can skip the following step

8) If you find your script is not always running every time it is called you
may need to open  this file in BBEdit by looking for hidden files in the
root directory: (very carefully!)

/etc/http/httpd.conf

And uncomment this line:

 # AddHandler cgi-script .cgi  [becomes:]
 
AddHandler cgi-script .cgi

Go to System preferences and turn web Sharing and off and then on again to
reboot Apache to get Apache to load the new httpd.conf

Now, this should not be necessary, but may be... Try without first. This
will also allow you to place the engine and scripts in a cgi-bin anywhere
else on your hard drive (in your "Sites" directory for example)  But there
are security issues if you do the latter: go to

http://www.macdevcenter.com/pub/a/mac/2001/12/14/apache_two.html

For more information and also a simple guide to using terminal.app if you
are complete unix newbie. If you have more questions, post them to the list.

END PRIMTER ON INSTALLING DARWIN TO RUN AS FACELESS CGI ENGINE ON MAC OS X
LOCAL MACHINE












Om shanti,
Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
[EMAIL PROTECTED] 
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
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to