HTTP Error 401.1 - Unauthorized from Local 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:
- Open IIS Manager, navigate to your website or application folder where the site is deployed to.
- Open Advanced Settings (it's on the right hand Actions pane).
- Note down the Application Pool name then close this window
- Double click on the Authentication icon to open the authentication settings
- Disable Windows Authentication
- Right click on Anonymous Authentication and click
Edit
- Choose the
Application pool identity
radio button the clickOK
- Select the Application Pools node from IIS manager tree on left and select the Application Pool name you noted down in step 3
- Right click and select Advanced Settings
- Expand the Process Model settings and choose
ApplicationPoolIdentity
from the "Built-in account" drop down list then clickOK
. - Click
OK
again to save and dismiss the Application Pool advanced settings page - 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.
- 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 授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:HTTP 错误 401.1 - 未经本地 IIS 授权


- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01