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

HTTP Error 401.1 - Unauthorized from Local IIS(HTTP 错误 401.1 - 未经本地 IIS 授权)
本文介绍了HTTP 错误 401.1 - 未经本地 IIS 授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have created site on my local machine that works fine on debug mode but when i put the site on local iis (7.5) of my machine i get

HTTP Error 401.1 - Unauthorized You do not have permission to view this directory or page using the credentials that you supplied.

Authentication Settings I have windows impersonation and windows authentication enabled and everything else in that section is disabled

All the folder have full permissions

Can anyone tell me what's going on?

解决方案

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. 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> /grant "IIS APPPOOL<app_pool_name>"(CI)(OI)(M)

For example:

icacls C:inetpubwwwrootmysite /grant "IIS APPPOOLDEFAULTAPPPOOL":(CI)(OI)(M)

If all is good icacls.exe will report:

processed file: c:inetpubwwwrootmysite
Successfully processed 1 files; Failed processing 0 files

这篇关于HTTP 错误 401.1 - 未经本地 IIS 授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)