Solved

> How do I setup IIS to run CGI scripts?<

Posted on 2000-03-13
7
202 Views
Last Modified: 2013-12-25
Hi,

First time I have done this - and don't want to cock-it-up.

What do I have to do to setup my IIS (on NT) to run Perl (and other) CGI scripts?

A few queries include -

Do I have to install Perl on the machine for it to run?

Do I have to change the permissions on the .pl file in cgi-bin to make it executable (at the moment it just looks like a txt file)

any help would be appreciated here

Cheers

Charlie

0
Comment
Question by:cmuir
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 

Accepted Solution

by:
venky75 earned 30 total points
ID: 2611656
Hello there,

First thing to do is install PERL on ur m/c.

Then edit the path system variable
under Environment (available under properties of My Computer). Add the perl.exe path to the existing path if not existing(Usually is done during the installation itself)

Next click the Properties of ur site(which direct to ur cgi or perl files) on IIS. In that click on the tab "Home Directory". Then click on the "Configuration" button.
Now click on "Add" button under Add Extension /Application map setting.
In the path field mention the path of ur perl.exe(Eg.:c:/perl/perl.exe)as
      c:/perl/perl.exe %s%s
In the extn. u have to give .pl or .cgi.
Then click o.k. and apply. restart the webservice.

No permission settings are required as the above settings will help in configuring the rest.
0
 

Author Comment

by:cmuir
ID: 2611824
When installing perl should I install it at root of C: or c:/inetpub/wwwroot?
0
 

Expert Comment

by:venky75
ID: 2614704
It is irrelevant where PERL is installed. Only don't forget to mention the path to the perl exe file both in the system path and for the IIS site.
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 

Author Comment

by:cmuir
ID: 2624747
If I have it installed on D:\Perl what is the #!/ dir?

(when cgi-bin is at D:\inetpub\wwwroot\cgi-bin)

sorry about this - doh!
0
 

Expert Comment

by:venky75
ID: 2626479
This doesn't matter really what path u mention in ur .cgi or .pl file. In the IIS, it matters for path to be given to D:/Perl/bin/perl.exe...
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2645368
since you are using PERL for CGI scripting, here how you configure and test a PERL Script with Internet Information Server (IIS)

============================================
Configuring and Testing a PERL Script with Internet Information Server (IIS)

SUMMARY

  The following PERL script can be used to test for the proper installation and execution of CGI
scripts with Internet Information server.

MORE INFORMATION

  Create a file with Notepad, and type the following lines of code. Save the file in the scripts
  directory as Helloworld.pl.

  print "HTTP/1.0 200 OK\n";
  print "Content-Type: text/html\n\n";

  print "<HTML>\n";
  print "<HEAD>\n";
  print "<TITLE>Hello World</TITLE>\n";
  print "</HEAD>\n";
  print "<BODY>\n";
  print "<H4>Hello World</H4>\n";
  print "<P>\n";
  print "Your IP Address is $ENV{REMOTE_ADDR}.\n";
  print "<P>";
  print "<H5>Have a nice day</H5>\n";
  print "</BODY>\n";
  print "</HTML>\n";


  Once you have created the file, you need to configure PERL to run securely with Internet
Information. Perl.exe should not be located in any of the directories accessible by a user with a
browser.

  With a script mapping in the registry, you can place the Perl.exe outside of the normal
directory structure a user has access to.

  To configure PERL script mapping

     1.Start Regedt32.exe and open the following registry key:

       HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC
\Parameters\ScriptMap

     2.Click Add Value from the Edit menu.

     3.The Value Name is .pl

     4.The Data type is REG_SZ.

     5.The String value is D:\Perl\perl.exe %s %s

       NOTE: The "%s %s" is case sensitive. (e.g. "%S %S" will not work).

     6.Restart the WWW service.

  Now that the registry has been configured, you can test the PERL script with your browser.
  Using the defaults directory structure with IIS, the URL would be the following:

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

Author Comment

by:cmuir
ID: 2699590
Thanks :o)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Logon script fails 23 71
Powershell Code 3 58
Help to debug powershell script 5 58
powershell question - need assistance 5 24
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question