Microsoft KB Archive/174789

= Perl Script Gets Access Denied Error on IIS =

Article ID: 174789

Article Last Modified on 6/22/2005

-

APPLIES TO


 * Microsoft Internet Information Server 2.0
 * Microsoft Internet Information Server 3.0

-



This article was previously published under Q174789



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SYMPTOMS
When you run a Perl script on a "secure" web page, Internet Information Server (IIS) returns the following error message:

Access Denied.

However, the Perl script will work correctly if the page were allowed Anonymous Access.



CAUSE
If the web server has a "secured" section where only authorized users have been granted access, and you set up a Perl script to run in that area, it will fail.

The IIS server will first try to access the page as the anonymous user. When the application or page is denied access, it must return a request to the web server for the authorized user information. However, the Perl interpreter does not do this; therefore, the script fails.



RESOLUTION
Run one copy of the Perl interpreter for the Anonymous Access section of the web site and another copy of the Perl interpreter for the Secured Access section of the web site.

 Create two directories in the \perl5\ directory named \bin-anonymous\ and \bin-secure\. Copy the contents of the \perl5\bin\ directory to the \bin-anonymous\ and the \bin-secure\ directories. Give the IUSR_machine-name account Read (RX) permissions to the \bin-anonymous\ directory. Give the Secured Access user accounts Read (RX) permissions to the \bin-secure\ directory.  Open your registry and add the following values.

WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows NT to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.

  HKEY_LOCAL_MACHINE\System \CurrentControlSet \Services \W3SVC \Parameters \Script Map .pla, REG_SZ: C:\Program Files\perl5\bin-anonymous\perl300.dll "Anonymous Access" scripts will be given this extension. .pls, REG_SZ: C:\Program Files\perl5\bin-secure\perl300.dll "Secured Access" scripts will be given this extension.

</li> Stop and restart your IIS services.</li> Rename the Perl scripts in your Anonymous Access directories to the *.pla extension.</li> Rename the Perl scripts in your Secured Access directories to the *.pls extension.</li> Modify your links.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
For further information on Perl please refer to http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/.

Keywords: kbprb kbprogramming KB174789

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.