|
Enabling KShell CGI in IIS
IIS
isn't just for ASP. Aside from ASP, ASP.NET, PHP and Perl, there are
numerous other more esoteric languages that can be used to build interactive
content. Here's how do enable the Korn Shell language on your IIS machinewww.tartoos.com
OK,
so you have something written for the Unix Korn Shell, but you want it to
run on your IIS machine. Well, the first thing you need is a Korn Shell
interpreter. You'll find one included with
Services For Unix,
which MSDN subscribers have access to. Install SFU, and you'll have an
interpreter ready to go. Now what you need to do is set up IIS to pass your
CGI information to itwww.tartoos.com
So,
crack open the IIS console, go to your website and get properties/home
directory, as below

Then, pop open the 'configuration' screen

Add a new mapping, like so

I'm using the file extension 'ksh', but you can use
whatever you like. the file path, on my system is as follows :
C:\WINNT\system32\posix.exe /u /c /bin/ksh -l %s
%s
Hit OK, get yourself back out of the IIS comsole and knock
up this quick script
function helloworld {
echo "Content-type:text/html\n\n"
echo "Hello World"
}
helloworld
exit
Save
it as 'helloworld.ksh', and save it in a cgi-bin directory, or other
directory with execute permissions.
When
you run it, you should get a 'Hello World' message, which will indicate
everything is working as planned. I've found that there seems to be a slight
problem with some machines in certain configurations, however the error
messages generated are generally weasy enough to decipher, allowing you to
fix it up if your system is one of the unlucky ones!
|