Forum Moderators: coopster & phranque

Message Too Old, No Replies

Perl/CGI in IIS 6 - boy do I have problems (long)

perl scripts not running in IIS 6

         

TypicalGirl

6:41 pm on Oct 12, 2003 (gmt 0)



Hi there everyone,
Hoping I can find some help here for problems I'm having.
I have 2 small servers. Till last week both were running W2k pro with IIS 5.0 Most recent version of ActivePerl installed on both with Mail.SendMail.pm being the only extra mod installed.
I use Argosoft Mail, FTP and News servers on both machines and IIS as a web server.
Both systems hosted several domains, and since W2k only allows 1 website, the rest were forwarded to sub directories in my main website. Also, my root directory is outside InetPub. I don't do anything at all with ASP, PHP, .NET etc. Just a sort of Unix-looking setup and things have worked fine (except for mail siiues which is another topic...).

Anyway, last week I broke down and bought W2k3 Standard because I wanted to host all the websites on 1 server.
I'm wading my way through the help files, news groups and the books I've purchased, but having some brain fry. All I want to do with this server is serve websites. Don't care about intranet, file sharing, "gardens", "forests" etc. so its been a little tough wading through the doccumentation trying to find answers.

I gues the *broad* question is why do so many of my scripts not work properly in IIS 6 when they worked so well in IIS 5?

Specifically, I'm having problems with a couple of scripts...
I have a news posting script that has an admin script and the news script, called via SSI.
The admin script works fine, and on IIS 5, the news script shows on my SHTML page as it should.
In IIS 6, I get this error:
"Failed to execute CGI: Win32 error code =3"
The ssi tag is "exec cgi" instead of "include virtual"
and plain old html pages included on the page via SSI show up just fine.
I went in to IIS 6's Web Service Extensions in the IIS manager and set all CGI scripts (known and unknows) to "Allow" and did the same with SSI extensions.

So that's problem #1
Problem 2 is with a web portal script I use called WebApp
Again it works just fin on IIS 5, but on IIS 6 I only this error:
"the specified CGI application misbehaved by not returning a complete set of HTTP headers"
Now, this script was written for Unix, but does run in Windows. It has email problems in Win but I've corrected those.

Sorry this is so long. I thought this whole thing would be easier and I guess I'm getting a little frustrated.
Thanks in advance for any help or resources for me!

mattur

4:08 pm on Oct 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As you have discovered, MS have made IIS6 less forgiving and (theoretically) more secure. I've no exp. of these particular probs, but I'll try to help anyway... ;)

For the first problem, I'd check permissions first. Temporarily putting the IUSR Account into administrators could confirm whether this is an issue. You could also turn on object access failure auditing.

For the second, you should check that your script is returning approp. headers: it must return a content-type header and a status code header for IIS6. HTH

JollyK

5:50 pm on Oct 15, 2003 (gmt 0)

10+ Year Member



Under some installs of IIS6, I've noticed that if you try to use the GET method along with a single argument (blahblah.pl?argument), you'll get the "cgi misbehaved" error.

After extensive testing (since I couldn't bring myself to believe that this could be the problem), I finally worked around it by rewriting everything to use the POST method rather than GET for single-argument query strings.

You can see for yourself if this is the problem by trying a script that does something like:

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "QUERY_STRING: $ENV{'QUERY_STRING'}";

Call it as [blah_blah...] then call it as [blah_blah...] . If they both return the error, then GET is probably disabled altogether. If only the first returns the error, then GET is okay, but it doesn't like the single-argument syntax.

I solved it by rewriting everything to use POST and changing all blahblah.pl?argument into blahblah.pl?arg=argument or similar.

Dunno if this will help, but I've run into this situation while helping people install stuff on IIS6 twice now.

JK