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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pearl & CGI help.... 1

Status
Not open for further replies.

melocco

Technical User
Jan 19, 2001
229
US
OK.. I have installed IIS a few weeks ago and got every thing working.. I installed the php 4.1 and mysql.. Now I want to see if I can install Activepearl.. I have it and installed it and it looks like it installed right.. But It doesn't seem to work.. I know I need to have cgi on the server (which php and mysql doesn't need), well a cgi bin.. But I can't find anything about installing or intergrading a cgi-bin with IIS, nor can I figure out why the pearl doesn't work but the php does... Can I use both on the same system? Or is it something simple (which with my luck it isn't) that I'm over looking.... If some one could help me out I would be really great full... What I need to know really is can they work together, and if so where or how can I install a cgi-bin on my server with IIS as the server? Thank you.... Melocco............
 
Oh, while I am thinking about it... I'm running Windows XP Pro. and 1.6 gig's of ram with a PIII 933 eb cpu on a cable connection.. I have the IIS that came with XP Pro. I think with out looking it's version 5.0.. I didn't know if some one would need that info or not.... Thanks again....... Melocco....
 
I just installed Active Pearl yesterday. I was able to get it working using the online installation instructions. I put the perl folder on the root of my partition. The CGI script I wanted to run, I put in the scripts directory under inetpub. You have yo go into IIS Manager, go to the properties of your default web site, go to the Home Directory tab, then the Configuration button (near the bottom), ADD
Executable: <path to perl.exe %s> (C:\Perl\bin\perl.exe %s for mine)
Extension: .cgi
All Verbs
Script engine (checked)
Ok
Ok
restart iis and you should be working ok.
Test by running-
perl example.pl
from the DOS prompt in your Perl\eg folder

Domenick Pellegrini
dpellegrini@yahoo.com

 
So just make another pearl.exe and make the exetention .cgi? now.. Would that work for all cgi? or do I need something else installed??? Thanks...
 
I don't think you need to make another perl.exe, just make sure that your IIS is configured to the correct directory where the perl.exe you installed is. As far as I know you don't need anything else. The only other thing that I can think of that you will have to remember is to make sure the first line in your cgi files points to the /Perl/bin/perl.exe path (same as the path you set in IIS).

Domenick Pellegrini
dpellegrini@yahoo.com

 
OK.. I just seen some other scripts that say to put files in the cgi-bin folder.. that's the only place that the files would work... So I take it that I need to make a folder and rename it CGI-bin for it to work right.. OK.. I think I gotcha now... Thanks for your help.... I owe you one..... Melocco...............
 
Some scripts may have cgi-bin as a cgi directory, which you should be able to modify in the cgi files themselves. Otherwise you can create the cgi-bin directory(I would say in the same path as scripts. You still may need to modify the scripts though. Many are meant for a unix system which has the following directory structure(by default, it can be changed there too) compared to iis:
IIS path-c:\inetpub\scripts c:\inetpub\Apache path-/var/ /var/
Those are the equivelant folders. So some scripts may need these paths modified to reflect the proper path.

I think I made that as clear as mud. Hope I didn't confuse you.

Domenick Pellegrini
dpellegrini@yahoo.com
 
OK it's Perl NOT Pearl!!

You can map as many extensions as you like to the Perl interpereter. Usually the ActiveState Perl installer will automaticlly map .pl for you. To do this manually in IIS5 open the Management Console, right click the server, select Properties then Home Directory then Configuration (if this is greyed out click &quot;Create&quot;) click App Mappings. You can see the list of extensions and what IIS uses to process them.

For example you can see that .ASP is processed by asp.dll

To add a mapping for .cgi simply click Add then enter the path to the executable, the extension and the verbs.

For example

C:\perl\bin\perl.exe %s
.cgi
GET,HEAD,POST

The %s is important by the way!

Also - you do not NEED to have a CGI-BIN directory. You can put your scripts anywhere but this is not recomended. It is better to put all your scripts into one directory (which can be called anything) because you have to tell IIS to give the script directory EXECUTE permissions as well as the usual SCRIPT permission which ASP uses.

(Before anyone says anything I *know* IIS enables you to do this on a per file basis - I'm just trying to keep things simple)

One thing to note in Unix scripts is the first line tells Unix where to find the interpereter. This is not required under Windows. So you can safely ignore the first line of the script is it looks like...

#!/cgi-bin/perl


Hope this helps.
 
If you have not already figured out how to make your perl script work, maybe this will help. If you had to make a cgi-bin or if you used another folder, make sure it has exucatable permission. It matters not where the perl program is on your machine, so you don't have to reinstall it. Next, instead of using *.cgi change the extention to .pl this will tell windows to use perl to run the script. May be this will help.
 
sorry about the pearl. meant perl. listen to what I mean, not what I say....lol

Domenick Pellegrini
dpellegrini@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top