We help IT Professionals succeed at work.

Requiremnets to run cgi through IIS 5.0

Hello I am new to cgi and perl. I have the IIS on advance server. But i donot know what is the requiremnet to enable the cgi and perl on my local server. I mean what is the software requirement for the same and how can i configure the same.

With Regards
Loveneesh
Comment
Watch Question

CERTIFIED EXPERT
Commented:
loveneesh_bansal,

"..Hello I am new to cgi and perl. I have the IIS on advance server. But i donot know what is the requiremnet
to enable the cgi and perl on my local server. I mean what is the software requirement for the same
and how can i configure the same...."

Do you have Perl installed on your machine?

You can get Perl from....

http://www.activestate.com/Products/Download/Get.plex?id=ActivePerl

once you  have installed it, please follow these steps to configure IIS to run Perl scripts.


Creating a Test PERL Script
======================
Open a new file with Notepad, and copy the following lines of code. Save the file in the scripts directory as "helloworld.pl".

$url = "http://$ENV{SERVER_NAME}$ENV{URL}";
$ip = "$ENV{REMOTE_ADDR}";
print <<ENDOFTEXT;
HTTP/1.0 200 OK
Content-Type: text/html

<HTML>
<HEAD><TITLE>Hello World!</TITLE></HEAD>
<BODY>
<H4>Hello World!</H4>
<P>You have reached <a href="/default.aspx?scid=$url">$url</a></P>
<P>Your IP Address is $ip</P>
<H5>Have a nice day!</H5>
</BODY>
</HTML>
ENDOFTEXT
exit(0);

NOTE : The PERL language allows no spaces at the beginning of a line. Once you have created the file, you need to configure PERL to run
securely with Internet Information Services. "Perl.exe" should not be located in any of the directories accessible by a user with a browser.

By using the Internet Service Manager MMC Snap-in, you can place the "Perl.exe" or "PerlIS.dll" outside of the normal Web directory
structure a user has access to and use the "Script Mapping" feature of IIS to configure execution of PERL scripts.

Configuring PERL Script Mapping
==========================
Select the Internet Services Manager (ISM) under the " Administrative Tools " menu.

Right-click a Web site that you want to enable PERL for and select Properties .

Select the Home Directory tab.

Click Configuration button.

Click Add .

Enter the following for the "Executable":

<full path to perlis.dll>\perlis.dll

Or the following:

<full path to perl.exe>\perl.exe %s %s

NOTE : The "%s %s" is case sensitive (for example, "%S %S" will not work)

Enter the following for the "Extension":

.pl

NOTE : Make sure that the "All Verbs" radio button is selected for full functionality

Click "OK" all the way back to the ISM

Using the default scripts directory with IIS, the URL would be the following:

http://<Server Name>/scripts/helloworld.pl

Author

Commented:
Thanks for you kind response I have solved the problem myself. But your method of solving the problem is also nice. It is working fine.
CERTIFIED EXPERT

Commented:
loveneesh_bansal,

"..Thanks for you kind response I have solved the problem myself. But your method of solving the problem
is also nice. It is working fine..."

Glad to know you were got the solution you were looking for. Can you pl. share the solution that you used?

Let me know.
CERTIFIED EXPERT

Commented:
loveneesh_bansal,

"..Thanks for you kind response I have solved the problem myself. But your method of solving the problem
is also nice. It is working fine..."

Glad to know you were got the solution you were looking for. Can you pl. share the solution that you
used?

Let me know.
CERTIFIED EXPERT

Commented:
loveneesh_bansal,

                     "..Thanks for you kind response I have solved the problem myself. But your method of solving the problem

                     is also nice. It is working fine..."

                     Glad to know you were got the solution you were looking for. Can you pl. share the solution that you

                     used?

                     Let me know.
Oooh five points.  At least there's an NT user anticipating he's going to need lots of help and conserving his points... LOL

Seriously, CGI and Perl running under NT, unless you're running Apache with Mod Perl, is not that efficient of an operation if you're getting any decent amount of traffic. Like most Microsoft products, IIS isn't friendly towards non-microsoft applications unfortunately.


Explore More ContentExplore courses, solutions, and other research materials related to this topic.