且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HTTP错误401.1 - 从本地IIS未经授权

更新时间:2023-12-01 15:31:16

作为一个快速而又脏的修复,授予 IIS_IUSRS group 读取/执行修改对您的网络文件夹的权限... 但请勿在互联网面向服务器上进行此操作,请继续阅读....

As a quick and dirty fix, grant the IIS_IUSRS group Read/Execute or Modify permissions to your web folder... BUT DON'T DO THIS ON AN INTERNET FACING SERVER, read on....

要正确解决此问题,您应该为您的网站授予应用程序池标识读取/执行修改权限阳离子的网络文件夹。为此:

To fix this properly you should grant the Application Pool Identity for your site Read/Execute or Modify permissions to your application's web folder. To do this:


  1. 打开IIS管理器,导航到部署站点的网站或应用程序文件夹。

  2. 打开高级设置(位于右侧操作窗格)。

  3. 记下应用程序池名称然后关闭此窗口

  4. 双击身份验证图标以打开身份验证设置

  5. 禁用 Windows身份验证

  6. 右键单击匿名身份验证,然后单击编辑

  7. 选择应用程序池标识单选按钮单击确定

  8. 从左侧的IIS管理器树中选择应用程序池节点,然后选择在步骤3中记下的应用程序池名称。

  9. 右键单击并选择高级设置

  10. 展开流程模型设置,然后从内置帐户中选择 ApplicationPoolIdentity 下拉列表然后单击确定

  11. 再次单击确定以保存和关闭应用程序池高级设置pa ge

  12. 打开管理员命令行(右键单击CMD图标并选择以管理员身份运行。它会出现在你的开始菜单上,可能在附件下。

  13. 运行以下命令:

  1. Open IIS Manager, navigate to your website or application folder where the site is deployed to.
  2. Open Advanced Settings (it's on the right hand Actions pane).
  3. Note down the Application Pool name then close this window
  4. Double click on the Authentication icon to open the authentication settings
  5. Disable Windows Authentication
  6. Right click on Anonymous Authentication and click Edit
  7. Choose the Application pool identity radio button the click OK
  8. Select the Application Pools node from IIS manager tree on left and select the Application Pool name you noted down in step 3
  9. Right click and select Advanced Settings
  10. Expand the Process Model settings and choose ApplicationPoolIdentity from the "Built-in account" drop down list then click OK.
  11. Click OK again to save and dismiss the Application Pool advanced settings page
  12. Open an Administrator command line (right click on the CMD icon and select "Run As Administrator". It'll be somewhere on your start menu, probably under Accessories.
  13. Run the following command:

icacls< path_to_site> / grantIIS APPPOOL \< app_pool_name>(CI)(OI)(M)

例如:

icacls C:\inetpub \ www.root \mysite \ / grantIIS APPPOOL \DEFAULTAPPPOOL:( CI)(OI)(M)

如果一切顺利 icacls.exe 将报告:


processed file: c:\inetpub\wwwroot\mysite
Successfully processed 1 files; Failed processing 0 files