Getting MC CGI to work on OS X with "Web Sharing" turned on

Ken Ray kray at sonsothunder.com
Sun Oct 19 01:08:42 EDT 2003


For those of you not on the MetaCard mailing list, Jacque is responding
to my post about getting the MC CGI to work on OS X. Here's my my
original post which may be of some help to people looking to get Rev or
MC working on OS X as a CGI:

------------------------
OK, I finally got it to work, and I'll be writing up a tip on it right
away. :-) But for those taking notes, here's the steps:

1) Turn on Personal Web Sharing in the Sharing control panel (which told
me my web address was "http://192.168.1.100/~kenray/"). This creates an
index.html file in the Sites folder on your hard drive (in my case it
was /users/kenray/Sites/).

2) Download the Darwin MC CGI from the Metacard web site, decompress it
down to its "mc" file, and put it into folder
/Library/WebServer/CGI-Executables.

3) Place your CGI script in the same folder as the "mc" file. Mine is
called "simple.cgi", which simply dumps "Hello World" as a result. It
looks like this:

!#mc

on startup
  put "Hello World!" into tResponse
  put "Content-Type: text/html" & crlf
  put "Content-Length:" & the length of tResponse & crlf & crlf
  put tResponse
end startUp

4) Set the permissions on both files to at least 755 (I used 777 (just
in case)).

5) Open up Terminal, do "cd /library/webserver/cgi-executables/" to get
to the CGI-Executables directory, and execute "./mc simple.cgi". You
should get back this:

Content-type: text/html
Content-length:12

Hello World!

6) Then, open up your browser and type the IP address you were given in
the Sharing control panel, followed by "/cgi-bin/simple.cgi". In my case
it was:

  http://192.168.1.100/cgi-bin/simple.cgi

You should get "Hello World!" showing up in your browser. 

As Dave noted, the /Library/WebServer/CGI-Executables directory can be
referred to as "cgi-bin" in your urls.

7) Create the rest of your site in the Site folder and when you want to
refer to the CGI, simply use <IP>/cgi-bin/<script>.

Thanks for everyone's help!

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> J. Landman Gay
> Sent: Saturday, October 18, 2003 12:47 PM
> To: Revolution Mailing List
> Subject: Re: Getting MC CGI to work on OS X with "Web 
> Sharing" turned on
> 
> 
> On 10/18/03 11:56 AM, Ken Ray wrote:
> 
> > 7) Create the rest of your site in the Site folder and when 
> you want 
> > to refer to the CGI, simply use <IP>/cgi-bin/<script>.
> 
> Or you can use "localhost" if you don't want to hard-code an IP:
> 
   <http://localhost/cgi-bin/simple.cgi>

Saves some trouble if you have dynamic DNS through a router.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
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