Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Perl for Win2000

by Speedy (Monk)
on Feb 08, 2002 at 03:54 UTC ( [id://144024]=note: print w/replies, xml ) Need Help??


in reply to Perl for Win2000

Windows knows the script is a Perl script by the ending on the file name. Worse yet, for the Microsoft IIS Web server, having Windows know the extension is not sufficient; it must be specifically known within each IIS Web site application mapping. In contrast Unix/Linux looks for the "#!/usr/bin/perl\n\n" instruction on the first line to know what program to run. IIS ignores this line.

The ActiveState default is to add the ".pl" extension to the IIS list of recognized Web applications. In your case you could test this by changing your file name from testscript.cgi to testscript.pl and see if it now runs in the browser.

To manually add the .cgi extension to automatically execute Perl for your web site in IIS 5.0, follow the Programs/Administrative Tools/Internet Services Manager path. In the Internet Services Manager find the web site and get to its properties sheet from the menu popped up by a right click on the web site name.

When you have the Properties sheet up, click on the "Home Directory" tab at the top. On that page look for the Configuration button below and to the left of the application field.

Under the "App Mappings" tab Look down the list of extensions known to that IIS web server and see if the .pl extension is listed. If so, you can check out its properties (path, verb set, etc.) and use it as a model for a new application extension, except this time with the .cgi extension.

On the executable path add "%s" %s for parameters. In my case the executable path is set to:
D:\Perl\bin\Perl.exe "%s" %s
which happens to be the location of Perl.exe on my system.

Set the extension to .cgi, the Verbs set to "Limit to" with POST,GET,HEAD typed in, and the "Check that file exists" option is on with the "Use script engine" option off.

With this change, IIS now knows what application to use to execute testscript.cgi

ONE LAST CONSIDERATION: the security setting or Access Control List (ACL) for the directory holding the script and script must include a user that IIS can runs as -- normally IUSR_your-computer-name with at least read privileges. If you are not running the script in the normal INET path, this too can cause problems -- returning the message that you don't have permission to access the page.

Hope this does it.

Speedy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://144024]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-05-21 01:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found