Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIS, PerlScript, and a problem... 4

Status
Not open for further replies.

shrubble

MIS
Jul 23, 2003
300
US
At my last job we had a local, in-house written program that ran on IIS. It was a typical n-tier web front-end with a database back-end. The guy that had the job before me wrote the app, but because he was more of a UNIX guy, he wrote the .asp in PerlScript (not vbScript) which was somewhat unusual, but worked fine.

The problem:
The guy that replaced me at this job called me up and said that a power surge blew the server, and he had to set much of it up again (and apparently did not have a back-up of the IIS config). I went over to give him a hand, and we got all of the virtual directories for everything else set-up (typical stuff- intranet, webmail, etc...), but we could not get this PerlScript app to run.

My gut feeling is that we need to link a Perl interpreter to the script files (which, while being written in PerlScript, are still .asp extension). We did get an error page from the virtual directory, but it was generic, and didn't really reveal too much.

Anyone have any ideas?

Thanks




"I would rather have a free bottle in front of me, than a pre-frontal lobotomy..."

-Shrubble
 
One more thing...

I believe that it was set up with a version of ActiveState's perl interpreters.

"I would rather have a free bottle in front of me, than a pre-frontal lobotomy..."

-Shrubble
 
sounds like ActiveState Perl needs to be installed and the application mappings modified to send .asp files through the perl interpreter.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
If you're using Win 2000 then you need to create the "App Mappings" for the Perl extensions on the web site that will be using that Perl script. To do this: Open the IIS Management Console, right click the website by name, select properties. Under the "Home Directories" tab click the "Configuration" button (look under Application Settings) and then click the "ADD" button in the new window. Browse to the Perl installation files and open the "Bin" folder, inside you'll find the "perl.exe" or the "Perlis.dll" files - either works. Add this to the end of the path if CGI errors occur [ "%s" %s] The extention is .pl or .plx, and the "Verbs" are usually GET,POST


If you're using Win 2003 then perform the above Win 2000 process and don't forget to add Perl to the "Web Service Extentions" or the web site will give you dorky errors.
 
Thanks!

This app isn't really running like a CGI (all of the files have an .asp extension).

Do you know off-hand what I need to do if it's running like any other asp/IIS application, but only written in PerlScript? I've seen in IIS where I can specify the default scripting language, but is it enough to just change that? I find it hard to believe that Windows would have a built-in Perl interpreter...

Thanks again!

"I would rather have a free bottle in front of me, than a pre-frontal lobotomy..."

-Shrubble
 
Shrubble -

it's actually pretty easy, as that's the set up we use at my shop.

First, go to ActiveState.com, specifically

and download ActivePerl and install that on your IIS server. Reboot.

Next, make sure you download all the Perl modules you need. Open the individual Perl scripts (*.asp) and look at the top for lines that say "use X;" (ie. use CGI;). Write down X.

on your IIS server, open a command prompt. for each of the modules above, run this command:

perl -e "use X" (be sure to use the double quotes).

If nothing happens, you're all set. Otherwise, perl will complain and say it can't find this module, and you need to install it (which i won't go into here unless you run into that problem. just post and i'll see if i can help you out)

Now, if everything goes well and you're still with me, go to the properties of your virtual directory. If you're accessing databases and the such (you're in for a major headache if you are), give the V.D. "Write" access. Otherwise, just change the Execute Permissions to "Scripts and Executables".

Finally, click on the Configuration button

Now, i'd probably rename the Perl scripts to *.CGI just to clear up any confusion, and then configure CGI files to be executed by ActivePerl

Click on the Add button and add this: (it's VERY important to add the quotes again here)

Executeable: c:\perl\bin\perl "%s" %s
Extension: .cgi

(assuming Perl installed to C:\)

Hit OK a couple of times, and try loading your webpage.

Most likely you'll hit a snag or two, but just post it here. I've had to do this a hundred times, so i'll do my best to give you a hand.

Good luck!

- alex
 
Alex,

I just utilized your instructions. I now get this error message when I browse to the webpage:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


syntax error in file ***************** at line 1
Translation aborted due to syntax errors. (*= my .asp start page)

Any idea what is causing this error.

Thank you for the post and thanks to shrubble for researching this topic for me!

-Chanzen
 
Chanzen -

can you paste the first, maybe 5 or 10 lines of your code? if it's Perl/CGI, you may need to insert this line at line one:

#!<PATH TO perl.exe>

(so: #!c:\program files\perl\bin\perl.exe)

if it's VisualBasic/ASP, it may be looking for something else. . .

- alex
 
Alex,

Here are the first couple of lines in what I believe to be the default page of the .asp script:

<% @LANGUAGE="PerlScript" %>

<%

use Win32::ODBC;

require "I:/shared/bio-erm/projectsdb/html/shared.pl";

my $db = new Win32::ODBC("projectsdb");


I hope this is what you were asking for. If not, let me know. I appreciate all of your help!

Chanzen
 
hmmm. . .it looks like you're trying to run a perl/cgi script inside a VB script, which is something i really don't have any experience with. maybe someone else on this board can help you with that one?

sorry!

- alex
 
I have been struggling with this problem for a few days now. This thread really helped, but now when I browse to the CGI script, IE tries to download the script rather than run it. Any ideas?
 
Alex,

Thanks for all your help. I have found contact information for the gentleman who wrote the script, so I should be OK. Thanks again!

Chanzen
 
Cipro -

it sounds like you might have missed this step:

/******/

Finally, click on the Configuration button

Now, i'd probably rename the Perl scripts to *.CGI just to clear up any confusion, and then configure CGI files to be executed by ActivePerl

Click on the Add button and add this: (it's VERY important to add the quotes again here)

Executeable: c:\perl\bin\perl "%s" %s
Extension: .cgi

(assuming Perl installed to C:\)

Hit OK a couple of times, and try loading your webpage

/******/

Your server doesn't realize it's supposed to execute .cgi scripts, and is treating it like an unknown file. double check the step above, and make sure perl has been installed successfully. . .

Let me know how you fare

- alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top