排除 MS Web Deploy ACL 权限错误问题

11

我一直在尝试将我的网站部署到运行Windows Server 2012/IIS8的新VPS上。Visual studio可以连接并创建目录结构,但是最终失败了。查看服务器日志,我得到了以下链接中描述的错误-请滚动到底部。

http://www.iis.net/learn/publish/troubleshooting-web-deploy/troubleshooting-common-problems-with-web-deploy

5/12/2011 11:31:41 AM) An error occurred when the request was processed on the remote computer.
The server experienced an issue processing the request. Contact the server administrator for more information.
This particular error does not give you much to go on, but the picture becomes much clearer if you look at the Web Deploy error log in Event Viewer.
User: DEPLOYSERVER\User1
Client IP: 192.168.0.203 
Content-Type: application/msdeploy
Version: 8.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 7.1.1070.1
MSDeploy.Method: Sync
MSDeploy.RequestId: 63b2f3d1-1817-444f-8280-9fa4f6f85d53
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
Skip: objectName="^configProtectedData$"
Provider: auto, Path:
Tracing deployment agent exception. Request ID '63b2f3d1-1817-444f-8280-9fa4f6f85d53'. Request Timestamp: '5/12/2011 9:31:41 AM'. Error Details:
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type, String name, SafeHandle handle, SecurityInfos securityInformation, SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections, Object exceptionContext)
at Microsoft.Web.Deployment.FileSystemSecurityEx.Persist(String path)
at Microsoft.Web.Deployment.SetAclProvider.Add(DeploymentObject source, Boolean whatIf)
at Microsoft.Web.Deployment.DeploymentObject.Update(DeploymentObject source, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleUpdate(DeploymentObject destObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)

为了修复,他们建议执行以下操作:

From this, we can see that User1 does not have rights to set security information. In this case, the user does not have Modify permissions on the content. Granting "Change Permissions" to the content resolves the problem.

'授予"更改权限"的含义是什么?'我认为他们是指文件权限,因此我已经给了网站目录结构读/写/修改文件权限,但我仍然收到错误消息。


7
基本上,我发现问题是我需要将完全控制权限授予LOCAL SERVICE,而我已经将其授予了IIS_USER。以下链接给了我解决方案:http://forums.iis.net/t/1188531.aspx/1。 - MPD
1
哇!我希望你已经将IIS_USER的权限更改回推荐的权限。在IIS_USER上拥有完整的用户权限是黑客的梦想。 - ATL_DEV
1
正如文章所述,您需要为LOCAL SERVICE提供完全控制权限,而不仅仅是修改权限。 - Simon_Weaver
Web Deploy 起作用了,然后我删除了该站点并重新创建了它,然后它就不起作用了,最后按照上面提到的方法将 LOCAL SERVICE 权限添加到文件夹中解决了问题。我永远不会知道为什么,但它确实起作用了。 - NibblyPig
1个回答

12
要使用Web Deploy,部署服务需要访问您的根Web应用程序文件夹的访问权限。所以我所做的就是将我的网站根目录文件夹的完全访问权限授予用户组“经过身份验证的用户”。这对我有效。

1
令人惊讶的是,经过数小时的尝试修复,这就是对我起作用的方法。 - Brian Ogden
2
您也可以授予“LOCAL SERVICE”或Web管理服务运行的任何标识完全控制权。不过,这样做有点麻烦。 - Sam

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接