Zygodact on Windows Server IIS

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
xfratboy
Posts: 97
Joined: Fri Mar 05, 2010 9:09 pm

Zygodact on Windows Server IIS

Post by xfratboy » Sat Jul 10, 2010 2:16 pm

Has anyone managed to get the Zygodact Add-On to work on a windows server that is just running IIS (not Apache or PHP platform)?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Zygodact on Windows Server IIS

Post by jacque » Sat Jul 10, 2010 6:04 pm

Just adding a note here -- setting up Zygodact is the same as setting up any other CGI on a server. So the real question is how to get the CGI engine working on a Windows server. Once that's done, Zygodact will work like anything else. Unfortunately I've never used a Windows server so I'm not sure what the details are. Maybe someone else here has done it.

The best way to test an installation is to start with a very simple CGI like the one here: http://www.hyperactivesw.com/cgitutoria ... html#world. This doesn't have any other dependencies or use any stacks, so it's ideal for testing whether you've set up everything correctly. Once that works, you can expand to more complicated scripts.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

xfratboy
Posts: 97
Joined: Fri Mar 05, 2010 9:09 pm

Re: Zygodact on Windows Server IIS

Post by xfratboy » Sun Jul 11, 2010 4:19 am

Yes. I've read the tutorial. Found several tutorials actually. I've got some kind of problem I think with running CGI on my server. I can invoke the engine from a command line and get a result [ c:\cgi-bin revolution.exe hello.cgi >hello.txt ] , but the mapping of revolution.exe to cgi extensions under an IIS website just doesn't seem to work. So, it must be some sort of server issue. I don't know. It'd be nice to get this running in order to automate the process but I can just generate keys manually and work on a more permanent solution down the road.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Zygodact on Windows Server IIS

Post by jacque » Sun Jul 11, 2010 7:34 pm

The mapping is handled by the first line in the CGI text file, at least on Mac and Unix systems. You need a "shebang" line followed by a blank line, and the name you use in the first line must match the executable exactly. What's the first line in your "hello.cgi" file?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

xfratboy
Posts: 97
Joined: Fri Mar 05, 2010 9:09 pm

Re: Zygodact on Windows Server IIS

Post by xfratboy » Mon Jul 12, 2010 2:11 am

Here's my hello world script:

Code: Select all

#! C:\WebSites\MyDomainName.Com\cgi-bin\revolution.exe -ui

on startup
  put "Content-Type: text/plain" & cr & cr
  put "Hello World!" && $REMOTE_ADDR && "The time is:" && the time
end startup

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Zygodact on Windows Server IIS

Post by jacque » Mon Jul 12, 2010 3:31 am

You need a local file path, not a full url. A full url will go out to the net and then get redirected back in like a remote request, and you can't load cgis that way. Change the first line to:

#! revolution.exe -ui

That makes it a local file on the server. Make sure both the .exe and the hello world script are both in the cgi folder.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

xfratboy
Posts: 97
Joined: Fri Mar 05, 2010 9:09 pm

Re: Zygodact on Windows Server IIS

Post by xfratboy » Mon Jul 12, 2010 1:39 pm

I see. Well, I made that change but it's still not working. It's got to be with IIS. I'm sure there's just some little check or setting somewhere that's not configured properly.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Zygodact on Windows Server IIS

Post by jacque » Mon Jul 12, 2010 7:53 pm

Apparently CGI support is not installed by default on IIS. You could try searching "CGI on IIS" on google, I got a lot of hits. There is apparently something you need to set up but I didn't pursue it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

xfratboy
Posts: 97
Joined: Fri Mar 05, 2010 9:09 pm

Re: Zygodact on Windows Server IIS

Post by xfratboy » Tue Jul 13, 2010 4:10 am

Jacque, thanks for sticking with me on this. This is the fix I came up with for for Windows 2003 server running IIS 6 (with help from http://blogs.sun.com/gc/entry/configure ... h_perl_cgi).

1. Start the Internet Information Services (IIS) Manager from Window's Administrative Tools menu.
2. Select Web Service Extensions. Click Add New Web Service Extension.
3. Enter a descriptive Extension Name (such as "Zygodact CGI"), then enter the following string in the Required Files field (changing below for your specific directory):
C:\myCgi-bin\revolution.exe "%s" %s
You'll get a message about environment variables not being expanded.. just click ok.
Set Extension Status to Allowed, then click OK.
4. Expand the Web Sites directory in the IIS Manager and right-click on the Web Site you want Zygodact to work on (this is assuming there are multiple websites on the same server). Otherwise just right click on Default Website.
5. Select New | Virtual Directory.... Use the wizard to name/alias and specify the location of your CGI directory used in step 3 (e.g. C:\myCgi-bin\ ). The "Alias" is the name that can be directly referenced in a URL. So if you give it an alias of "cgi-bin" then your website address to this virtual directory would look like:
http://www.mywebsite/cgi-bin
6. On the Access Permissions page, ensure that Read, Run Scripts and Execute are enabled.
7. Right-click the new virtual directory you just created and select Properties. On the Virtual Directory tab click on the Configuration button.
8. On the Mappings tab select Add. You will now add a mapping to ensure that the .cgi extension is mapped to the revolution.exe interpreter specified above. (Enter the same string in the Executable Path field as shown in step 3; e.g. C:\myCgi-bin\revolution.exe "%s" %s. Make sure the checkbox for Script Engine is checked.

Now you should be able to test by going directly to the cgi file: http://mywebsite/alias_name_given_in_step_5/hello.cgi

Oh.. one more BIG thing that threw me off. Since this only runs with 3.5 or earlier engine, you have to use the engine located within version 3.5:
Revolution Studio/3.5.0-gm-2/Runtime/Windows/

You'll see a file called "Standalone", this is the engine. Someone may correct me here, but I had to to rename it from Standalone (with no extension) to revolution.exe to get it to work.

Post Reply