I am trying to configure Perl on IIS 7.0, and all the documentation I can find on configuring IIS is for 6.0 and lower. And 7.0 is different, so I can't figure out how to configure this correctly.
I, too was stumped by this and could find nothing useful on the net - so figured it out by trial and error and by poring through pages of info on the internet.
Make sure that you have installed Perl and that it is in your path command as per instructions elsewhere on ActiveState (c:\Perl is where I have it.)
.
Make sure that Perl is working by creating a little perl script and running it. Here is one that should work:
#!/usr/bin/perl
print "Hello world!\n\n";
print "Press the Enter key to exit.\n";
<>; #pause
Make sure that you Install IIS 7.0 with:
Web Management Tools = IIS Management Console
World Wide Web Services = CGI
Once you have IIS running properly, go to http://localhost to check. You should get a default web page.
.
Next, go into Control Panel
= Administrative Tools
= Computer Management (Local)
= Internet Information Services (IIS) Manager
= Default Web Site (or Default Web Site == cgi-bin if you set it up that way)
= Handler Mappings
= Add Script Map (once for CGI and again for Perl as per 6. and 7.)
For CGI:
Request path: *.cgi
Executable: c:\Perl\bin\perl.exe "%s" %s
Name: Perl Script Map
Press 'OK'
Say 'NO' to ISAPI message
For Perl:
Request path: *.pl
Executable: c:\Perl\bin\perl.exe "%s" %s
Name: CGI Script Map
Press 'OK'
Say 'No' to ISAPI message
Restart IIS
Control Panel
= Administrative Tools
= Services
= World Wide Web Publishing
= Restart the Service)
Run a script that you know works. Don't do anything different until you are sure that IIS is running as expected.
I'm sorta newbie to all this stuff: i have just installed activeperl for Win vista, and have installed/enabled all components for iis7 on my window vista ultimate editin. when i try to run any *.cgi scripts, i keep on getting the "file save" dialogue from my ie...do you know what may be wrong? would really appreciate your help on this issue...i would be willing to elaborate further if required.
I am receiving the error shown below. The code is a simple login form with a "method=post" command in the form. I tried all the above, and still can't make it work. The code worked in IIS 5, and also works up on our linux servers. Any ideas would definitely be appreciated.
HTTP Error 405.0 - Method Not Allowed
Description: The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
The request sent to the Web server used an HTTP verb that is not allowed by the module configured to handle the request.
A request was sent to the server that contained an invalid HTTP verb.
The request is for static content and contains an HTTP verb other than GET or HEAD.
A request was sent to a virtual directory using the HTTP verb POST and the default document is a static file that does not support HTTP verbs other than GET or HEAD.
What you can try:
Verify the list of verbs enabled for the module handler this request was sent to, and ensure that this verb should be allowed for the Web site.
Check the IIS log file to see which verb is not allowed for the request.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
More Information... This error means that the request sent to the Web server contained an HTTP verb that is not allowed by the configured module handler for the request.
--------------------------------------------------------------------------------
Server Version Information: Internet Information Services 7.0.
Here are some things I have discovered in porting a Perl Content management System from Unix to IIS which other may find useful:
At step 7:
1. Perl.exe didn't work for me at all.
2. perlex30.dll worked better but only some things were OK (I think it is like Mod_perl)
3. perlis.dll worked and programs developed for Unix originally seem to pretty much work out of the box.
Using perlis:
The information in the manual about turning the headers on or off using the registry entry EnableCGIHeaders doesn't seem to be correct.
You have to output ALL the mime headers you need. e.g.
print "HTTP/1.0 200 OK\nContent-type:text/html\n\n";
The perl error log including anything you print to STDERR is at c:\Perl\bin\PerlIs-Err.log
The shebang line is ignored but any switches in it are not. A program with -T in the shebang line failed to run and ran when I took it out. The error log wasn't very useful. -W stopped it running as well.
Hi, On trying these guides under 64 the system will not allow the arguements "%s" %s in the path name. It claims invalid path. Have tried wrapping whole lot in quotes but it doesn't work. Am I missing something obvious?
Perl is in and running as it executes from command line fine, it's adding the modules to IIS7 64 that I'm stuck on.
Well... I followed the steps but couldn't get the script to run. Then (just for sake of experimentation) I clicked 'Yes' to the ISAPI message and that's it... It just started working!
Should I be concerned regarding this setting? Can I possibly have some issues with this?
I think the part of saying no is incorrect. I have the perl.exe working on vista ultimate 32bit. The configuration requiremnets for vista IIS is similar to 2003 IIS. You must allow the module in the restrictions part of IIS.
Look at my two screenshots of my system. They should help you
I think it is IIS 6.0. Sorry, I am more of a developer than a network/system admin but I have to jump into this right now. I got IIS running on a Windows Server 2003 and for the life of me, I can't get Perl to work. I tried everything suggested but the last little part is always different for me than what's suggested and shown. For example, in that detailed step-by-step on setting up Perl in IIS Manager, what's Handler Mappings? I was able to set up the path and everything in IIS Manager -> domain (local computer) -> Web Sites -> virtual directory (Properties) and when the Properties windows, tab "Virtual Directory" and under "Application Settings", under "Starting Point" when you click on the "Configuration" button on the right.
Is that it? Or I shouldn't do this under Virtual directories?
Help please! I really don't want to develop this using ASP! This is why I am trying to get Perl to work on IIS!
I, too was stumped by this and could find nothing useful on the net - so figured it out by trial and error and by poring through pages of info on the internet.
.
#!/usr/bin/perl
print "Hello world!\n\n";
print "Press the Enter key to exit.\n";
<>; #pause
Web Management Tools = IIS Management Console
World Wide Web Services = CGI
.
= Administrative Tools
= Computer Management (Local)
= Internet Information Services (IIS) Manager
= Default Web Site (or Default Web Site == cgi-bin if you set it up that way)
= Handler Mappings
= Add Script Map (once for CGI and again for Perl as per 6. and 7.)
Request path: *.cgi
Executable: c:\Perl\bin\perl.exe "%s" %s
Name: Perl Script Map
Press 'OK'
Say 'NO' to ISAPI message
Request path: *.pl
Executable: c:\Perl\bin\perl.exe "%s" %s
Name: CGI Script Map
Press 'OK'
Say 'No' to ISAPI message
Control Panel
= Administrative Tools
= Services
= World Wide Web Publishing
= Restart the Service)
Cheers!
Earl
1st Rate Articles
Dear Earl:
I'm sorta newbie to all this stuff: i have just installed activeperl for Win vista, and have installed/enabled all components for iis7 on my window vista ultimate editin. when i try to run any *.cgi scripts, i keep on getting the "file save" dialogue from my ie...do you know what may be wrong? would really appreciate your help on this issue...i would be willing to elaborate further if required.
thx,
Bo Yang.
I am receiving the error shown below. The code is a simple login form with a "method=post" command in the form. I tried all the above, and still can't make it work. The code worked in IIS 5, and also works up on our linux servers. Any ideas would definitely be appreciated.
===========================================================================
Server Error in Application "Default Web Site"
--------------------------------------------------------------------------------
HTTP Error 405.0 - Method Not Allowed
Description: The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
Error Code: 0x80070001
Notification: ExecuteRequestHandler
Module: StaticFileModule
Requested URL: http://127.0.0.1:80/caboodle/pos/adminindex.cgi
Physical Path: C:\sites\caboodle\pos\adminindex.cgi
Logon User: Anonymous
Logon Method: Anonymous
Handler: StaticFile
Most likely causes:
The request sent to the Web server used an HTTP verb that is not allowed by the module configured to handle the request.
A request was sent to the server that contained an invalid HTTP verb.
The request is for static content and contains an HTTP verb other than GET or HEAD.
A request was sent to a virtual directory using the HTTP verb POST and the default document is a static file that does not support HTTP verbs other than GET or HEAD.
What you can try:
Verify the list of verbs enabled for the module handler this request was sent to, and ensure that this verb should be allowed for the Web site.
Check the IIS log file to see which verb is not allowed for the request.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
More Information... This error means that the request sent to the Web server contained an HTTP verb that is not allowed by the configured module handler for the request.
--------------------------------------------------------------------------------
Server Version Information: Internet Information Services 7.0.
Very clear and useful. This has saved me hours of time.
However I still can't get perl to work and have posted a new question
http://support.activestate.com/forum-topic/trying-to-get-perl-workin
Bob
OK I fixed my problem. I switched form Perl.exe to perlis.dll.
Now it magically works.
Bob
Here are some things I have discovered in porting a Perl Content management System from Unix to IIS which other may find useful:
At step 7:
1. Perl.exe didn't work for me at all.
2. perlex30.dll worked better but only some things were OK (I think it is like Mod_perl)
3. perlis.dll worked and programs developed for Unix originally seem to pretty much work out of the box.
Using perlis:
The information in the manual about turning the headers on or off using the registry entry EnableCGIHeaders doesn't seem to be correct.
You have to output ALL the mime headers you need. e.g.
print "HTTP/1.0 200 OK\nContent-type:text/html\n\n";
The perl error log including anything you print to STDERR is at c:\Perl\bin\PerlIs-Err.log
The shebang line is ignored but any switches in it are not. A program with -T in the shebang line failed to run and ran when I took it out. The error log wasn't very useful. -W stopped it running as well.
Bob
Hi, On trying these guides under 64 the system will not allow the arguements "%s" %s in the path name. It claims invalid path. Have tried wrapping whole lot in quotes but it doesn't work. Am I missing something obvious?
Perl is in and running as it executes from command line fine, it's adding the modules to IIS7 64 that I'm stuck on.
Thanks
Simon
Well... I followed the steps but couldn't get the script to run. Then (just for sake of experimentation) I clicked 'Yes' to the ISAPI message and that's it... It just started working!
Should I be concerned regarding this setting? Can I possibly have some issues with this?
I think the part of saying no is incorrect. I have the perl.exe working on vista ultimate 32bit. The configuration requiremnets for vista IIS is similar to 2003 IIS. You must allow the module in the restrictions part of IIS.
Look at my two screenshots of my system. They should help you
http://computernotions.info/forums/iis1.jpg
http://computernotions.info/forums/iis2.jpg
Of course change perl path to where you installed perl on your system.
I think it is IIS 6.0. Sorry, I am more of a developer than a network/system admin but I have to jump into this right now. I got IIS running on a Windows Server 2003 and for the life of me, I can't get Perl to work. I tried everything suggested but the last little part is always different for me than what's suggested and shown. For example, in that detailed step-by-step on setting up Perl in IIS Manager, what's Handler Mappings? I was able to set up the path and everything in IIS Manager -> domain (local computer) -> Web Sites -> virtual directory (Properties) and when the Properties windows, tab "Virtual Directory" and under "Application Settings", under "Starting Point" when you click on the "Configuration" button on the right.
Is that it? Or I shouldn't do this under Virtual directories?
Help please! I really don't want to develop this using ASP! This is why I am trying to get Perl to work on IIS!
Thanks!
J
http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx
I cannot begin to express my anger at Microsoft. IIS is horrible! Absolutely horrible!! And it gets worse each release!!