2

First off, I'm familiar with IIS however do not have much practical experience, hence why I have come here.

I have setup IIS7 and put my HTML website, scripts etc into the wwwroot folder. I'm able to browse the website locally just for testing purposes.

I have a webpage with a simple email form which uses Matt's Script Archive: FormMail.pl. Upon submission, I run into this error:

 405 - HTTP verb used to access this page is not allowed.
 The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

I'm not sure about this error or how to resolve it so the email form works.

If you need any additional information regarding this problem, I'll provide as much info as possible.

Thanks :)

Update:

Ok, so I have modified my HTML to use the nms script. In IIS I had to enable CGI and ISAPI as they weren't installed. Once they were installed I added a Script Handler Mapping for *.pl, *cgi; also added the Verbs GET, HEAD, and POST to both of the Handler Mappings. I than used:

 <!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
 <head>
 <title>Perl Test</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 </head>
 <body>
 <h1>Perl is working!</h1>
 </body>
 </html>

To test if the *.pl and *.cgi is working on the localhost.

Now comes the part where I'm stuck...

When I click on the submit button it directs me to the formmail.cgi (formmail.pl doesn't work for some reason) however it only directs me to the cgi script, and a blank, white page.

Chris
  • 107
  • 2
  • 4
  • 12
  • 8
    do NOT use [Matt's scripts](http://en.wikipedia.org/wiki/Matt's_Script_Archive), no really, don't! – pavel Oct 24 '12 at 10:23
  • 1
    Chris, pavel's link references the nms scripts, which are supposed to be more secure replacements. I don't have personal experience with them, though. – dan1111 Oct 24 '12 at 10:50

2 Answers2

1

405 means that your Web Server is not recognizing the HTTP metod(GET,POST,HEAD etc.) in the request. In your case I think that .pl extensions are not allowed by default to handle POST requests. Please refer to this link (taken from here) for creating Handler Mappings.

Community
  • 1
  • 1
Desislav Kamenov
  • 1,155
  • 6
  • 13
0

The most important thing to check with this error is the HTML tab within the Console window. Or if the error is showing in the browser, look there. In either case, look at the file type of the "Requested URL".

If it's a *.json file, follow these instructions. If it's some other format, you may have to adjust the exe file that's used in the handler mapping. Make sure to configure each at the server level!!! Don't click the site before clicking the Mime Types or Handler Mappings; click on the server name (in the tree/object explorer) instead so each site inherits the settings. Your web.config gets the handler mappings applied explicitly if you set them on the site also, but it doesn't if you add it at the server level.

http://www.uipress.com/add-json-handler-support-in-iis-7/#.UT_bw9aOR8E

Since you're dealing with CGI, you will have a slightly different script map executable. That should at least get you on the right track.

MacGyver
  • 16,700
  • 37
  • 145
  • 233