Classic CGI on Win

Mark Wieder mwieder at ahsoftware.net
Wed Aug 11 11:50:38 CDT 2010


Malte-

I found the writeup I posted to this list on 18 April 2006 archived at
gmane. I'm posting it in its entirety. In 2006 I was still using a
Win2k server, so some of this is probably different now. I still don't
recommend doing this, but this should at least give you an idea of
what you'd be in for if you did decide to go this route.

-----------------------------------------

I don't recommend this, but if you *really* have to get Revolution
working as a cgi service on a Windows server, here's how. Note that
you have to start with having IIS already installed. And you have to
be logged in as an administrator. And that you're probably much better
off installing Apache and working with that. It's more secure and more
stable and open source and easier to configure and work with.

http://www.apache.org/

But if you gotta you gotta...

Basically what you're going to do here is create a directory to hold
the executable and scripts, then configure IIS to know about .cgi
files and associate them with the Revolution executable. Out of the
box, IIS is by design fairly dumb. It knows how to run ASP code
embedded in web pages, but for anything else you have to go through a
lot of contortions.

Start by pointing a web browser at:
http://my.execpc.com/~keithp/bdlognt.htm

Now click on the Section labeled "IIS Server Setup". Don't bother
installing perl unless you're interested in running perl scripts. A
few paragraphs down, however, is that part about creating a cgi-bin
directory *outside* of the inetpub directory. Start from there,
following all the directions verbatim (you don't have to call the
directory "perl-scripts", though). If you're having trouble finding
the Internet Service Manager it's either on the Start Menu in
Administrative Tools or in a control panel named Administrative Tools
or else you don't have IIS installed.

When you reach the part labeled "Setting Up Scripts", stop. Instead of
browsing for the perl interpreter you'll want to find the Revolution
executable. I placed a copy in the cgi-bin folder just to make things
easy on myself, but if you have Revolution installed you can just
browse to the file in your Revolution folder. Add the parameter string
(without quotes) after the executable, so you should end up with:

C:\cgi-bin\revolution.exe %s

Create the canonical "hello.cgi" test script as a text file and copy
it to the same cgi-bin directory you dumped the executable in. Note
that Windows will ignore the #!revolution line at the beginning of the
file, so it doesn't matter what it says, or even if it exists at all.

Launch a DOS command window from the start menu. Assuming that you've
called your cgi-bin directory "cgi-bin", type

cd \cgi-bin
revolution hello.cgi >test.txt

Type dir. You should see a 39-byte file named "test.txt".

Type test.txt

You should see "Hello World!". This verifies that your script is
correct.

Now you're configured and ready to go. Close the ISM if you haven't
already, launch Services from the Administrative Tools, and launch the
World Wide Web Publishing Service down at the bottom. If it isn't
started already then right-click on it and select "Start" from the
contextual menu.

Once it's up and running go to a client computer, launch a web
browser, and point it at the hello.cgi file. In my case, my Win2k
server is at 192.168.0.253, so I go to:

http://192.168.0.253/cgi-bin/hello.cgi

You should now see the text "Hello World!" on your browser.

Whoopee. You could've done all that by installing Apache, but you'd
miss the headaches, and what fun would that be?

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list