HTTP错误401.1 - 从本地IIS未经授权 [英] HTTP Error 401.1 - Unauthorized from Local IIS
问题描述
我在我的本地计算机上创建了可在调试模式下正常运行的网站,但是当我将网站放在我机器的本地iis(7.5)上时,我得到了
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错误401.1 - 未经授权
您无权使用您提供的凭据查看此目录或页面。
HTTP Error 401.1 - Unauthorized You do not have permission to view this directory or page using the credentials that you supplied.
身份验证设置
我有窗口启用模拟和Windows身份验证,禁用该部分中的所有其他内容
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?
推荐答案
作为一个快速而又脏的修复,授予 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:
- 打开IIS管理器,导航到部署站点的网站或应用程序文件夹。
- 打开高级设置(位于右侧操作窗格)。
- 记下应用程序池名称然后关闭此窗口
- 双击身份验证图标以打开身份验证设置
- 禁用 Windows身份验证
- 右键单击匿名身份验证,然后单击
编辑
- 选择
应用程序池标识
单选按钮单击确定
- 从左侧的IIS管理器树中选择应用程序池节点,然后选择在步骤3中记下的应用程序池名称。
- 右键单击并选择高级设置
- 展开流程模型设置,然后从内置帐户中选择
ApplicationPoolIdentity
下拉列表然后单击确定
。 - 再次单击
确定
以保存和关闭应用程序池高级设置pa ge - 打开管理员命令行(右键单击CMD图标并选择以管理员身份运行。它会出现在你的开始菜单上,可能在附件下。
- 运行以下命令:
- 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> / 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
这篇关于HTTP错误401.1 - 从本地IIS未经授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!